summaryrefslogtreecommitdiffstats
path: root/sys/net/if_pppoe.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* pppoe(4): convert ifunit() to if_unit(9)mvs2021-01-191-2/+4
| | | | ok dlg@ kn@
* Process pppoe(4) packets directly, do not queue through netiskn2021-01-041-24/+3
| | | | | | | | | | Less scheduling, lock contention and queues. Previously, if_netisr() handled the net lock around those calls, now if_input_process() does it before calling ether_input(), so no need to add or remove NET_*LOCK() anywhere. OK mvs claudio
* Fix pppoe_dispatch_disc_pkt definition to be in accordance with style(9)mvs2020-12-301-2/+3
| | | | ok claudio@ kn@
* Convert the `off' argument of pppoe_dispatch_disc_pkt function tomvs2020-12-301-5/+6
| | | | | | local variable. This argument was always passed as 0. ok kn@
* Start documenting locks for struct pppoe_softc memberskn2020-09-131-20/+26
| | | | | | | | Pretty much all members are under the net lock, some are proctected by both net and kernel lock, e.g. the start routine is called with KERNEL_LOCK(). OK mpi
* Leave default ifq_maxlen handling to ifq_init()kn2020-08-211-2/+1
| | | | | | | | | | | | Most clonable interface drivers (except bridge, enc, loop, pppx, switch, trunk and vlan) initialise the send queue's length to IFQ_MAXLEN during *_clone_create() even though ifq_init(), which is eventually called through if_attach(), does the same. Remove all early "ifq_set_maxlen(&ifq->if_snd, IFQ_MAXLEN);" lines to leave it to ifq_init() and have clonable drivers a tad more in sync. OK mvs
* Add sizes to free(9) callskn2020-08-211-14/+21
| | | | | | | | There are either length variables tracking the allocated buffer or strings allocated by their length, reuse the same idiom each time when freeing. Reminder from Peter J. Philipp to account for NUL bytes in strings as well OK mvs
* Add missing `IFXF_CLONED' flag to clone interfaces.mvs2020-07-281-1/+2
| | | | ok mpi@
* Change users of IFQ_SET_MAXLEN() and IFQ_IS_EMPTY() to use the "new" API.patrick2020-07-101-2/+2
| | | | ok dlg@ tobhe@
* Use timeout_add_sec(9)kn2019-06-161-9/+9
| | | | | | | | | All ticks arguments to timeout_add() calls are positive multiple of hz, so simply reduce it and use the appropiate function. Also, (hz / 50) [ticks] = 1 / 50 [s] = 20 [ms]. OK mpi
* Remove almost unused `flags' argument of suser().mpi2018-02-191-2/+2
| | | | | | | The account flag `ASU' will no longer be set but that makes suser() mpsafe since it no longer mess with a per-process field. No objection from millert@, ok tedu@, bluhm@
* Creating a cloned interface could return ENOMEM due to temporarybluhm2018-01-091-5/+2
| | | | | | memory shortage. As it is invoked from a system call, it should not fail and wait instead. OK visa@ mpi@
* If you use sys/param.h, you don't need sys/types.hderaadt2017-09-081-2/+1
|
* Remove NET_LOCK()'s argument.mpi2017-08-111-10/+8
| | | | Tested by Hrvoje Popovski, ok bluhm@
* Fix double free in pppoe_dispatch_disc_pkt(). If m_pulldown() fails m isclaudio2017-07-191-2/+4
| | | | | | | freed but another m_freem call happens later. Set m to NULL if m_pulldown() fails like in all other cases of this function. Found by Ilja Van Sprundel OK bluhm@
* Protect the global list of softc with the NET_LOCK().mpi2017-05-271-10/+7
| | | | | | While here remove superfluous splnet()/splx() in the ioctl routine. ok sashan@
* Replace remaining splsoftassert(IPL_SOFTNET) by NET_ASSERT_LOCKED().mpi2017-05-161-2/+2
| | | | ok visa@
* move counting if_opackets next to counting if_obytes in if_enqueue.dlg2017-01-221-2/+1
| | | | | | | this means packets are consistently counted in one place, unlike the many and various ways that drivers thought they should do it. ok mpi@ deraadt@
* spacingmpi2017-01-021-23/+23
|
* pppoe_timeout() needs to take the NET_LOCK().mpi2017-01-021-6/+10
| | | | Assert reported and diff tested by semarie@
* Don't hardcode vlan/queue priority for pppoe packets; inherit it from thesthen2016-06-141-8/+9
| | | | | | new "llprio" setting on the pppoe(4) interface instead. Tested by Daniel Gillen and myself, ok mikeb
* Set pppoe(4) control frames to high (NC, "network control")sthen2016-05-301-1/+4
| | | | | | | | | | | | | | | priority. This is translated into an 802.1p priority tag when sent over a vlan interface, reducing the risk of them being crowded out by data packets on a busy link. Some users have problems with ISPs that place specific requirements on vlan priority (typically the packet header value must be '0', relating to priority 1). This diff doesn't fix that yet, but gives a single place to patch to change tags on control packets without affecting normal vlan priority operation on other interfaces. ok mikeb.
* Remove the hack that prevents changing pppoe params at runtime.mikeb2016-04-181-3/+30
| | | | | | | | | | | The EBUSY hack imposes an order on the ifconfig commands issued against the pppoe interface used to configure the sppp layer below. To counter this we use the ENETRESET trick that other drivers use to tell the pppoe layer that sppp has requested a stop/init reset sequence to proceed which we oblige with in case pppoe is UP and RUNNING. Tested by semarie@ and Jan Schreiber <jes@posteo.de>, thanks!
* We're always ready! So send IFQ_SET_READY() to the bitbucket.mpi2016-04-131-2/+1
|
* Building kernels with PPPOE_SERVER enabled has been broken for at leastjsg2016-04-011-197/+1
| | | | | | | | | eleven years, remove it. Despite what the wildly outdated time(9) claims, there is no longer globally visible "struct timeval mono_time" or "struct timeval time". ok mpi@ sthen@ mikeb@
* remove old lint annotationstedu2015-12-051-2/+1
|
* Convert pppoe(4) to use if_get()/if_put(): instead of storing areyk2015-11-281-24/+50
| | | | | | | | | | | pointer to the parent "pppoedev", it now only stores an interface index. This also fixes a potential NULL pointer dereference that could happen in pppoe_find_softc_by_session() when the parent got deconfigured but the session was still active. Found the hard way with pppoe(4) on vlan7. OK mpi@, with debugging help from mikeb@
* sppp(4) is now only used for pppoe(4) which doesn't use framing, so removesthen2015-11-201-3/+2
| | | | | | | support for sppp with framing, simplifying things. Remove unused ifdefs while there. "sppp will go away before it gets used for something else" dlg@
* Introduce if_rtrequest() the successor of ifa_rtrequest().mpi2015-10-251-1/+2
| | | | | | | | | L2 resolution depends on the protocol (encoded in the route entry) and an ``ifp''. Not having to care about an ``ifa'' makes our life easier in our MP effort. Fewer dependencies between data structures implies fewer headaches. Discussed with bluhm@, ok claudio@
* There's no point in abstracting ifp->if_output() as long as pf_test()mpi2015-09-131-3/+3
| | | | | | needs to see lo0 in the output path. ok claudio@
* Stop overwriting the rt_ifp pointer of RTF_LOCAL routes with lo0ifp.mpi2015-09-121-3/+3
| | | | | | | | | 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@
* Store a unique ID, an interface index, rather than a pointer to thempi2015-06-161-12/+12
| | | | | | | | | | | | | | | 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@
* replace the use of ifqueues for most input queues serviced by netisrdlg2015-04-101-22/+7
| | | | | | | | | | | | | | | | | 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 some includes include-what-you-use claims don'tjsg2015-03-141-2/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* 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
* Correctly set the rtable ID of the packet header when sendingmpi2014-08-131-1/+4
| | | | | | Active Discovery Terminate packets. ok mikeb@, henning@, phessler@
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-17/+17
| | | | after discussions with beck deraadt kettenis.
* g/c unused IFT_L2VLAN, ok reyk bluhmhenning2014-06-071-4/+2
| | | | the #define stays since it's userland visible and who knows what uses it
* "struct pkthdr" holds a routing table ID, not a routing domain one.mpi2014-04-141-2/+2
| | | | | | | | | | | | | | 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@
* Remove various external variable declaration from sources files andmpi2013-04-101-3/+1
| | | | | | | move them to the corresponding header with an appropriate comment if necessary. ok guenther@
* no need for a lot of code to include proc.htedu2013-03-281-2/+1
|
* fix all the suser calls which pass an incorrect p_acflag argument;mikeb2012-04-111-3/+3
| | | | figured out by and ok guenther
* Teach pppoe(4) about RFC 4638. This allows negotiating increased MTU withsthen2012-01-191-8/+48
| | | | | | | | | | | | | | | | | | 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@
* cosnistently use IFQ_SET_MAXLEN, surfaced in a discussion with + ok bluhmhenning2011-07-061-3/+3
|
* ifqueues in BSS don't need NULL init, especially not absolutely incorrecthenning2011-07-051-3/+3
| | | | ones that make assumptions about ifqueue internals... ok ryan claudio
* Do the same rdomain checking in sppp as we do in the Ethernet case.claudio2009-07-131-1/+4
| | | | | | | 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@
* Introduce splsoftassert(), similar to splassert() but for soft interruptmiod2009-03-151-2/+2
| | | | | | levels. This will allow for platforms where soft interrupt levels do not map to real hardware interrupt levels to have soft ipl values overlapping hard ipl values without breaking spl asserts.
* Make the session id unique per receiving interface so that pppoecanacar2008-10-161-6/+4
| | | | | interfaces attached to different networks can use the same session id. reported by gm_sjo <saqmaster at gmail dot com>
* Make sure no two pppoe devices share the same sc_unique identifier. Whilemiod2008-10-111-9/+14
| | | | | | | there, fix some typos, and pass M_CANFAIL to all malloc() calls which use M_WAITOK but are tested for failure. test&ok brad@