Deleted Added
full compact
if_lagg.c (251859) if_lagg.c (252511)
1/* $OpenBSD: if_trunk.c,v 1.30 2007/01/31 06:20:19 reyk Exp $ */
2
3/*
4 * Copyright (c) 2005, 2006 Reyk Floeter <reyk@openbsd.org>
5 * Copyright (c) 2007 Andrew Thompson <thompsa@FreeBSD.org>
6 *
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above

--- 4 unchanged lines hidden (view full) ---

13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */
19
20#include <sys/cdefs.h>
1/* $OpenBSD: if_trunk.c,v 1.30 2007/01/31 06:20:19 reyk Exp $ */
2
3/*
4 * Copyright (c) 2005, 2006 Reyk Floeter <reyk@openbsd.org>
5 * Copyright (c) 2007 Andrew Thompson <thompsa@FreeBSD.org>
6 *
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above

--- 4 unchanged lines hidden (view full) ---

13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */
19
20#include <sys/cdefs.h>
21__FBSDID("$FreeBSD: head/sys/net/if_lagg.c 251859 2013-06-17 19:31:03Z delphij $");
21__FBSDID("$FreeBSD: head/sys/net/if_lagg.c 252511 2013-07-02 16:58:15Z hrs $");
22
23#include "opt_inet.h"
24#include "opt_inet6.h"
25
26#include <sys/param.h>
27#include <sys/kernel.h>
28#include <sys/malloc.h>
29#include <sys/mbuf.h>

--- 28 unchanged lines hidden (view full) ---

58#ifdef INET
59#include <netinet/in_systm.h>
60#include <netinet/if_ether.h>
61#include <netinet/ip.h>
62#endif
63
64#ifdef INET6
65#include <netinet/ip6.h>
22
23#include "opt_inet.h"
24#include "opt_inet6.h"
25
26#include <sys/param.h>
27#include <sys/kernel.h>
28#include <sys/malloc.h>
29#include <sys/mbuf.h>

--- 28 unchanged lines hidden (view full) ---

58#ifdef INET
59#include <netinet/in_systm.h>
60#include <netinet/if_ether.h>
61#include <netinet/ip.h>
62#endif
63
64#ifdef INET6
65#include <netinet/ip6.h>
66#include <netinet6/in6_var.h>
67#include <netinet6/in6_ifattach.h>
66#endif
67
68#include <net/if_vlan_var.h>
69#include <net/if_lagg.h>
70#include <net/ieee8023ad_lacp.h>
71
72/* Special flags we should propagate to the lagg ports. */
73static struct {

--- 464 unchanged lines hidden (view full) ---

538 return (EEXIST);
539 return (EBUSY);
540 }
541
542 /* XXX Disallow non-ethernet interfaces (this should be any of 802) */
543 if (ifp->if_type != IFT_ETHER)
544 return (EPROTONOSUPPORT);
545
68#endif
69
70#include <net/if_vlan_var.h>
71#include <net/if_lagg.h>
72#include <net/ieee8023ad_lacp.h>
73
74/* Special flags we should propagate to the lagg ports. */
75static struct {

--- 464 unchanged lines hidden (view full) ---

540 return (EEXIST);
541 return (EBUSY);
542 }
543
544 /* XXX Disallow non-ethernet interfaces (this should be any of 802) */
545 if (ifp->if_type != IFT_ETHER)
546 return (EPROTONOSUPPORT);
547
548#ifdef INET6
549 /*
550 * The member interface should not have inet6 address because
551 * two interfaces with a valid link-local scope zone must not be
552 * merged in any form. This restriction is needed to
553 * prevent violation of link-local scope zone. Attempts to
554 * add a member interface which has inet6 addresses triggers
555 * removal of all inet6 addresses on the member interface.
556 */
557 SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) {
558 if (in6ifa_llaonifp(lp->lp_ifp)) {
559 in6_ifdetach(lp->lp_ifp);
560 if_printf(sc->sc_ifp,
561 "IPv6 addresses on %s have been removed "
562 "before adding it as a member to prevent "
563 "IPv6 address scope violation.\n",
564 lp->lp_ifp->if_xname);
565 }
566 }
567 if (in6ifa_llaonifp(ifp)) {
568 in6_ifdetach(ifp);
569 if_printf(sc->sc_ifp,
570 "IPv6 addresses on %s have been removed "
571 "before adding it as a member to prevent "
572 "IPv6 address scope violation.\n",
573 ifp->if_xname);
574 }
575#endif
546 /* Allow the first Ethernet member to define the MTU */
547 if (SLIST_EMPTY(&sc->sc_ports))
548 sc->sc_ifp->if_mtu = ifp->if_mtu;
549 else if (sc->sc_ifp->if_mtu != ifp->if_mtu) {
550 if_printf(sc->sc_ifp, "invalid MTU for %s\n",
551 ifp->if_xname);
552 return (EINVAL);
553 }

--- 1373 unchanged lines hidden ---
576 /* Allow the first Ethernet member to define the MTU */
577 if (SLIST_EMPTY(&sc->sc_ports))
578 sc->sc_ifp->if_mtu = ifp->if_mtu;
579 else if (sc->sc_ifp->if_mtu != ifp->if_mtu) {
580 if_printf(sc->sc_ifp, "invalid MTU for %s\n",
581 ifp->if_xname);
582 return (EINVAL);
583 }

--- 1373 unchanged lines hidden ---