From owner-svn-src-stable-7@FreeBSD.ORG Wed Oct 20 17:58:12 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D86271065672; Wed, 20 Oct 2010 17:58:12 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5F378FC18; Wed, 20 Oct 2010 17:58:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9KHwCk1064695; Wed, 20 Oct 2010 17:58:12 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9KHwCqk064692; Wed, 20 Oct 2010 17:58:12 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201010201758.o9KHwCqk064692@svn.freebsd.org> From: Xin LI Date: Wed, 20 Oct 2010 17:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214112 - in stable/7: share/man/man4 sys/net X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Oct 2010 17:58:13 -0000 Author: delphij Date: Wed Oct 20 17:58:12 2010 New Revision: 214112 URL: http://svn.freebsd.org/changeset/base/214112 Log: MFC r190527,190528,190531: 190527(sam): fix wired-wireless failover example and remove incorrect comment about WPA not working 190528(sam): remove bogus nwid use; that's a compat shim for netbsd 190531(bruffer): Fix typo. MFC r212100 (emaste),213632,214066: Add a new syslog knob, net.link.lagg.failover_rx_all, to control whether to accept input packets on any link in a failover lagg, and add the corresponding documentation. Modified: stable/7/share/man/man4/lagg.4 stable/7/sys/net/if_lagg.c Directory Properties: stable/7/share/man/man4/ (props changed) stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/share/man/man4/lagg.4 ============================================================================== --- stable/7/share/man/man4/lagg.4 Wed Oct 20 17:42:10 2010 (r214111) +++ stable/7/share/man/man4/lagg.4 Wed Oct 20 17:58:12 2010 (r214112) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 17, 2007 +.Dd October 18, 2010 .Dt LAGG 4 .Os .Sh NAME @@ -73,11 +73,19 @@ The interface link state is used to vali not. .Bl -tag -width loadbalance .It Ic failover -Sends and receives traffic only through the master port. +Sends traffic only through the active port. If the master port becomes unavailable, the next active port is used. The first interface added is the master port; any interfaces added after that are used as failover devices. +.Pp +By default, received traffic is only accepted when they are received +through the active port. +This constraint can be relaxed by setting the +.Va net.link.lagg.failover_rx_all +.Xr sysctl 8 +variable to a nonzero value, +which is useful for certain bridged network setups. .It Ic fec Supports Cisco EtherChannel. This is a static setup and does not negotiate aggregation with the peer or @@ -142,13 +150,18 @@ Whenever the wired master interface is u device will be used: .Bd -literal -offset indent # ifconfig em0 up -# ifconfig ath0 nwid my_net up -# ifconfig lagg0 laggproto failover laggport em0 laggport ath0 \e +# ifconfig ath0 ether 00:11:22:33:44:55 +# ifconfig create wlan0 wlandev ath0 ssid my_net up +# ifconfig lagg0 laggproto failover laggport em0 laggport wlan0 \e 192.168.1.1 netmask 255.255.255.0 .Ed +.Pp +(Note the mac address of the wireless device is forced to match the wired +device as a workaround.) .Sh SEE ALSO .Xr ng_fec 4 , .Xr ng_one2many 4 , +.Xr sysctl 8 , .Xr ifconfig 8 .Sh HISTORY The @@ -172,6 +185,3 @@ There is no way to configure LACP admini and port priorities. The current implementation always performs active-mode LACP and uses 0x8000 as system and port priorities. -.Pp -WPA security does not currently work correctly with a wireless interface added -to the lagg port. Modified: stable/7/sys/net/if_lagg.c ============================================================================== --- stable/7/sys/net/if_lagg.c Wed Oct 20 17:42:10 2010 (r214111) +++ stable/7/sys/net/if_lagg.c Wed Oct 20 17:58:12 2010 (r214112) @@ -159,6 +159,14 @@ static const struct { { LAGG_PROTO_NONE, NULL } }; +SYSCTL_DECL(_net_link); +SYSCTL_NODE(_net_link, OID_AUTO, lagg, CTLFLAG_RW, 0, "Link Aggregation"); + +static int lagg_failover_rx_all = 0; /* Allow input on any failover links */ +SYSCTL_INT(_net_link_lagg, OID_AUTO, failover_rx_all, CTLFLAG_RW, + &lagg_failover_rx_all, 0, + "Accept input from any interface in a failover lagg"); + static int lagg_modevent(module_t mod, int type, void *data) { @@ -1476,7 +1484,7 @@ lagg_fail_input(struct lagg_softc *sc, s struct ifnet *ifp = sc->sc_ifp; struct lagg_port *tmp_tp; - if (lp == sc->sc_primary) { + if (lp == sc->sc_primary || lagg_failover_rx_all) { m->m_pkthdr.rcvif = ifp; return (m); }