svn commit: r237670 - in stable/9: sbin/ifconfig sys/net

看板FB_svn作者時間13年前 (2012/06/28 10:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
Author: thompsa Date: Wed Jun 27 22:09:04 2012 New Revision: 237670 URL: http://svn.freebsd.org/changeset/base/237670 Log: MFC r236178 if_lagg: allow to invoke SIOCSLAGGPORT multiple times in a row Modified: stable/9/sbin/ifconfig/iflagg.c stable/9/sys/net/if_lagg.c Directory Properties: stable/9/sbin/ifconfig/ (props changed) stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sbin/ifconfig/iflagg.c ============================================================================== --- stable/9/sbin/ifconfig/iflagg.c Wed Jun 27 22:06:42 2012 (r237669) +++ stable/9/sbin/ifconfig/iflagg.c Wed Jun 27 22:09:04 2012 (r237670) @@ -40,7 +40,8 @@ setlaggport(const char *val, int d, int strlcpy(rp.rp_ifname, name, sizeof(rp.rp_ifname)); strlcpy(rp.rp_portname, val, sizeof(rp.rp_portname)); - if (ioctl(s, SIOCSLAGGPORT, &rp)) + /* Don't choke if the port is already in this lagg. */ + if (ioctl(s, SIOCSLAGGPORT, &rp) && errno != EEXIST) err(1, "SIOCSLAGGPORT"); } Modified: stable/9/sys/net/if_lagg.c ============================================================================== --- stable/9/sys/net/if_lagg.c Wed Jun 27 22:06:42 2012 (r237669) +++ stable/9/sys/net/if_lagg.c Wed Jun 27 22:09:04 2012 (r237670) @@ -516,8 +516,13 @@ lagg_port_create(struct lagg_softc *sc, return (ENOSPC); /* Check if port has already been associated to a lagg */ - if (ifp->if_lagg != NULL) + if (ifp->if_lagg != NULL) { + /* Port is already in the current lagg? */ + lp = (struct lagg_port *)ifp->if_lagg; + if (lp->lp_softc == sc) + return (EEXIST); return (EBUSY); + } /* XXX Disallow non-ethernet interfaces (this should be any of 802) */ if (ifp->if_type != IFT_ETHER) _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
文章代碼(AID): #1Fwy8bj3 (FB_svn)