summaryrefslogtreecommitdiff
path: root/sys/net
AgeCommit message (Collapse)Author
2016-08-19Do not seroize a struct needed for RTM_RESOLVE in the hot path.Martin Pieuchot
ok phessler@, bluhm@, tedu@, natano@
2016-08-17Reintroduce 5.3-style checksum modification to preserve end-to-end checksumsprocter
when fiddling with packets but without the mess that motivated Henning to remove it. Affects only this one aspect of Henning's checksum work. Also tweak the basic algorithm and supply a correctness argument. OK dlg@ deraadt@ sthen@; no objection henning@
2016-08-16Mask the ``prio'' prior to comparing it to RTP_LOCAL.Martin Pieuchot
This allows rt_if_remove() to remove RTF_BROACAST routes from down interfaces. Issue reported by Dimitris Papastamos on bugs@ ok dlg@, claudio@, phessler@
2016-08-15replace the last uses of m_copym2 with m_dup_pkt.David Gwynne
ok mpi@ visa@
2016-08-15No need to reset si_selpid after calling selwakeup() the functionMartin Pieuchot
already does it.
2016-08-15Introduce bpf_put() and bpf_get() instead of mixing macro and functionsMartin Pieuchot
for the reference counting. ok dlg@
2016-08-15Check if ``bd_bif'' is NULL inside bpf_catchpacket() to match bpfread()Martin Pieuchot
and bpfwrite(), all of which will need to grabe a lock to protect the buffers. ok dlg@
2016-08-15Merge bpfilter_create() into bpfopen() and make it such that theMartin Pieuchot
descriptor is referenced before it is inserted in the global list. ok dlg@
2016-08-11take TASKQ_CANTSLEEP way from the softnet taskq.David Gwynne
the big reason for this is to let us use rw locks in the network stack, which is how at least two major efforts outside the tree have approached making pf mpsafe. this was discussed at length at n2k16. there was general agreement that this is necessary for us to move smp work forward in the stack.
2016-08-07whitespaceReyk Floeter
2016-08-07Define VXLAN_VNI_UNSET and VXLAN_VNI_MAX instead of using magic numbers.Reyk Floeter
No functional change.
2016-08-06Add support for IPv6 tunnel endpoints. This currently only works forReyk Floeter
unicast mode, multicast is not yet supported. ifconfig vxlan0 tunnel fd00::1 fd00::2 Roughly based on an earlier diff by goda@ OK yasuoka@
2016-08-06Fix multicast mode (destination is a multicast IP): the BCAST andReyk Floeter
MCAST flags have to be cleared from the mbuf after decapsulating packets. This fixes tunneled broadcast packets, eg. ARP. It used to work before the input path was changed the flags got cleared later in the stack. OK yasuoka@
2016-07-25Make sure closed bpf devices are removed from bpf_d_list to free theMartin Natano
minor number for reuse by the device cloning code. This fixes a panic reported by bluhm@. initial diff from tedu ok deraadt
2016-07-22Check for errors when deleting routes inside rtable_walk() and abortMartin Pieuchot
the walk if a route cannot be deleted. Prevent an infinite recursion reported by Dimitris Papastamos. ok claudio@
2016-07-19style: no spaces after # for define/include, ok phessler bennoHenning Brauer
2016-07-19don't hide globals between function prototypes; ok phessler bennoHenning Brauer
2016-07-19remove wrong and misleading comment, ok phesslerHenning Brauer
2016-07-19Revert use of the _SAFE version of SRPL_FOREACH() now that the offendingMartin Pieuchot
function has been fixed. Functions passed to rtable_walk() must return EAGAIN if they delete an entry from the tree, no matter if it is a leaf or not.
2016-07-19Return EAGAIN for every deleted route when detaching an interface.Martin Pieuchot
Previously the code was "too clever" and returned EAGAIN only for cloning route assuming that other deletion did not modify the tree. Analysed by and ok dlg@
2016-07-18no more cbq_opts - CBQ is gone, ok mpi phessler bennoHenning Brauer
2016-07-18Hide pf internals by moving code from in_ouraddr() to pf_ouraddr().Alexander Bluhm
OK mpi@ sashan@
2016-07-13Move ARP processing back to the KERNEL_LOCK()ed task until the raceMartin Pieuchot
triggered by updating a cached, but removed from the table, entry is properly fixed. Diff from dlg@, prodding deraadt@
2016-07-13Introduce RTF_MULTICAST and flag corresponding IPv6 routes as suchMartin Pieuchot
instead of abusing RTF_CLONING. Fix a leak reporeted by Aaron Riekenberg on misc@, ok sthen@
2016-07-12Directly drop packets filtered by bpf(4) instead of going through theMartin Pieuchot
input handlers. ok dlg@
2016-07-11Path MTU discovery was slightly broken. I took two ICMP packetsAlexander Bluhm
to create and change the dynamic route. This behavior was introduced in net/route.c rev 1.269 when the gateway route allocation was moved from rt_setgateway() to _rtalloc(). So rtrequest(RTM_ADD) could return a route without a valid gateway route. To fix this, call rt_setgwroute() from _rtalloc() and rt_setgateway(). OK mpi@
2016-07-11Revert the introduction of ``rt_addr''.Martin Pieuchot
Being able to add route entries without configured addresses is a nice feature but this is not my fight. So I'd rather no add another pointer to ``struct rtentry'' if I'm not removing another one.
2016-07-04Use the _SAFE_ version of SRPL_FOREACH() in rtable_walk_helper() toMartin Pieuchot
prevent an off-by-one when removing entries from the mpath list. Fix a regression introduced by the refactoring needed to serialize rtable_walk() with create/delete. ok jca@
2016-06-24The function pf_get_sport() did work for out rules only. Make itAlexander Bluhm
aware of the direction of the packet. Now nat-to can be used by in rules and together with divert-to. Collisions with existing states are found and produce a "NAT proxy port allocation failed" message. OK henning@ mikeb@
2016-06-22No modules thus no need for extra space for additional ppp compressions.Jeremie Courreges-Anglas
ok deraadt@ mikeb@
2016-06-22rework art_walk so it will behave in an mpsafe world.David Gwynne
art_walk now explicitly takes the same lock used to serialise change made via rtable_insert and _delete, so it can safely adjust the refcnts on tables while it recurses into them. they need to still exist when returning out of the recursion. it uses srps to access nodes and drops the lock before calling the callback function. this is because some callbacks sleep (eg, copyout in the sysctl code that dumps an rtable to userland), which you shouldnt hold a lock accross. other callbacks attempt to modify the rtable (eg, marking routes as down when then interface theyre on goes down), which tries to take the lock again, which probably wont work in the future. ok jmatthew@ mpi@
2016-06-21To assist debugging TCP connection reuse with NAT, expand theAlexander Bluhm
existing log in pf_state_key_attach() from the failed to the reuse case. OK mikeb@
2016-06-15Add umb(4) - a driver for the Mobile Broadband Interface Model (MBIM)Gerhard Roth
The umb(4) driver provides support for USB MBIM devices. Those devices establish connections via celluar networks such as GPRS, UMTS, and LTE. ok mpi@ sthen@ additional feedback from deraadt@ jmc@ stsp@ kettenis@
2016-06-15Kill nd6_output(), it doesn't do anything since the resolution logicMartin Pieuchot
has been moved to nd6_resolve(). ok visa@, millert@, florian@, sthen@
2016-06-15There's no need to convert values returned by arc4random to the networkMike Belopuhov
byte order. Spotted by Gleb Smirnoff (glebius@FreeBSD.org), thanks! ok tedu
2016-06-14Don't hardcode vlan/queue priority for pppoe packets; inherit it from theStuart Henderson
new "llprio" setting on the pppoe(4) interface instead. Tested by Daniel Gillen and myself, ok mikeb
2016-06-14Pass the configured ``ifa'' to rt_sendaddrmsg() instead of getting it viaMartin Pieuchot
``rt->rt_ifa'' later.
2016-06-14Store the source address associated with a route in its own chunk ofMartin Pieuchot
memory. This will allow to unlink 'sruct rtentry' and 'struct ifaddr' to be able to add route entries without needing an address. ok sthen@, visa@, florian@
2016-06-14Convert the links between art data structures used during lookups into srps.Jonathan Matthew
art_lookup and art_match now return an active srp_ref, which the caller must leave when it's done with the returned route (if any). This allows lookups to be done without holding any locks. The art_table and art_node garbage collectors are still responsible for freeing items removed from the routing table, so they now use srp_finalize to wait out any active references, and updates are done using srp_swap operations. ok dlg@ mpi@
2016-06-10Add the "llprio" field to struct ifnet, and the corresponding keywordVincent Gross
to ifconfig. "llprio" allows one to set the priority of packets that do not go through pf(4), as the case is for arp(4) or bpf(4). ok sthen@ mikeb@
2016-06-08Revert previous, it breaks regression tests.Martin Pieuchot
2016-06-08Move ND resoluton logic from nd6_output() to nd6_storelladdr() andMartin Pieuchot
rename it to nd6_resolve(). This allows us to get rid of non-Ethernet hacks by moving Ethernet specific logic in the appropriate layer. ok sthen@
2016-06-07Multicast packet are already duplicated in bridge_process() soMartin Pieuchot
no need to loop another copy on the receiving interface. Reported by and ok uebayasi@
2016-06-07Use rtalloc(9) instead of ifa_ifwithnet() to find an interfaceMartin Pieuchot
when adding a route to gateway to ensure a most specific match. This makes "# route add" coherent to "# route get" even with p2p interfaces. Fix a problem reported by Mart Tõnso. ok vgross@
2016-06-07per trending style, add continue to empty loops.Ted Unangst
ok mglocker
2016-06-03Remove superfluous parenthesis to shut up clang, from David Hill.Martin Pieuchot
2016-06-03defer the freeing of art tables and nodes to a task.David Gwynne
this will allow us to sleep in srp_finalize before freeing the memory. the defer is done by putting the tables and nodes on a list which is serviced by a task. the task removes all the entries from the list and pool_puts them. the art_tables gc code uses at_parent as its list entry, and the art_node gc code uses a union with the an_dst pointer. both at_parent and an_dst are only used when theyre active as part of an art data structure, and are not used in lookups. once the art is done with them we can reuse these pointers safely. ok mpi@
2016-06-03set rt_expire times against time_uptime, not time_second.David Gwynne
time_second is unix time so it can be affected by clock changes. time_uptime is monotonic so it isnt affected by clock changes. that in turn means route expiries wont jump with clock changes if set against time_uptime. the expiry is translated into unix time for export to userland though. ok mpi@
2016-06-02pool_setipl at IPL_SOFTNET for all the art structures.David Gwynne
2016-06-02always clean up the heap in art_table_delete, even for the last at_refcntDavid Gwynne
in the future a table may also be referenced by a cpu reading it with srp as well as the art rtable, so try and make sure it is always usable. ok mpi@