summaryrefslogtreecommitdiff
path: root/sys/net
AgeCommit message (Collapse)Author
2018-03-13on input, check the unicast address before the multicast handling.David Gwynne
if the mac address is not for the interface, it must be multicast or broadcast. this is instead of if the packet is not multicast/broadcast, it must be for the interface. this allows ethernet interfaces to have multicast mac addresses without having to special case it themselves. eg, carp load balancing should become easier with this. ok mpi@
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-06If source and destination addresses are equal, the incoming andAlexander Bluhm
outgoing state key is the same. In this case the reverse link loops to the same state key. The assertion in pf_state_key_link_reverse() did not expect this and the kernel crashed. bug reported and fix tested by Johan Huldtgren; OK sashan@ visa@
2018-03-02Protect the calls to ifpromisc() in bpf(4) with net lock. ThisAlexander Bluhm
affects the bpfioctl() and bpfclose() path. lock assertion reported and fix tested by Pierre Emeriaud; OK visa@
2018-03-02Revert all the bits of the autocreate 127.0.0.1 on lo(4) creation for now.Claudio Jeker
This needs to go back to the drawing board.
2018-03-01copy p2p_rtrequest to mgre_rtrequest, so it can be tweakedDavid Gwynne
2018-02-28fix up matching of incoming traffic to interfaces.David Gwynne
i was assigning to ip dst to both the key src and dst, which meant no traffic matched and it fell through the network stacks ipip processing. based on some excellent investigation by andreas bartelt.
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-22Always reallocate a new memory chunk when changing the gateway of aMartin Pieuchot
route entry. This makes sure we pass the correct size to free(9). Reproted by and ok dlg@
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-20Removing an RTF_CLONING route entry should not invalidate an RTF_CACHEDMartin Pieuchot
entry that has been cloned from a different RTF_CLONING route. Bug report & ok friehm@
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-20only allow root to use SIOCSVNETFLOWID.David Gwynne
2018-02-20add support for setting the tunnel df bit.David Gwynne
ok mpi@
2018-02-19Remove almost unused `flags' argument of suser().Martin Pieuchot
The account flag `ASU' will no longer be set but that makes suser() mpsafe since it no longer mess with a per-process field. No objection from millert@, ok tedu@, bluhm@
2018-02-19tunneldf needs ifr_dfDavid Gwynne
2018-02-19support configuration of fragmentation of the tunnel trafficDavid Gwynne
2018-02-19enable configuration of tunnel fragmentation.David Gwynne
2018-02-19initialise sc_df to 0 in clone create rather than setting sc_ttl badlyDavid Gwynne
2018-02-19add code to support configuration of tunnel traffic fragmentationDavid Gwynne
2018-02-19make sure only root can configure an interface with SIOCSLIFPHYDF.David Gwynne
2018-02-18don't allow configuration of non-ipv4 addresses.David Gwynne
i found out how to do this while reading the freebsd stf(4) driver.
2018-02-18- regression in pflog outputAlexandr Nedvedicky
pf_match_rule() must remember current anchor before descents towards leaf. it must restore anchor as it ascents towards root. Bug pointed out and fix also tested by Matthias Pitzl from genua. OK bluhm@
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.
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-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.
2018-02-12use a mobileip_tunnel struct to represent the interfaces tunnel info.David Gwynne
this avoids allocating a mobileip_softc on the stack to build a key for looking up interfaces with on packet input. struct ifnet inside mobileip_softc is "quite large", and may blow the 2k limit one day.
2018-02-12restore the previous semantics wrt if up, tunnel, and address config.David Gwynne
our network drivers have a feature where if you configure an address on the interface, it implicitly brings the interface up. i changed etherip so you could only change the tunnel configuration while it down, but maintained the implicit up behaviour. bringing the tunnel up also relied on having valid configuration, ie, tunnel addreses must be configured otherwise up will fail. this means people who have address config in their hostname.etherip files before config for the tunnel addresses will have problems. firstly, the address wont be configured because falling through to the interface up fails because the tunnel isnt configured correctly, and that error makes the address config roll back. secondly, config that relies on configuring the address to bring the interface up will fail because there's no explicit up after the tunnel config. this diff rolls the tunnel config back to keeping the interface on a list, and allowing config at any time. the caveat to this is that it makes mpsafety hard because inconsistent intermediate states are visible when packets are being processed.
2018-02-12; ends c statements, not ;;David Gwynne
2018-02-12dont handle SIOCSIFRDOMAIN twice, egre isn't supposed to filter it.David Gwynne
2018-02-11Add a ROUTE_PRIOFILTER socket option for roueing sockets thatSebastian Benoit
allows filtering on the priority of the route. All routes up to the specified value will be passed. ok claudio, ok henning previous version, feedback and manpage from sthen.
2018-02-11if an interface is added to the bridge that doesn't exist, try to create itHenning Brauer
triggered by djm's dhclient on vether on bridge setup ok djm benno claudio
2018-02-10There is a problem with assigning 127.0.0.1 here. Revert the callClaudio Jeker
to in_up_loopback(). There is an issue when doing ifconfig lo0 127.0.0.1/8 the system ends up with 2 127.0.0.1 routes which breaks things like smptd. Found by tb@
2018-02-10If the kernel fails to clone an entry, report rtrequest(9) error.Martin Pieuchot
ok claudio@, jmatthew@