#
da5607f6 |
| 26-Jun-2024 |
jsg <jsg@openbsd.org> |
return type on a dedicated line when declaring functions ok mglocker@
|
#
ff335594 |
| 14-Jul-2022 |
mvs <mvs@openbsd.org> |
Turn pppoe(4) back to kernel lock. We can't predict netlock state within pppoe_start(), so we can't use it for pppoe(4) data protection. Except input path, pppoe(4) always accessed with kernel lock h
Turn pppoe(4) back to kernel lock. We can't predict netlock state within pppoe_start(), so we can't use it for pppoe(4) data protection. Except input path, pppoe(4) always accessed with kernel lock held, so grab it around pppoeintr() too.
Interfaces should not use netlock for their data protection. They should rely on kernel lock or implement their own.
ok bluhm@ bket@
show more ...
|
#
f6281ee2 |
| 09-Jul-2022 |
mvs <mvs@openbsd.org> |
Fix the error path of the 'SIOCSIFMTU' pppoe_ioctl() case. Return error value if the `error' is set instead of continue to sppp_ioctl().
ok bluhm@
|
#
2c8b151e |
| 29-Jun-2022 |
mvs <mvs@openbsd.org> |
ether_input() called with shared netlock, but pppoe(4) wants it to be exclusive. Do the pppoe(4) input within netisr handler with exclusive netlok held and remove kernel lock hack from ether_input().
ether_input() called with shared netlock, but pppoe(4) wants it to be exclusive. Do the pppoe(4) input within netisr handler with exclusive netlok held and remove kernel lock hack from ether_input().
This is the step back, but it makes ether_input() path better then it is now.
Tested by Hrvoje Popovski.
ok bluhm@ claudio@
show more ...
|
#
d20143d6 |
| 14-May-2022 |
tobhe <tobhe@openbsd.org> |
When receiving a PADO offer, clear stored tags from previous PADO packets. Keeping and combining tags from multiple previous packets could result in a single accumulated reply overrunning mbuf size l
When receiving a PADO offer, clear stored tags from previous PADO packets. Keeping and combining tags from multiple previous packets could result in a single accumulated reply overrunning mbuf size limits. Also make sure the tag size fields are reset to 0 if allocation fails.
Add size check on mbuf cluster allocation and fail if more than MCLBYTES are requested.
From NetBSD.
tested by naddy@ ok bluhm@
show more ...
|
#
e0790d6d |
| 23-Nov-2021 |
kn <kn@openbsd.org> |
Use system uptime not UTC time to calculate PPPoE session duration
Systems without RTC are likely to boot with wrong time, but pppoe(4) used microtime(9) anyway to remember when a new session began.
Use system uptime not UTC time to calculate PPPoE session duration
Systems without RTC are likely to boot with wrong time, but pppoe(4) used microtime(9) anyway to remember when a new session began.
(In)adequately, ifconfig(8) used gettimeofday(2) and calculated the difference between two absoloute dates to infer the PPPoE session duration.
This goes off the rails if the wall clock jumps in between, e.g. due to NTP kicking in.
Use getmicrouptime(9) and clock_gettime(2)/CLOCK_BOOTTIME instead to rely on the monotonically increasing system uptime instead to fix this.
Reported and tested by Peter J. Philipp <pjp AT delphinusdns DOT org> on some octeon box without RTC. I've seen this on a Edgerouter 4 as well (2m uptime, 19d session).
OK claudio
show more ...
|
#
8ee934e7 |
| 19-Jul-2021 |
stsp <stsp@openbsd.org> |
Fix an alignment fault observed on an octeon machine while pppoe(4) was attempting to negotiate a large MTU.
Copy the peer's max payload size from the discovery packet with memcpy() instead of using
Fix an alignment fault observed on an octeon machine while pppoe(4) was attempting to negotiate a large MTU.
Copy the peer's max payload size from the discovery packet with memcpy() instead of using a pointer to this value's offset in the packet buffer.
tweak and ok visa@ additional testing and ok sthen@
show more ...
|
#
0f1fc83d |
| 19-Jan-2021 |
mvs <mvs@openbsd.org> |
pppoe(4): convert ifunit() to if_unit(9)
ok dlg@ kn@
|
#
bdda9a87 |
| 04-Jan-2021 |
kn <kn@openbsd.org> |
Process pppoe(4) packets directly, do not queue through netis
Less scheduling, lock contention and queues.
Previously, if_netisr() handled the net lock around those calls, now if_input_process() do
Process pppoe(4) packets directly, do not queue through netis
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
show more ...
|
#
9566a16b |
| 30-Dec-2020 |
mvs <mvs@openbsd.org> |
Fix pppoe_dispatch_disc_pkt definition to be in accordance with style(9)
ok claudio@ kn@
|
#
9830ba85 |
| 30-Dec-2020 |
mvs <mvs@openbsd.org> |
Convert the `off' argument of pppoe_dispatch_disc_pkt function to local variable. This argument was always passed as 0.
ok kn@
|
#
333d623a |
| 13-Sep-2020 |
kn <kn@openbsd.org> |
Start documenting locks for struct pppoe_softc members
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_L
Start documenting locks for struct pppoe_softc members
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
show more ...
|
#
0e70c421 |
| 21-Aug-2020 |
kn <kn@openbsd.org> |
Leave default ifq_maxlen handling to ifq_init()
Most clonable interface drivers (except bridge, enc, loop, pppx, switch, trunk and vlan) initialise the send queue's length to IFQ_MAXLEN during *_clo
Leave default ifq_maxlen handling to ifq_init()
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
show more ...
|
#
4de75e7c |
| 21-Aug-2020 |
kn <kn@openbsd.org> |
Add sizes to free(9) calls
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.
Add sizes to free(9) calls
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
show more ...
|
#
b5aed6b3 |
| 28-Jul-2020 |
mvs <mvs@openbsd.org> |
Add missing `IFXF_CLONED' flag to clone interfaces.
ok mpi@
|
#
0cae21bd |
| 10-Jul-2020 |
patrick <patrick@openbsd.org> |
Change users of IFQ_SET_MAXLEN() and IFQ_IS_EMPTY() to use the "new" API.
ok dlg@ tobhe@
|
#
bd031ea9 |
| 16-Jun-2019 |
kn <kn@openbsd.org> |
Use timeout_add_sec(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].
Use timeout_add_sec(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
show more ...
|
#
3e676399 |
| 19-Feb-2018 |
mpi <mpi@openbsd.org> |
Remove almost unused `flags' argument of suser().
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 mill
Remove almost unused `flags' argument of suser().
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@
show more ...
|
#
809d3a3e |
| 09-Jan-2018 |
bluhm <bluhm@openbsd.org> |
Creating a cloned interface could return ENOMEM due to temporary memory shortage. As it is invoked from a system call, it should not fail and wait instead. OK visa@ mpi@
|
#
b27348b2 |
| 08-Sep-2017 |
deraadt <deraadt@openbsd.org> |
If you use sys/param.h, you don't need sys/types.h
|
#
aa28b9a6 |
| 11-Aug-2017 |
mpi <mpi@openbsd.org> |
Remove NET_LOCK()'s argument.
Tested by Hrvoje Popovski, ok bluhm@
|
#
b3af46a9 |
| 19-Jul-2017 |
claudio <claudio@openbsd.org> |
Fix double free in pppoe_dispatch_disc_pkt(). If m_pulldown() fails m is freed but another m_freem call happens later. Set m to NULL if m_pulldown() fails like in all other cases of this function. Fo
Fix double free in pppoe_dispatch_disc_pkt(). If m_pulldown() fails m is 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@
show more ...
|
#
a5bac811 |
| 27-May-2017 |
mpi <mpi@openbsd.org> |
Protect the global list of softc with the NET_LOCK().
While here remove superfluous splnet()/splx() in the ioctl routine.
ok sashan@
|
#
66736630 |
| 16-May-2017 |
mpi <mpi@openbsd.org> |
Replace remaining splsoftassert(IPL_SOFTNET) by NET_ASSERT_LOCKED().
ok visa@
|
#
88a08f2a |
| 22-Jan-2017 |
dlg <dlg@openbsd.org> |
move counting if_opackets next to counting if_obytes in if_enqueue.
this means packets are consistently counted in one place, unlike the many and various ways that drivers thought they should do it.
move counting if_opackets next to counting if_obytes in if_enqueue.
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@
show more ...
|