summaryrefslogtreecommitdiff
path: root/sys/netinet
AgeCommit message (Collapse)Author
2016-11-18turn ipstat into a set of percpu counters.David Gwynne
each counter is identified by an enum value which correspond to the original members of the udpstat struct. udpstat_inc(udps_foo) replaces udpstat.udps_foo++ for the actual updates. udpstat_inc is a thin wrapper around counters_inc. counters are still returned to userland via the udpstat struct for now. ok mpi@ mikeb@ deraadt@
2016-11-16Be consistent and do not use braces for single line statements.Martin Pieuchot
Prodded by and ok bluhm@
2016-11-16Bring icmp6_mtudisc_clone() in line with icmp_mtudisc_clone(). TheAlexander Bluhm
IPv4 dynamic route inherits the priority. Only clone from a valid IPv6 route. Do not use splsoftnet() in IPv6. Some stylistic changes to make the functions similar. OK mpi@
2016-11-16Inherit route label when creating dynamic routes for path MTU.Alexander Bluhm
From Rivo Nurges; OK claudio@ mpi@ phessler@
2016-11-16Kill recursive splsoftnet()s.Martin Pieuchot
While here keep local definitions local. ok bluhm@
2016-11-15Use __func__ in panic strings to reduce noise when grepping.Martin Pieuchot
2016-11-15TDB timers need a context process, so convert them to timeout_set_proc(9).Martin Pieuchot
ok phessler@, bluhm@ as part of a larger diff
2016-11-14Automatically create a default lo(4) interface per rdomain.Martin Pieuchot
In order to stop abusing lo0 for all rdomains, a new loopback interface will be created every time a rdomain is created. The unit number will be the same as the rdomain, i.e. lo1 will be attached to rdomain 1. If this loopback interface is already in use it wont be possible to create the corresponding rdomain. In order to know which lo(4) interface is attached to a rdomain, its index is stored in the rtable/rdomain map. This is a long overdue since the introduction of rtable/rdomain. It also fixes a recent regression due to resetting the rdomain of an incoming packet reported by semarie@, Andreas Bartelt and Nils Frohberg. ok claudio@
2016-11-14use M_COUNTERS to allocate counters.David Gwynne
suggested by mpi@ and mikeb@
2016-11-14turn ipstat into a set of percpu counters.David Gwynne
each counter is identified by an enum value which correspond to the original members of the ipstat struct. ipstat_inc(ips_foo) replaces ipstat.ips_foo++ for the actual updates. ipstat_inc is a thin wrapper around counters_inc. counters are still returned to userland via the ipstat struct for now. ok mpi@ mikeb@
2016-11-09Do not call splsoftnet() recursively, this won't work with a lock.Martin Pieuchot
Timers configured via rt_timer_add(9) always run at IPL_SOFTNET, so assert that rather than calling splsoftnet(). ok bluhm@
2016-11-08Only use the routing table for source address selection when processing IPMartin Pieuchot
options. Make sure the next hop is directly reachable if IPOPT_SSRR is set. Input from and ok vgross@
2016-11-07ARP and NDP timeouts mess with the routing table, so they need a processMartin Pieuchot
context. Convert them to timeout_set_proc(9).
2016-11-07Use goto for consistently instead of splx() and return.Martin Pieuchot
This will allow to have a single lock/unlock dance per timer.
2016-11-03Remove obsolete vxlan_lookup return value handlingMike Belopuhov
With input from reyk@, OK mpi
2016-10-25Accept CARP advertisement packets whose destination is not for multicast.YASUOKA Masahiko
When both "carppeer" and "real mac-address" are used at once and the BACKUP is to take over the new MASTER, the present MASTER receives such packets. Found by and diff from nagasaka at iij. ok henning bluhm
2016-10-11Rename 'i' to 'hlen' for greater readability; ok millert, naddyMike Belopuhov
2016-10-06Remove redundant comments that say a function must be called atAlexander Bluhm
splsoftnet() if the function does a splsoftassert(IPL_SOFTNET) anyway.
2016-10-04One more timeout_set_proc(9) conversion.Martin Pieuchot
Found by Chris Jackman, thanks!
2016-10-04Convert timeouts that need a process context to timeout_set_proc(9).Martin Pieuchot
The current reason is that rtalloc_mpath(9) inside ip_output() might end up inserting a RTF_CLONED route and that require a write lock. ok kettenis@, bluhm@
2016-09-27Remove empty #ifdef and #ifndef blocksFrederic Cambus
OK natano@
2016-09-24use hashfree. from Mathieu -Ted Unangst
ok guenther
2016-09-24ANSIfy netinet/; from David HillChristian Weisgerber
2016-09-22Fix indentation. No binary change.Jonathan Gray
ok mpi@
2016-09-20Sprinkle splsoftnets in TDB timeout callbacks; ok bluhmMike Belopuhov
2016-09-19convert bcopy to memcpy. from david hill.Ted Unangst
2016-09-19For incomming connections keep the TF_NOPUSH flag if TCP_NOPUSH wasAlexander Bluhm
set on the listen socket. From David Hill; OK vgross@
2016-09-15move from RB macros to RBT functionsDavid Gwynne
shaves a bunch of bytes off kernels
2016-09-15all pools have their ipl set via pool_setipl, so fold it into pool_init.David Gwynne
the ioff argument to pool_init() is unused and has been for many years, so this replaces it with an ipl argument. because the ipl will be set on init we no longer need pool_setipl. most of these changes have been done with coccinelle using the spatch below. cocci sucks at formatting code though, so i fixed that by hand. the manpage and subr_pool.c bits i did myself. ok tedu@ jmatthew@ @ipl@ expression pp; expression ipl; expression s, a, o, f, m, p; @@ -pool_init(pp, s, a, o, f, m, p); -pool_setipl(pp, ipl); +pool_init(pp, s, a, ipl, f, m, p);
2016-09-13avoid extensive mbuf allocation for IPsec by replacing m_inject(4)Markus Friedl
with m_makespace(4) from freebsd; ok mpi@, bluhm@, mikeb@, dlg@
2016-09-07Rename rtable_mpath_next() into rtable_iterate() and make it do a properMartin Pieuchot
reference count. rtable_iterate() frees the passed ``rt'' and returns the next one on the multipath list or NULL if there's none. ok dlg@
2016-09-06pool_setipl for various netinet and netinet6 bitsDavid Gwynne
thank you to everyone who helped reviewed these diffs ok mpi@
2016-09-04Prevent a NULL derefernce in ip_output().Martin Pieuchot
A race can happen if a task, like the watchog, sleeps too long keeping an ifp reference while the interface is detached. In this case a TCP timer will try to send packets with a cached route. Since the ifp is being detached if_get(9) returns NULL. Found the hardway by awolk@. ok bluhm@
2016-09-04Implement a sockaddr_ntop() function that works like inet_ntop() but printsClaudio Jeker
sockaddrs. Works for all sockaddrs so can be used to print sockaddrs nicely. OK phessler@
2016-09-04Purge routes attached to an address when this address is removed.Martin Pieuchot
This is done to stop using stale ifa attached to routes, which is the easiest way to make rtisvalid(9) MP-safe. sthen@ and henning@ like it, ok claudio@
2016-09-03Reduce the factor of the limits derived form NMBCLUSTERS. We wantAlexander Bluhm
the additional clusters in the socket buffer and not elsewhere. OK claudio@
2016-09-03Reserve the BFD destination ports in baddynamicPeter Hessler
OK claudio@, henning@
2016-09-03Add support for a multipoint-to-multipoint mode in vxlan(4). In thisReyk Floeter
mode, vxlan(4) must be configured to accept any virtual network identifier with "vnetid any" and added to a bridge(4) or switch(4). This way the driver will dynamically learn the tunnel endpoints and their vnetids for the responses and can be used to dynamically bridge between VXLANs. It is also being used in combination with switch(4) and the OpenFlow tunnel classifiers. With input from yasuoka@ goda@ OK deraadt@ dlg@
2016-09-02Drop non-encapulated ESP packets using a UDP-encapsulating TDB, and addVincent Gross
the relevant counters. Ok mikeb@
2016-08-31Use 'sc_route{4,6}' directly instead of casting them to 'struct route *'.Martin Pieuchot
This is another little step towards deprecating 'struct route{,_in6}'. ok florian@
2016-08-22Make the ``rt_gwroute'' pointer of RTF_GATEWAY entries immutable.Martin Pieuchot
This means that no protection is needed to guarantee that the next hop route wont be modified by CPU1 while CPU0 is dereferencing it in a L2 resolution functions. While here also fix an ``ifa'' leak resulting in RTF_GATEWAY being always invalid. dlg@ likes it, inputs and ok bluhm@
2016-08-22Do not dereference ``rt->rt_ifa'' after calling rtfree(9).Martin Pieuchot
This could result in a use after free if the route entry was holding the last reference of the address descriptor. ok jca@, bluhm@, claudio@
2016-08-18fix panics caused by replacing m_copym2 with m_dup_pkt.David Gwynne
m_copym2 is fine duplicating an arbitrary chain of mbufs, while m_dup_pkt wants to dup a packet with proper headers in the first mbuf. ipsec copied the tail of an mbuf if any of the clusters are shared or readonly, and swapped that tail with the result of m_copym2. m_dup_pkt panics cos of that. this makes ipsec duplicate the whole packet if any of the chain is readonly. found by naddy@ and mlarkin@ this fix is from visa@ who told me to commit it cos he's afk (sleeping) tested by naddy@
2016-08-16Add IP_SENDSRCADDR cmsg for UDP sockets. As suggested by sthen@,Vincent Gross
IP_SENDSRCADDR == IP_RECVDSTADDR. OK sthen@ jca@ bluhm@
2016-08-15replace the last uses of m_copym2 with m_dup_pkt.David Gwynne
ok mpi@ visa@
2016-08-04Commit in6_selectsrc() split again, with missing assignment fixed.Vincent Gross
2016-07-25fix revision 1.290 of sys/netinet/ip_carp.c.Sebastian Benoit
diff from jsg@ ok deraadt@, benno@
2016-07-22Revert in_selectsrc() refactoring, it breaks IPv6.Martin Pieuchot
Reported by Heiko on bugs@. ok stsp@, claudio@
2016-07-22Fix a double rtfree(9) triggered when IPSEC inserts a more specificMartin Pieuchot
route because of PMTU. otto@ reported the issue and helped me tracking it down during more than one month, he is the man! mikeb@ figured out the bug was in the forwarding path. ok mikeb@, deraadt@, claudio@
2016-07-20To tune the TCP SYN cache we need more information. Print theAlexander Bluhm
relevant counters with netstat -s -p tcp. OK henning@