diff options
author | thompsa <thompsa@FreeBSD.org> | 2005-12-21 21:29:45 +0000 |
---|---|---|
committer | thompsa <thompsa@FreeBSD.org> | 2005-12-21 21:29:45 +0000 |
commit | 42c9ecf9f57f7681e401bcf499946dbe2f2cd09f (patch) | |
tree | fbd9c548f0727ef749bbae4f6181a65a63dbc539 /sys/net/if_bridge.c | |
parent | 09b665597401a6c52abc7955a365036782ba772a (diff) | |
download | FreeBSD-src-42c9ecf9f57f7681e401bcf499946dbe2f2cd09f.zip FreeBSD-src-42c9ecf9f57f7681e401bcf499946dbe2f2cd09f.tar.gz |
Add RFC 3378 EtherIP support. This change makes it possible to add gif
interfaces to bridges, which will then send and receive IP protocol 97 packets.
Packets are Ethernet frames with an EtherIP header prepended.
Obtained from: NetBSD
MFC after: 2 weeks
Diffstat (limited to 'sys/net/if_bridge.c')
-rw-r--r-- | sys/net/if_bridge.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index a91adbd..d98052f 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -724,6 +724,9 @@ bridge_delete_member(struct bridge_softc *sc, struct bridge_iflist *bif, (void) ifpromisc(ifs, 0); break; + case IFT_GIF: + break; + default: #ifdef DIAGNOSTIC panic("bridge_delete_member: impossible"); @@ -781,12 +784,15 @@ bridge_ioctl_add(struct bridge_softc *sc, void *arg) if (ifs == bif->bif_ifp) return (EBUSY); - /* Allow the first member to define the MTU */ - if (LIST_EMPTY(&sc->sc_iflist)) - sc->sc_ifp->if_mtu = ifs->if_mtu; - else if (sc->sc_ifp->if_mtu != ifs->if_mtu) { - if_printf(sc->sc_ifp, "invalid MTU for %s\n", ifs->if_xname); - return (EINVAL); + /* Allow the first Ethernet member to define the MTU */ + if (ifs->if_type != IFT_GIF) { + if (LIST_EMPTY(&sc->sc_iflist)) + sc->sc_ifp->if_mtu = ifs->if_mtu; + else if (sc->sc_ifp->if_mtu != ifs->if_mtu) { + if_printf(sc->sc_ifp, "invalid MTU for %s\n", + ifs->if_xname); + return (EINVAL); + } } if (ifs->if_bridge == sc) @@ -810,6 +816,9 @@ bridge_ioctl_add(struct bridge_softc *sc, void *arg) goto out; break; + case IFT_GIF: + break; + default: error = EINVAL; goto out; @@ -1553,6 +1562,9 @@ bridge_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *sa, LIST_FOREACH(bif, &sc->sc_iflist, bif_next) { dst_if = bif->bif_ifp; + + if (dst_if->if_type == IFT_GIF) + continue; if ((dst_if->if_drv_flags & IFF_DRV_RUNNING) == 0) continue; @@ -1944,6 +1956,8 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) * Unicast. Make sure it's not for us. */ LIST_FOREACH(bif, &sc->sc_iflist, bif_next) { + if(bif->bif_ifp->if_type == IFT_GIF) + continue; /* It is destined for us. */ if (memcmp(IF_LLADDR(bif->bif_ifp), eh->ether_dhost, ETHER_ADDR_LEN) == 0) { |