summaryrefslogtreecommitdiff
path: root/sys/net/if_spppsubr.c
AgeCommit message (Collapse)Author
2013-12-11Use an u_int32_t instead of an unsigned long to store the magic numberJeremie Courreges-Anglas
we're about to send. Should a bug on big-endian LP64 archs reported by James MacMahon (jwm at operand dot ca). ok millert@
2013-11-20Convert sppp(4) to taskq; ok mikeb@ mpi@Stefan Sperling
2013-11-14Improvements for address assignment and related issues in IPv6CP.Stefan Sperling
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
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-11-05Remove useless #ifdef *BSD cruft from sppp(4). No binary change.Stefan Sperling
ok sthen
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-01Format string fixes: %hu/%hd for uint16_t, %u/%d/%x for uint32_tStefan Fritsch
- despite the name, ntohl returns uint32_t, not long - also fix some %d into %u
2013-08-16Replace the misleading SIOC{G,S}IFGENERIC ioctls by SIOCG{G,S}PPPPARAMS.Martin Pieuchot
This is another ABI break but no port rely on them as verified by naddy@. ok claudio@, mikeb@, henning@
2013-07-15Remove a comment which is no longer true.Martin Pieuchot
2013-07-10Change the structure used in the SPPPIOSDEFS and SPPPIOGDEFS ioctlsMartin Pieuchot
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@
2013-06-20Revert previous and unbreak asr, the new include should be protected.Martin Pieuchot
Reported by naddy@
2013-06-20Allocate the various hook head descriptors as part of the ifnetMartin Pieuchot
structure rather than doing various M_WAITOK allocations during the *attach() functions, we always rely on them anyway. ok mikeb@, uebayasi@
2013-05-31Remove the scrub argument from in_ifinit() and simply call in_ifscrub()Martin Pieuchot
unconditionally for SIOCSIFADDR. ok bluhm@, henning@
2013-03-28do not include machine/cpu.h from a .c file; it is the responsibility ofTheo de Raadt
.h files to pull it in, if needed ok tedu
2013-03-28no need for a lot of code to include proc.hTed Unangst
2012-11-23Add SIOCGIFHARDMTU to allow retrieving the driver's maximum supported MTUStuart Henderson
looks fine reyk@ ok mikeb@
2012-07-24decls before codeTheo de Raadt
2012-07-23Call sppp_clear_ip_addrs from a workq. Problem reported by RD Thrush andStuart Henderson
LEVAI Daniel, diagnosed by matthew@, original diff from RD Thrush, cleaned up by me with feedback from mikeb@. OK mikeb dcoppa deraadt
2012-01-28Remove a horrible sppp(4)-specific "fast queue" used for tcp ports 21 23 513.Stuart Henderson
You should use the proper queues via pf instead. ok phessler@ henning@
2012-01-19Teach pppoe(4) about RFC 4638. This allows negotiating increased MTU withStuart Henderson
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@
2011-07-07another case of "clever" fiddling with ifq internals, just stumbled overHenning Brauer
this in my monster diff and wondered that i hadn't put that in already... claudio ryan ok
2011-07-06and make sppp_qflush a wrapper around IF_PURGE instead of handrollingHenning Brauer
the same, ok'd with IFQ_PURGE with happens to break on altq kernels by claudio, ryan and bluhm
2011-07-06second trial: stop messing with ifq internals, this time use IF_IS_EMPTYHenning Brauer
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
2011-07-06cosnistently use IFQ_SET_MAXLEN, surfaced in a discussion with + ok bluhmHenning Brauer
2011-07-05Revert henning's commit-n-run that broke the treePhilip Guenthe
2011-07-052 cases of IFQ_IS_EMPTY instead of mucking with ifqueue internalsHenning Brauer
make sppp_flush use IFQ_PURGE instead of handrolling the same making assumptions about ifqueue internals. ok ryan claudio
2011-06-29always set sppp auth secret, as other code assumes it.Ted Unangst
confirmed to fix paul stoeber's crash. ok deraadt sthen
2011-06-18pass the correct size to memsetJonathan Gray
spotted by clang, ok matthew@
2011-05-04Collapse m_pullup and m_pullup2 into a single function, as they'reBret Lambert
essentially identical; the only difference being that m_pullup2 is capable of handling mbuf clusters, but called m_pullup for shorter lengths (!). testing dlg@ ok claudio@
2011-04-17in_ifinit() is not prepared to be called from interrupt context so addStefan Sperling
addresses from process context by scheduling a work queue. Fixes an assertwaitok panic. ok henning
2011-01-11for key material that is being being discarded, convert bzero() toTheo de Raadt
explicit_bzero() where required ok markus mikeb
2010-11-17an extra parameter for in_ifinit, indicating wether the ifaddr passed to itHenning Brauer
is new or an already existing one. for existing ones, call ifa_del first tested by many as part of a larger diff, ok claudio dlg krw sthen
2010-09-13Using a normaly unavailable 0.0.0.1 gateway on routes on sppp(4) basedClaudio Jeker
devices is a bad idea. The problem is that the default route per se works but PMTU is unable to clone host routes because the gateway is unreachable. Fix sppp(4) so that it walks the routing table and fixes the gateways. This makes PMTU work again. Diff tested by weerd@ and markus@ (older version) for a long time.
2010-07-20Switch some obvious network stack MAC comparisons from bcmp() toMatthew Dempsky
timingsafe_bcmp(). ok deraadt@; committed over WPA.
2010-05-01incomming -> incomingMichael Knudsen
The ones found in gnu/ left out by intention. ok jmc
2010-02-08The IMPs are history so is splimp, this needs now splnet so update comment.Claudio Jeker
Another thing found by Gleydson Soares.
2009-11-03rtables are stacked on rdomains (it is possible to have multiple routingClaudio Jeker
tables on top of a rdomain) but until now our code was a crazy mix so that it was impossible to correctly use rtables in that case. Additionally pf(4) only knows about rtables and not about rdomains. This is especially bad when tracking (possibly conflicting) states in various domains. This diff fixes all or most of these issues. It adds a lookup function to get the rdomain id based on a rtable id. Makes pf understand rdomains and allows pf to move packets between rdomains (it is similar to NAT). Because pf states now track the rdomain id as well it is necessary to modify the pfsync wire format. So old and new systems will not sync up. A lot of help by dlg@, tested by sthen@, jsg@ and probably more OK dlg@, mpf@, deraadt@
2009-07-27tiemout_add -> timeout_add_secBret Lambert
ok claudio@
2009-07-13Do the same rdomain checking in sppp as we do in the Ethernet case.Claudio Jeker
Encapsulated pppoe packets are moved into the rdomain of the physical interface because it is possible that a pppoe(4) interface is in a different rdomain then the physical interface. OK reyk@
2009-02-18Free authentication data when detaching sppp from interface.Can Erkin Acar
2009-02-16allocate the large structures instead of putting them on the stack, andTheo de Raadt
use M_CANWAIT throughout ok sthen canacar claudio
2009-02-16Allow username and password to be up to 255 characters in length.Can Erkin Acar
Tested by many, thanks. Put it in" deraadt@
2009-02-06Remove bogus casts of integer constants SPPPIO[GS]DEFS to caddr_tAlexander Yurchenko
and fix typo while here. ok canacar@
2009-01-31u_char is not compatible with default argument promotion type thusAlexander Yurchenko
can't be used with va_start. change it to u_int. ok miod@
2008-06-09rename arc4random_bytes => arc4random_buf to match libc's nicer name;Damien Miller
ok deraadt@
2008-06-08Don't spam dmesg with sppp messages, instead use log(9).Claudio Jeker
OK canacar@ some time ago
2008-05-17Initialize the timeouts only once instead of everytime they are startedCan Erkin Acar
Prevents hangs as reported and tested by James Stark, PR:5795, ok henning@
2008-05-11Check to make sure pp_tlf is not NULL in sppp_keepalive() before calling it.Brad Smith
From NetBSD ok canacar@
2008-05-11When passing opt[] array as an argument, use opt instead of &opt. WhileCan Erkin Acar
they point to the same address, this is more readable. ok claudio@
2007-12-041500 is a 'magic number' in the protocol that all implementationsClaudio Jeker
must be able to handle as MRU but while testing pppoe(4) against a pppoe(8) server I figured out that pppoe(8) insists on a MRU 1492. Because of this we allow the offered MRU to be between PP_MIN_MRU and PP_MAX_MRU especially because the MRU is not used at all as long as it is smaller then PP_MAX_MRU. OK canacar@