summaryrefslogtreecommitdiff
path: root/sys/net/if_gre.c
AgeCommit message (Collapse)Author
2018-03-12Delete unused variable.Kenji Aoyama
ok jsg@
2018-03-12give mgre(4) the IFF_MULTICAST and IFF_SIMPLEX flagsDavid Gwynne
according to small bits of cisco doco, multicast can be implemented on mgre using head-end replication. that isnt implemented, but the flags do allow ipv6 addresses to be added to the interface.
2018-03-01copy p2p_rtrequest to mgre_rtrequest, so it can be tweakedDavid Gwynne
2018-02-27change mgre tunnel configuration to only accept a single local address.David Gwynne
this relies on ifconfig tunneladdr
2018-02-27make kernel compile again without INET6Sebastian Benoit
ok mpi@
2018-02-27use a macro for the default if_hdrlen, not a magic numberDavid Gwynne
suggested by mpi@
2018-02-27annotate some data structures with the lock protecting them.David Gwynne
in practice this means NET_ASSERT_LOCKED() near the lists and trees holding the different types of gre interfaces. suggested by mpi@
2018-02-27add support for point to multipoint GRE via mgre(4).David Gwynne
mgre is different to gre in that the tunnel only needs configuration for a local address, and the address inside the tunnel is configured on it is a subnet. other addresses on that subnet get mapped to a tunnel endpoint and send there. at the moment that mechanism is the routing table, using non-gateway host routes with the tunnel endpoint as the gateway address. the tunnel address configuration is ugly and confusing atm, but should improve soon. ok mpi@ who has some suggestions i can do in the tree.
2018-02-25default the nvgre vnetid to the first valid value according to the rfcDavid Gwynne
2018-02-24when comparing nvgre entries, compare a with b, not a with itself.David Gwynne
2018-02-22remove some debug code in nvgreDavid Gwynne
2018-02-22don't get in the way of setting the rdomain on gre(4)David Gwynne
2018-02-21implement nvgre(4) based on rfc7637 aka NVGREDavid Gwynne
NVGRE is short for Network Virtualization Using Generic Routing Encapsulation. it provides an overlay ethernet network with multiple ip peers, rather than a tunnel to a single peer like egre(4) provides. unlike egre the vnetid is mandantory and always 24 bits. it offers similar functionality to vxlan(4).
2018-02-21if egre takes the packet, it's done, don't fall through to l3 processing.David Gwynne
2018-02-21whitespace fixesDavid Gwynne
2018-02-20cisco set the tos on their keepalive packets to ip precedenceDavid Gwynne
internet control, so we can too.
2018-02-20add support for vnetflowid.David Gwynne
when enabled, the 32bit key on gre a packet is split into a 24bit key and an 8 bit flow id. this allows better use of multipath links if the intermediate routers feed the gre key into their hashing algorithms. because gre can encapsulate pretty much anything, it can be non-trivial for a router to reach into a payload to harvest entropy for feeding into a hashing algorithm. having the endpoints do it and feed it into the gre header is a lot simpler. this allows interoperationg with cisco gre tunnels with key entropy enabled. this was tested against a csr1000v. also, this arrangement coincides with how nvgre works, so it paves the way for supporting that protocol. right now the driver relies on the flowid in mbufs to populate the packet field. this generally means that pf should be enabled to provide the flowid.
2018-02-19support configuration of fragmentation of the tunnel trafficDavid Gwynne
2018-02-16make gre_encap prepend both the gre and tunnel ip headers.David Gwynne
makes the code a bit more straightforward
2018-02-16put egre back in a treeDavid Gwynne
it's new so there's no existing configs to be compat with.
2018-02-16allow wccp processing to be enabled per interface with the link0 flag.David Gwynne
this also changes the wccp handling to peek into it's payload to determine whether it is wccp 1 or 2. wccp1 says the gre header is followed by ipv4, while wccp2 says there's a small header before the ipv4 packet. the wccp2 header cannot have 4 in the first nibble, while ipv4 must have 4 in the first nibble. the code now looks at the nibble to determine whether it should strip the wccp2 header or not.
2018-02-15take egre(4) packets out early in gre inputDavid Gwynne
this lets us look up the gre(4) interface before looking at the protocols it might be carrying.
2018-02-12restore the previous semantics wrt if up, tunnel, and address config.David Gwynne
this is a port of the change made to if_etherip.c r1.35 to allow addresses to be configured before the tunnel is configured. this rollback is particularly annoying on gre with keepalives. keepalives rely on the interface rdomain and tunnel rdomain to be the same, which the rolled back semantics checked. now it is possible to create an invalid configuration and not get any feedback about it.
2018-02-12dont handle SIOCSIFRDOMAIN twice, egre isn't supposed to filter it.David Gwynne
2018-02-09use in_addr and in6_addr instead of uint32_tsDavid Gwynne
2018-02-09bring back the wccp shizz.David Gwynne
2018-02-08implement support for tunnelttl copy.David Gwynne
if the ttl is set to copy, gre will copy the ttl in and out of the encapsulated packet. it's probably a good idea to set this the same on both ends of a tunnel. egre doesn't support tunnelttl copy.
2018-02-08ttl 0 is not valid on the wire, so dont accept it.David Gwynne
2018-02-08implement ethernet over gre encapsulation with a thing egre(4) driver.David Gwynne
there's three main chunks in this: transmit, receive, and factoring out common gre code. ethernet over gre unfortunately doesnt pad ethernet frames, so their payload on rx and their headers on tx will be misaligned. egre copes with this in the rx path by copying the payload with m_dup_pkt if it detects misalignment. in the tx path, it unconditionally allocates a new mbuf for the headers, that can be aligned separately to the existing payload. most of the common gre code is in the ioctl paths, so this diff adds gre_tunnel_ioctl, which is in the spirit of ether_ioctl. ok claudio@
2018-02-08gre doesnt need ifmediaDavid Gwynne
2018-02-08reintroduce support for keepalives.David Gwynne
there's a couple of bug fixes in here too. this properly initializes the ttl on the tunnel, and it clears the ip_off header. requested by claudio@
2018-02-07update the gre driver.David Gwynne
the main new feature is gre keys, supported by the vnetid ioctls. this also adds support for gre over ipv6, the use of hfsc, and allows tx mitigation in the future. this diff removes keepalive support, but i promised claudio@ and patrick@ i would put it back after this goes in. ok claudio@
2018-02-07remove mobileip(4) tendrilsDavid Gwynne
2018-01-09Creating a cloned interface could return ENOMEM due to temporaryAlexander Bluhm
memory shortage. As it is invoked from a system call, it should not fail and wait instead. OK visa@ mpi@
2017-10-20Kill dead ioctl handlers.Martin Pieuchot
SIOCGIF{HARD,}MTU are handled by ifioctl() and not passed down to drivers. ok visa@
2017-08-11Remove NET_LOCK()'s argument.Martin Pieuchot
Tested by Hrvoje Popovski, ok bluhm@
2017-05-15Remove unused variable mobileip_softc_list.Alexander Bluhm
OK mpi@
2017-05-15Protect the gloal list of gre(4) interfaces by the NET_LOCK().Martin Pieuchot
ok bluhm@
2017-01-24A space here, a space there. Soon we're talking real whitespaceKenneth R Westerback
rectification.
2017-01-23Flag pseudo-interfaces as such in order to call add_net_randomness()Martin Pieuchot
only once per packet. Fix a regression introduced when if_input() started to be called by every pseudo-driver. ok claudio@, dlg@
2016-12-19Sending keep alive ends up in ip_output(), so it needs the NET_LOCK().Martin Pieuchot
ok bluhm@
2016-11-16Convert gre_send_keepalive() to timeout_set_proc(9) as it calls ip_output().Martin Pieuchot
2016-08-31Split gre(4) into two interfaces: gre(4) and mobileip(4).Reyk Floeter
Like vlan/svlan and tun/tap, it remains a single driver that decides on the mode based on the interface name. This removes the need for removing the default link0 flag to turn gre into Mobile IP mode. Using linkX / IFF_LINK{0,1,2} for interface modes is a deprecated style. OK millert@ dlg@ many Not much consensus on the name but mobileip is also used for the sysctls, so OK henning@
2016-08-28Remove obsolete gre(4) ioctls GRESADDRS, GRESADDRD, GREGADDRS,Reyk Floeter
GREGADDRD, GRESPROTO, and GREGPROTO. They have been replaced by generic ioctls some time ago (eg. the "ifconfig gre0 tunnel") and there is no need to keep the old ones around. They are neither used in base nor in ports. OK sthen@
2015-11-10dont use IF_DROP when there was some arbitary problem sending a packet.David Gwynne
IF_DROP increments the drop counter on the send queue, it exists to indicate a drop on the send queue. if there was an error sending a packet be content incrementing if_oerrors. ok mpi@ uebayasi@
2015-11-09use the correct rdomain when sending gre(4) keepalive packets.Sebastian Benoit
bug found and fixed by Joonas Ruohonen, thanks ok claudio@ phessler@
2015-10-25Introduce if_rtrequest() the successor of ifa_rtrequest().Martin Pieuchot
L2 resolution depends on the protocol (encoded in the route entry) and an ``ifp''. Not having to care about an ``ifa'' makes our life easier in our MP effort. Fewer dependencies between data structures implies fewer headaches. Discussed with bluhm@, ok claudio@
2015-07-16Expand ancient NTOHL/NTOHS/HTONS/HTONL macros.Martin Pieuchot
ok guenther@, henning@
2015-03-14Remove some includes include-what-you-use claims don'tJonathan Gray
have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
2014-12-19unifdef INET in net code as a precursor to removing the pretend option.Ted Unangst
long live the one true internet. ok henning mikeb