summaryrefslogtreecommitdiff
path: root/sys/net/pipex.c
AgeCommit message (Collapse)Author
2017-01-24A space here, a space there. Soon we're talking real whitespaceKenneth R Westerback
rectification.
2016-12-19Kill useless comment about splsoftnet() which is going away.Martin Pieuchot
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-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-08-30pool_setiplDavid Gwynne
ok yasuoka@
2016-03-22dont leak an mbuf when copying the packet in pipex_mppe_output failsDavid Gwynne
ok yasuoka@
2016-03-22replace m_copym2 with m_dup_pktDavid Gwynne
this gives us preallocated space at the start of the packet for headers so later calls to M_PREPEND are far less likely to fail. ok yasuoka@
2016-03-04- putting back KASSERT(), which I've backed out on Jan 31Alexandr Nedvedicky
We don't expect inbound packets to come to PF with statekey attached. - I've also found missing call to pf_pkt_addr_changed() at various places, which needs to get fixed to prevent KASSERT() from firing. OK mpi@, sthen@
2015-11-03Remove dead assignment and newly created unused variable.Charles Longeau
Found by LLVM/Clang Static Analyzer. ok yasuoka@ mpi@
2015-10-07Initialize the routing table before domains.Martin Pieuchot
The routing table is not an optional component of the network stack and initializing it inside the "routing domain" requires some ugly introspection in the domain interface. This put the rtable* layer at the same level of the if* level. These two subsystem are organized around the two global data structure used in the network stack: - the global &ifnet list, to be used in process context only, and - the routing table which can be read in interrupt context. This change makes the rtable_* layer domain-aware and extends the "struct domain" such that INET, INET6 and MPLS can specify the length of the binary key used in lookups. This allows us to keep, or move towards, AF-free route and rtable layers. While here stop the madness and pass the size of the maximum key length in *byte* to rn_inithead0(). ok claudio@, mikeb@
2015-10-05Fix ip_is_idle_packet() to parse packets properly.YASUOKA Masahiko
diff from Yuuichi Someya
2015-09-22Use the radix-tree API instead of function pointers.Martin Pieuchot
ok yasuoka@
2015-09-13There's no point in abstracting ifp->if_output() as long as pf_test()Martin Pieuchot
needs to see lo0 in the output path. ok claudio@
2015-09-12Stop overwriting the rt_ifp pointer of RTF_LOCAL routes with lo0ifp.Martin Pieuchot
Use instead the RTF_LOCAL flag to loop local traffic back to the corresponding protocol queue. With this change rt_ifp is now always the same as rt_ifa->ifa_ifp. ok claudio@
2015-09-11Kill yet another argument to functions in IPv6. This time ip6_output'sClaudio Jeker
ifpp - XXX: just for statistics ifpp is always NULL in all callers so that statistic confirms ifpp is dying OK mpi@
2015-09-11in6_embedscope() needs to lose some weight. Remove the last argument.Claudio Jeker
In all but two calls NULL is passed and in the other 2 cases the ifp is only used to maybe feed it to in6_selecthlim() to select the hoplimit for the link. Since in6_embedscope() only works on link-local addresses it does not matter what hop limit we select since the destination is directly reachable. OK florian@ mpi@
2015-09-10It is time to put inet6 on a diet. Use the flensing knife and cut outClaudio Jeker
the 3rd argument of in6_recoverscope() and make it return void. OK dlg@ mikeb@
2015-09-04Make every subsystem using a radix tree call rn_init() and pass theMartin Pieuchot
length of the key as argument. This way every consumer of the radix tree has a chance to explicitly initialize the shared data structures and no longer rely on another subsystem to do the initialization. As a bonus ``dom_maxrtkey'' is no longer used an die. ART kernels should now be fully usable because pf(4) and IPSEC properly initialized the radix tree. ok chris@, reyk@
2015-09-01Replace sockaddr casts with the proper satosin(), ... calls.Alexander Bluhm
From David Hill; OK mpi@; tested kspillner@; tweaks bluhm@
2015-08-24In kernel initialize struct sockaddr_in and sockaddr_in6 to zeroAlexander Bluhm
everywhere to avoid passing around pointers to uninitialized stack memory. While there, fix the call to in6_recoverscope() in fill_drlist(). OK deraadt@ mpi@
2015-07-16Expand ancient NTOHL/NTOHS/HTONS/HTONL macros.Martin Pieuchot
ok guenther@, henning@
2015-07-15m_freem() can handle NULL, do not check for this condition beforehands.Theo de Raadt
ok stsp mpi
2015-06-16Store a unique ID, an interface index, rather than a pointer to theMartin Pieuchot
receiving interface in the packet header of every mbuf. The interface pointer should now be retrieved when necessary with if_get(). If a NULL pointer is returned by if_get(), the interface has probably been destroy/removed and the mbuf should be freed. Such mechanism will simplify garbage collection of mbufs and limit problems with dangling ifp pointers. Tested by jmatthew@ and krw@, discussed with many. ok mikeb@, bluhm@, dlg@
2015-04-23replace the use of struct ifqueue in pipex with mbuf_queues.David Gwynne
this has a slight semantic change. previously pipex would only process up to 128 packets on the input and output queues at a time and would reschedule the softint if there were any left. now it mq_delists the current set of pending packets and only processes them. if anything is added to the queues later they'll cause the softint to run again. this in turn lets us deprecate sysctl_ifq since nothing uses it anymore. because niqueues are mostly wrappers around mbuf_queues, we can provide sysctl_mq and just #define sysctl_niq to it. pipex bits are ok yasuoka@
2015-04-10replace the use of ifqueues for most input queues serviced by netisrDavid Gwynne
with niqueues. this change is so big because there's a lot of code that takes pointers to different input queues (eg, ether_input picks between ipv4, ipv6, pppoe, arp, and mpls input queues) and falls through to code to enqueue packets against the pointer. if i changed only one of the input queues id have to add sepearate code paths, one for ifqueues and one for niqueues in each of these places by flipping all these input queues at once i can keep the currently common code common. testing by mpi@ sthen@ and rafael zalamena ok mpi@ sthen@ claudio@ henning@
2015-04-10mpi@ introduced a ph_cookie in mbuf packet headers that can be usedDavid Gwynne
by a subsystem to stash some state while the mbuf gets queued. eg, net80211 uses it to keep track of the wireless node associated with a packet before submitting it to a drivers snd queue for transmission. this makes pipex use ph_cookie to keep track of the pipex session associated with a packet before submitting it to the softint queues. this lets us get rid of an mbuf tag type, and avoids the cost of tag allocation. ok yasuoka@
2015-03-18remove the congestion handling from struct ifqueue.David Gwynne
its only used for the ip and ip6 network stack input queues, so it seems unfair that every instance of ifqueue has to carry a pointer around for this specific use case. this moves the congestion marker to a kernel global. if we detect that we're congested, we assume the whole system is busy and punish all input queues. marking a system as congested is done by setting the global to the current value of ticks. as the system moves away from that value, it moves away from being congested until the comparison fails. written at s2k15 ok henning@ beck@ bluhm@ claudio@
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
2014-12-01Check the header fields of GRE and MPPE packets strictly.YASUOKA Masahiko
2014-11-20Yet more #include de-duplication.Kenneth R Westerback
ok deraadt@ tedu@
2014-11-04Remove "pl" suffix on pool names.Martin Pieuchot
ok dlg@, uebayasi@, mikeb@
2014-10-28Fix pipex(4) to return multicast packets to the caller so that npppd canYASUOKA Masahiko
handle them. Also use M_NOWAIT for copying a multicast packet.
2014-10-28Initialize the lists of the hash tables and the virtual pipexYASUOKA Masahiko
sesssion for multicast in proper way.
2014-10-28Fix pipex(4) to initialize DF bit in IP header for L2TP message.YASUOKA Masahiko
Without this, the packets larger than the minimum MTU on the routes to the L2TP peer had been dropped.
2014-10-21tun(4) has a pipex session which is used for multicast internally, itYASUOKA Masahiko
wasn't freeed when the interface is destroyed. Free it properly. ok dlg
2014-10-20pipex(4): Converted to use pool(9)Masao Uebayashi
OK blambert@ yasuoka@
2014-10-18Whitespace.Masao Uebayashi
2014-07-22Fewer <netinet/in_systm.h> !Martin Pieuchot
2014-07-12add a size argument to free. will be used soon, but for now default to 0.Ted Unangst
after discussions with beck deraadt kettenis.
2014-06-13KASSERT in pipex_ppp_input() fails if a compressed PPP frame is receivedYASUOKA Masahiko
by the pipex session whose mppe is not accepted. Fix ppp_common_input() to not pass such frames to pipex.
2014-06-13Fix KASSERT on pipex_ppp_input(). Must not reached there even if theYASUOKA Masahiko
tunneling protocol is PPPoE.
2014-06-13Fix tcp-mss-adjust of pipex and npppd to update the pointer ofYASUOKA Masahiko
tcp option and check the boundary correctly.
2014-04-21ip_output() using varargs always struck me as bizarre, esp since it's onlyHenning Brauer
ever used to pass on uint32 (for ipsec). stop that madness and just pass the uint32, 0 in all cases but the two that pass the ipsec flowinfo. ok deraadt reyk guenther
2014-04-18There is no need to initialize globals to 0.Claudio Jeker
2013-11-11Replace most of our formating functions to convert IPv4/6 addresses fromMartin Pieuchot
network to presentation format to inet_ntop(). The few remaining functions will be soon converted. ok mikeb@, deraadt@ and moral support from henning@
2013-10-24Remove the number of in6_var.h inclusions by moving some functions andMartin Pieuchot
global variables to in6.h. ok deraadt@
2013-10-23Remove the number of in_var.h inclusions by moving some functions andMartin Pieuchot
global variables to in.h. ok mikeb@, deraadt@
2013-10-19simplify checksum handling. no need to compute the pseudo hdr cksumHenning Brauer
in the v4 case any more, and computing the cksum in the v6 case isn't needed either. ok florian lteo
2013-10-17The header file netinet/in_var.h included netinet6/in6_var.h. ThisAlexander Bluhm
created a bunch of useless dependencies. Remove this implicit inclusion and do an explicit #include <netinet6/in6_var.h> when it is needed. OK mpi@ henning@
2013-09-20Fix a panic bug in pipex. If pipex deletes a session by the idle-timerYASUOKA Masahiko
when the userland program (npppd) is dead or frozen, the session remains in state_list after it is destroyed, it will be used after free.