summaryrefslogtreecommitdiff
path: root/sys/net/pipex.c
AgeCommit message (Collapse)Author
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.
2013-06-08Add new sysctl for pipex packet input/output queue length andYASUOKA Masahiko
counters. ok guenther, feedback jmc
2013-04-16When pipex session is terminated by idle timer, there was a problem thatYASUOKA Masahiko
the session is removed from the pipex_closed_wait_list twice, fixed it. It always causes panic because QUEUE_MACRO_DEBUG is enabled by default. Also remove some needless (struct pipex_session *) casts.
2013-03-28code that calls timeout functions should include timeout.hTed Unangst
slipped by on i386, but the zaurus doesn't automagically pick it up. spotted by patrick
2013-03-28no need for a lot of code to include proc.hTed Unangst
2013-02-13Pipex did panic when the 0 length mppe is given by ioctl. ReturnYASUOKA Masahiko
EINVAL instead of panic. Also npppd called ioctl with the invalid argument because of the bugs introduced by the config parser change commit. Fixed those bugs and make sure not to use 0 length keys for MPPE. reported by csszep at gmail and giovanni ok giovanni
2012-12-14oops, debug printf sneaked in. i must be out of practice.David Gwynne
spotted by krw@, poked by jmatthew@
2012-12-13pipex_init can be called multiple times (by whatever subsystems want to useDavid Gwynne
it), so return early if the work has already been done. ok yasuoka@ jmatthew@
2012-09-28fix adress family for ipv6 bpf packet capture; ok yasuokaMarkus Friedl
2012-09-19ioctl requests are u_long not int, spotted via clangJonathan Gray
ok deraadt@ miod@
2012-09-19cleanup around the pipex. naming style, delete or update comments.YASUOKA Masahiko
no functional changes.
2012-09-10drop the unencrypted packets when the MPPE is required. This wasYASUOKA Masahiko
missing on IPv6 path only. From brad
2012-09-10add missing the congestion indicator code on IPv6 path.YASUOKA Masahiko
From brad
2012-07-17use IPsec flowinfo on pipex(4) to select the IPsec tunnel for sendingYASUOKA Masahiko
L2TP packets. ok markus henning
2012-05-05pipex_ip6_input() called IF_DROP() with incorrect queue.YASUOKA Masahiko
diff from blambert
2012-04-22Remove redundant returns from functions returning void. Wrap returnYASUOKA Masahiko
values in () for consistency. diff from Michael W. Bombardieri. ok sthen dlg mikeb
2012-04-04pipex hook in udp_usrreq() mistakenly assumed that `inp' is connected.YASUOKA Masahiko
It could not use the destination address properly, so it failed to find the pipex session. This bug caused LCP keepalive failures on some clients. found and tested by sebastia@ and mxb at alumni.chalmers.se. ok sthen
2012-01-31add missing calls to pf_pkt_addr_changed(); ok henning@Markus Friedl
2012-01-23The ingress filter of pipex and npppd become configurable and disabledYASUOKA Masahiko
by default. After this change we need to add ppp.ingress_filter: true to npppd.conf if it is needed. ok sthen
2012-01-18Fix a problem that causes LCP keepalive timeout. In case the ack number ofYASUOKA Masahiko
a packet that is passed to the userland has not incremented, `pipex' passed the packet mistakenly with invalid ack number. Then `npppd' will drop these packets, so that caused the problem. tested jmatthew ok jmatthew
2011-11-25fix compile errors without INET6. no binary change.YASUOKA Masahiko
pointed out by Julien Crapovich on misc@ ok deraadt mikeb
2011-10-15Added "provision for rewound PPP frames" that allows receivingYASUOKA Masahiko
reorder packets to pass to the upper layer without reorder. It will improve performance (throughput or loss rate) for PPTP or L2TP(/IPesc) on networks that latency is unstable such as mobile network. As our test environment (bandwidth: 6Mbps, latency: 50ms for 97% of traffic and 52ms for rest of traffic), throughput has changed from 0.76MB to 2.17MB on file upload by PPTP connected Windows Vista ftp.exe. Developed by UMEZAWA Takeshi at IIJ. ok jmatthew@ tested jmatthew@ and myself.
2011-07-09honor the net.inet.udp.checksum setting.David Hill
ok claudio henning yasuoka