summaryrefslogtreecommitdiffstats
path: root/sys/net/if_spppsubr.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Rework the code to decide when to perform DAD to no longer rely on thempi2015-08-241-4/+1
| | | | | | | | | IN6_IFF_NODAD pseudo-flag not being set. This was just a flag for spaghetti code that should not exist in the first place. Tested by sebastia@, ok sthen@
* Abstract the routing table internals behind an rtable_* API.mpi2015-07-181-10/+6
| | | | | | | | | | Code abusing the radix internals for the routing table should now includes <net/rtable.h> and only deal with "struct rtentry". Code using a radix tree for another purpose can still include <net/radix.h>. Inputs from and ok claudio@, mikeb@
* Rename if_output() into if_enqueue() to avoid confusion with commentsmpi2015-06-301-2/+2
| | | | | | talking about (*ifp->if_output)(). ok claudio@, dlg@
* Store a unique ID, an interface index, rather than a pointer to thempi2015-06-161-4/+4
| | | | | | | | | | | | | | | 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@
* Introduce if_output(), a function do to the last steps before enqueuingmpi2015-05-151-12/+6
| | | | | | | | a packet on the sending queue of an interface. Tested by many, thanks a lot! ok dlg@, claudio@
* replace the use of ifqueues for most input queues serviced by netisrdlg2015-04-101-17/+6
| | | | | | | | | | | | | | | | | 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@
* remove the congestion handling from struct ifqueue.dlg2015-03-181-3/+2
| | | | | | | | | | | | | | | | | 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@
* remove the second void * argument on tasks.dlg2015-01-271-13/+12
| | | | | | | | | | | | | | | | | | | | | when workqs were introduced, we provided a second argument so you could pass a thing and some context to work on it in. there were very few things that took advantage of the second argument, so when i introduced pools i suggested removing it. since tasks were meant to replace workqs, it was requested that we keep the second argument to make porting from workqs to tasks easier. now that workqs are gone, i had a look at the use of the second argument again and found only one good use of it (vdsp(4) on sparc64 if you're interested) and a tiny handful of questionable uses. the vast majority of tasks only used a single argument. i have since modified all tasks that used two args to only use one, so now we can remove the second argument. so this is a mechanical change. all tasks only passed NULL as their second argument, so we can just remove it. ok krw@
* unifdef INET in net code as a precursor to removing the pretend option.tedu2014-12-191-15/+1
| | | | | long live the one true internet. ok henning mikeb
* Explicitly include <net/if_var.h> instead of pulling it in <net/if.h>.mpi2014-12-051-1/+2
| | | | ok mikeb@, krw@, bluhm@, tedu@
* move arc4random prototype to systm.h. more appropriate for most codetedu2014-11-181-4/+1
| | | | to include that than rdnvar.h. ok deraadt dlg
* print ipv6cp by name rather than number in "0x8057 output <...>" debug lines,sthen2014-10-081-1/+2
| | | | as already done for lcp/ipcp/pap/chap
* Fewer <netinet/in_systm.h> !mpi2014-07-221-2/+1
|
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-24/+24
| | | | after discussions with beck deraadt kettenis.
* Use a custom ifa_rtrequest function for point-to-point interfacesmpi2014-05-051-2/+4
| | | | | | | | | | instead of relying on hacks in nd6_rtrequest() to add a route to loopback for each address configured on such interfaces. While here document that abusing lo0 for local traffic is not safe for interfaces in a non-default rdomain. Tested by claudio@, jca@ and sthen@, ok sthen@
* Kill annoying and useless emacs local variable. ok mikeb@jca2014-05-021-8/+1
| | | | | | The variable would have no effect unless you use hilit19.el from emacs21, and even there the specified value has not been kept up to date with the file growth.
* all I wanted to do is removing the altq special casing, but then it turnedhenning2014-04-191-16/+2
| | | | | | out the entire codepath is unreachable. glad I'm not our ppp maintainer, he has work to do. kill that unreachable code, with & ok claudio
* "struct pkthdr" holds a routing table ID, not a routing domain one.mpi2014-04-141-4/+4
| | | | | | | | | | | | | | Avoid the confusion by using an appropriate name for the variable. Note that since routing domain IDs are a subset of the set of routing table IDs, the following idiom is correct: rtableid = rdomain But to get the routing domain ID corresponding to a given routing table ID, you must call rtable_l2(9). claudio@ likes it, ok mikeb@
* It cannot be assumed the top of the mbuf chain has required length here.yasuoka2014-04-031-14/+13
| | | | | | | Actually, since packets from Octeon's cnmac(4) don't have enough size, pppoe(4) is unable to connect. ok claudio
* Rename rt_gettable() into rtable_get(), swap its arguments to bempi2014-03-181-2/+2
| | | | | | coherent with the existing rtable_* functions and document it. While here fix some other manpage glitches pointed out by jmc@.
* Call all local valiables of type struct in6_ifaddr "ia6". This isbluhm2014-01-131-15/+15
| | | | | consistent with struct ifaddr "ifa" and struct in_ifaddr "ia". OK mpi@
* Remove no-op 'HIDE' macro from sppp code. This probably existed to allowstsp2014-01-121-226/+224
| | | | | | for easy switching to static functions. But we don't usually have static functions in the kernel. ok deraadt mpi mikeb
* Some follow-up fixes for IFID collision handling in IPv6CP.stsp2014-01-071-3/+33
| | | | | | | | | | | | | | | Really change the link-local address in the unlikely event of an IFID collision, instead of going into an infinite conf-nak loop with the peer. To make the netinet6 code use the IPv6CP IFID in a new link-local address, in6_ifattach_linklocal() must accept a provided IFID. Replace the unused 'altifp' parameter with a new 'ifid' parameter for this purpose. Always use the latest suggested address in IPv6CP replies, even if the task to update the interface's address hasn't run yet. Also, clear the ifindex (KAME hack) in addresses sent during IPv6CP. ok mpi
* Use an u_int32_t instead of an unsigned long to store the magic numberjca2013-12-111-2/+2
| | | | | we're about to send. Should a bug on big-endian LP64 archs reported by James MacMahon (jwm at operand dot ca). ok millert@
* Convert sppp(4) to taskq; ok mikeb@ mpi@stsp2013-11-201-62/+46
|
* Improvements for address assignment and related issues in IPv6CP.stsp2013-11-141-106/+115
| | | | | | | | | | | | | Move address assignment to process context. This uses a workq at present, conversion to taskq is on my todo list (discussed with dlg). Instead of rummaging around in sockaddr_in6 structs, use the proper netinet6 APIs to configure addresses. Deal with IFID collisions instead of ignoring them. The whole point of IPv6CP is to avoid IFID collisions. Use arc4random() during IFID generation. Assign destination address to /128 point-to-point links. tested by me and sthen with pppoe(4) ok sthen
* Replace most of our formating functions to convert IPv4/6 addresses frommpi2013-11-111-5/+13
| | | | | | | | network to presentation format to inet_ntop(). The few remaining functions will be soon converted. ok mikeb@, deraadt@ and moral support from henning@
* Remove useless #ifdef *BSD cruft from sppp(4). No binary change.stsp2013-11-051-94/+2
| | | | ok sthen
* Remove the number of in6_var.h inclusions by moving some functions andmpi2013-10-241-5/+1
| | | | | | global variables to in6.h. ok deraadt@
* Format string fixes: %hu/%hd for uint16_t, %u/%d/%x for uint32_tsf2013-10-011-2/+2
| | | | | - despite the name, ntohl returns uint32_t, not long - also fix some %d into %u
* Replace the misleading SIOC{G,S}IFGENERIC ioctls by SIOCG{G,S}PPPPARAMS.mpi2013-08-161-3/+3
| | | | | | This is another ABI break but no port rely on them as verified by naddy@. ok claudio@, mikeb@, henning@
* Remove a comment which is no longer true.mpi2013-07-151-10/+1
|
* Change the structure used in the SPPPIOSDEFS and SPPPIOGDEFS ioctlsmpi2013-07-101-7/+2
| | | | | | | | | | to only include what is really needed. In particular stop including a "struct ifnet" and move kernel-only definition into the proper #if dance. While here remove the unused spppinfo() from ifconfig. ok guenther@, sthen@, mikeb@
* Revert previous and unbreak asr, the new include should be protected.mpi2013-06-201-4/+4
| | | | Reported by naddy@
* Allocate the various hook head descriptors as part of the ifnetmpi2013-06-201-4/+4
| | | | | | | structure rather than doing various M_WAITOK allocations during the *attach() functions, we always rely on them anyway. ok mikeb@, uebayasi@
* Remove the scrub argument from in_ifinit() and simply call in_ifscrub()mpi2013-05-311-8/+3
| | | | | | unconditionally for SIOCSIFADDR. ok bluhm@, henning@
* do not include machine/cpu.h from a .c file; it is the responsibility ofderaadt2013-03-281-2/+1
| | | | | .h files to pull it in, if needed ok tedu
* no need for a lot of code to include proc.htedu2013-03-281-2/+1
|
* Add SIOCGIFHARDMTU to allow retrieving the driver's maximum supported MTUsthen2012-11-231-1/+6
| | | | looks fine reyk@ ok mikeb@
* decls before codederaadt2012-07-241-2/+2
|
* Call sppp_clear_ip_addrs from a workq. Problem reported by RD Thrush andsthen2012-07-231-6/+26
| | | | | LEVAI Daniel, diagnosed by matthew@, original diff from RD Thrush, cleaned up by me with feedback from mikeb@. OK mikeb dcoppa deraadt
* Remove a horrible sppp(4)-specific "fast queue" used for tcp ports 21 23 513.sthen2012-01-281-34/+5
| | | | You should use the proper queues via pf instead. ok phessler@ henning@
* Teach pppoe(4) about RFC 4638. This allows negotiating increased MTU withsthen2012-01-191-14/+25
| | | | | | | | | | | | | | | | | | compatible equipment provided that the physical interface and other layer 2 devices involved support and are configured to use jumbo frames. Manpage to follow; typical use is to request 1500 MTU for pppoe, this requires 1508+ MTU on the physical interface, e.g. "ifconfig em0 mtu 1508; ifconfig pppoe0 mtu 1500". Known to be usable in the UK with some ISPs (e.g. aaisp) using BT FTTC backhaul. From Matt Dainty, originally based on support in NetBSD, changed to decouple pppoe from physical interface MTU. Tested with UK FTTC by Matt, no regressions on my standard UK ADSL setup or yasuoka@'s setup (in Japan, NTT uses 1452 byte MTU for PPPoE and 1500 byte MTU for IPv6 on the same network). ok yasuoka@
* another case of "clever" fiddling with ifq internals, just stumbled overhenning2011-07-071-4/+6
| | | | | this in my monster diff and wondered that i hadn't put that in already... claudio ryan ok
* and make sppp_qflush a wrapper around IF_PURGE instead of handrollinghenning2011-07-061-11/+2
| | | | | the same, ok'd with IFQ_PURGE with happens to break on altq kernels by claudio, ryan and bluhm
* second trial: stop messing with ifq internals, this time use IF_IS_EMPTYhenning2011-07-061-2/+2
| | | | | | and not IFQ_IS_EMPTY, the former doesn't get overloaded with altq-specific stuffz. original oks from claudio and ryan and bluhm, i take the liberty to assume the oks for this fixed version
* cosnistently use IFQ_SET_MAXLEN, surfaced in a discussion with + ok bluhmhenning2011-07-061-4/+3
|
* Revert henning's commit-n-run that broke the treeguenther2011-07-051-3/+12
|
* 2 cases of IFQ_IS_EMPTY instead of mucking with ifqueue internalshenning2011-07-051-12/+3
| | | | | make sppp_flush use IFQ_PURGE instead of handrolling the same making assumptions about ifqueue internals. ok ryan claudio
* always set sppp auth secret, as other code assumes it.tedu2011-06-291-5/+7
| | | | confirmed to fix paul stoeber's crash. ok deraadt sthen