History log of /openbsd-current/usr.sbin/npppd/pppoe/pppoed.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.25 29-Mar-2021 yasuoka

spellings
suggested by jsg


# 1.24 30-Dec-2020 benno

The result of getifaddrs() not used in pppoed_reload(). Remove it.
ok mvs@ kn@


# 1.23 30-Dec-2020 benno

getifaddrs() can return entries where ifa_addr is NULL. Check for this
before accessing anything in ifa_addr.
ok claudio@


Revision tags: OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.22 22-Feb-2019 jmc

errror -> error in log messages; from alessandro gallo


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE
# 1.21 19-Apr-2017 natano

Switch base tools from /dev/bpf0 to /dev/bpf. Now that /dev/bpf has been
around for two releases, it should be safe to do so.

ok bluhm deraadt sthen tb yasuoka


Revision tags: OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.20 28-May-2016 natano

Replace the /dev/bpf* open loop with a plain open("/dev/bpf0", ...).
ok deraadt jca


Revision tags: OPENBSD_5_9_BASE
# 1.19 17-Dec-2015 tb

Replace 'arc4random() % (2^k - 1)' by 'arc4random() & (2^k - 1)' to
avoid modulo bias. Part of a diff by Matthew Martin, reviewed by
deraadt@ and me.

ok deraadt@


# 1.18 11-Oct-2015 guenther

Simplify and lock down priv_open():
* kill the 'mode' argument
* fail if passed any flags other than O_ACCMODE OR O_NONBLOCK
* paranoia: mask O_CREAT when calling open() with only two arguments
* instead of using ioctl(FIONBIO) after the fact, pass O_NONBLOCK to
priv_open()

"good start" deraadt@
ok yasuoka@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.17 19-Jan-2015 deraadt

move to <limits.h> universe
ok yasuoka


# 1.16 27-Nov-2014 tobias

Fix typos in comments.

ok jmc, yasuoka


Revision tags: OPENBSD_5_6_BASE
# 1.15 21-Jul-2014 guenther

Switch from <sys/endian.h> or <machine/endian.h> to the new,
being-standardized <endian.h>

ok deraadt@ millert@ beck@


# 1.14 22-Mar-2014 yasuoka

Stop output "Stopped" log message of the tunnel protocols.


Revision tags: OPENBSD_5_4_BASE OPENBSD_5_5_BASE
# 1.13 20-Apr-2013 yasuoka

Don't use random() because it's not safe. Use arc4random() instead of
it. Suggested by deraadt.


# 1.12 16-Apr-2013 yasuoka

pppoed didn't work since it has been broken after the last
configuration parser change.

pointed out by todd.


Revision tags: OPENBSD_5_3_BASE
# 1.11 18-Sep-2012 yasuoka

New configuration syntax for npppd(8). `npppd.conf' will be based on
parse.y and `npppd-users' will be based on getcap(3). Add man pages.

feedback from giovanni


Revision tags: OPENBSD_5_2_BASE
# 1.10 08-May-2012 yasuoka

Trivial changes from the upstream(IIJ).
- fix styles, compile errors in some ifdef condition and compiler warnings.
- delete rtev* that was to work around routing socket overflows.
- delete is_ctrl argument from l2tp_ctrl_send_packet(). It's not used.
- tweak returning the exit status.
- use IPV6_IPSEC_POLICY for IPv6 socket.
(though npppd cannot set up a ipsec policy to the socket yet.)

ok mcbride henning


# 1.9 08-May-2012 yasuoka

Fix comments and styles. Delete unused variables and labels.
No binary changes.

ok mcbride henning


Revision tags: OPENBSD_5_1_BASE
# 1.8 18-Jan-2012 yasuoka

Fix compiler warnings and some styles.

ok sebastia sthen


Revision tags: OPENBSD_4_9_BASE OPENBSD_5_0_BASE
# 1.7 28-Feb-2011 dlg

fix a buffer overflow in the pppoe receive packet handling.

diff from yasuoka@
ok deraadt@


Revision tags: OPENBSD_4_8_BASE
# 1.6 02-Jul-2010 yasuoka

add $OpenBSD$ and remove trailing space. no functional change.


# 1.5 01-Jul-2010 yasuoka

Translate Japanese comments or labels into English. Translation was
done by IIJ people (MATSUI Yoshihiro, SAITOH Masanobu, Tomoyuki Sahara),
yuo@ and myself.

This diff also includes
- delete part of useless comments, correct spelling.
- add man page of npppdctl.

There is no functional change.


Revision tags: OPENBSD_4_7_BASE
# 1.4 31-Jan-2010 yasuoka

privilege separation of npppd.

- Drop privilege after daemon initializing.
- Some system calls that requires root privileges were replaced to
wrapper functions that communicate with a separated privileged
process via IPC. And the privileged process checks whether the
operations are acceptable.


# 1.3 27-Jan-2010 yasuoka

Fixed 2 off-by-one problems.
(found by parfait, reported by jsg@)


# 1.2 13-Jan-2010 yasuoka

cleanup npppd code. delete IIJ local ifdef switches and fix warnings.
ok @dlg


# 1.1 11-Jan-2010 yasuoka

Initial import npppd(8). npppd is a new PPP daemon that handles many
ppp sessions as a server. It supports L2TP, PPTP and PPPoE as
tunneling.

ok mcbride@ dlg@ deraadt@ reyk@.


# 1.24 30-Dec-2020 benno

The result of getifaddrs() not used in pppoed_reload(). Remove it.
ok mvs@ kn@


# 1.23 30-Dec-2020 benno

getifaddrs() can return entries where ifa_addr is NULL. Check for this
before accessing anything in ifa_addr.
ok claudio@


Revision tags: OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.22 22-Feb-2019 jmc

errror -> error in log messages; from alessandro gallo


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE
# 1.21 19-Apr-2017 natano

Switch base tools from /dev/bpf0 to /dev/bpf. Now that /dev/bpf has been
around for two releases, it should be safe to do so.

ok bluhm deraadt sthen tb yasuoka


Revision tags: OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.20 28-May-2016 natano

Replace the /dev/bpf* open loop with a plain open("/dev/bpf0", ...).
ok deraadt jca


Revision tags: OPENBSD_5_9_BASE
# 1.19 17-Dec-2015 tb

Replace 'arc4random() % (2^k - 1)' by 'arc4random() & (2^k - 1)' to
avoid modulo bias. Part of a diff by Matthew Martin, reviewed by
deraadt@ and me.

ok deraadt@


# 1.18 11-Oct-2015 guenther

Simplify and lock down priv_open():
* kill the 'mode' argument
* fail if passed any flags other than O_ACCMODE OR O_NONBLOCK
* paranoia: mask O_CREAT when calling open() with only two arguments
* instead of using ioctl(FIONBIO) after the fact, pass O_NONBLOCK to
priv_open()

"good start" deraadt@
ok yasuoka@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.17 19-Jan-2015 deraadt

move to <limits.h> universe
ok yasuoka


# 1.16 27-Nov-2014 tobias

Fix typos in comments.

ok jmc, yasuoka


Revision tags: OPENBSD_5_6_BASE
# 1.15 21-Jul-2014 guenther

Switch from <sys/endian.h> or <machine/endian.h> to the new,
being-standardized <endian.h>

ok deraadt@ millert@ beck@


# 1.14 22-Mar-2014 yasuoka

Stop output "Stopped" log message of the tunnel protocols.


Revision tags: OPENBSD_5_4_BASE OPENBSD_5_5_BASE
# 1.13 20-Apr-2013 yasuoka

Don't use random() because it's not safe. Use arc4random() instead of
it. Suggested by deraadt.


# 1.12 16-Apr-2013 yasuoka

pppoed didn't work since it has been broken after the last
configuration parser change.

pointed out by todd.


Revision tags: OPENBSD_5_3_BASE
# 1.11 18-Sep-2012 yasuoka

New configuration syntax for npppd(8). `npppd.conf' will be based on
parse.y and `npppd-users' will be based on getcap(3). Add man pages.

feedback from giovanni


Revision tags: OPENBSD_5_2_BASE
# 1.10 08-May-2012 yasuoka

Trivial changes from the upstream(IIJ).
- fix styles, compile errors in some ifdef condition and compiler warnings.
- delete rtev* that was to work around routing socket overflows.
- delete is_ctrl argument from l2tp_ctrl_send_packet(). It's not used.
- tweak returning the exit status.
- use IPV6_IPSEC_POLICY for IPv6 socket.
(though npppd cannot set up a ipsec policy to the socket yet.)

ok mcbride henning


# 1.9 08-May-2012 yasuoka

Fix comments and styles. Delete unused variables and labels.
No binary changes.

ok mcbride henning


Revision tags: OPENBSD_5_1_BASE
# 1.8 18-Jan-2012 yasuoka

Fix compiler warnings and some styles.

ok sebastia sthen


Revision tags: OPENBSD_4_9_BASE OPENBSD_5_0_BASE
# 1.7 28-Feb-2011 dlg

fix a buffer overflow in the pppoe receive packet handling.

diff from yasuoka@
ok deraadt@


Revision tags: OPENBSD_4_8_BASE
# 1.6 02-Jul-2010 yasuoka

add $OpenBSD$ and remove trailing space. no functional change.


# 1.5 01-Jul-2010 yasuoka

Translate Japanese comments or labels into English. Translation was
done by IIJ people (MATSUI Yoshihiro, SAITOH Masanobu, Tomoyuki Sahara),
yuo@ and myself.

This diff also includes
- delete part of useless comments, correct spelling.
- add man page of npppdctl.

There is no functional change.


Revision tags: OPENBSD_4_7_BASE
# 1.4 31-Jan-2010 yasuoka

privilege separation of npppd.

- Drop privilege after daemon initializing.
- Some system calls that requires root privileges were replaced to
wrapper functions that communicate with a separated privileged
process via IPC. And the privileged process checks whether the
operations are acceptable.


# 1.3 27-Jan-2010 yasuoka

Fixed 2 off-by-one problems.
(found by parfait, reported by jsg@)


# 1.2 13-Jan-2010 yasuoka

cleanup npppd code. delete IIJ local ifdef switches and fix warnings.
ok @dlg


# 1.1 11-Jan-2010 yasuoka

Initial import npppd(8). npppd is a new PPP daemon that handles many
ppp sessions as a server. It supports L2TP, PPTP and PPPoE as
tunneling.

ok mcbride@ dlg@ deraadt@ reyk@.


# 1.22 22-Feb-2019 jmc

errror -> error in log messages; from alessandro gallo


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE
# 1.21 19-Apr-2017 natano

Switch base tools from /dev/bpf0 to /dev/bpf. Now that /dev/bpf has been
around for two releases, it should be safe to do so.

ok bluhm deraadt sthen tb yasuoka


Revision tags: OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.20 28-May-2016 natano

Replace the /dev/bpf* open loop with a plain open("/dev/bpf0", ...).
ok deraadt jca


Revision tags: OPENBSD_5_9_BASE
# 1.19 17-Dec-2015 tb

Replace 'arc4random() % (2^k - 1)' by 'arc4random() & (2^k - 1)' to
avoid modulo bias. Part of a diff by Matthew Martin, reviewed by
deraadt@ and me.

ok deraadt@


# 1.18 11-Oct-2015 guenther

Simplify and lock down priv_open():
* kill the 'mode' argument
* fail if passed any flags other than O_ACCMODE OR O_NONBLOCK
* paranoia: mask O_CREAT when calling open() with only two arguments
* instead of using ioctl(FIONBIO) after the fact, pass O_NONBLOCK to
priv_open()

"good start" deraadt@
ok yasuoka@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.17 19-Jan-2015 deraadt

move to <limits.h> universe
ok yasuoka


# 1.16 27-Nov-2014 tobias

Fix typos in comments.

ok jmc, yasuoka


Revision tags: OPENBSD_5_6_BASE
# 1.15 21-Jul-2014 guenther

Switch from <sys/endian.h> or <machine/endian.h> to the new,
being-standardized <endian.h>

ok deraadt@ millert@ beck@


# 1.14 22-Mar-2014 yasuoka

Stop output "Stopped" log message of the tunnel protocols.


Revision tags: OPENBSD_5_4_BASE OPENBSD_5_5_BASE
# 1.13 20-Apr-2013 yasuoka

Don't use random() because it's not safe. Use arc4random() instead of
it. Suggested by deraadt.


# 1.12 16-Apr-2013 yasuoka

pppoed didn't work since it has been broken after the last
configuration parser change.

pointed out by todd.


Revision tags: OPENBSD_5_3_BASE
# 1.11 18-Sep-2012 yasuoka

New configuration syntax for npppd(8). `npppd.conf' will be based on
parse.y and `npppd-users' will be based on getcap(3). Add man pages.

feedback from giovanni


Revision tags: OPENBSD_5_2_BASE
# 1.10 08-May-2012 yasuoka

Trivial changes from the upstream(IIJ).
- fix styles, compile errors in some ifdef condition and compiler warnings.
- delete rtev* that was to work around routing socket overflows.
- delete is_ctrl argument from l2tp_ctrl_send_packet(). It's not used.
- tweak returning the exit status.
- use IPV6_IPSEC_POLICY for IPv6 socket.
(though npppd cannot set up a ipsec policy to the socket yet.)

ok mcbride henning


# 1.9 08-May-2012 yasuoka

Fix comments and styles. Delete unused variables and labels.
No binary changes.

ok mcbride henning


Revision tags: OPENBSD_5_1_BASE
# 1.8 18-Jan-2012 yasuoka

Fix compiler warnings and some styles.

ok sebastia sthen


Revision tags: OPENBSD_4_9_BASE OPENBSD_5_0_BASE
# 1.7 28-Feb-2011 dlg

fix a buffer overflow in the pppoe receive packet handling.

diff from yasuoka@
ok deraadt@


Revision tags: OPENBSD_4_8_BASE
# 1.6 02-Jul-2010 yasuoka

add $OpenBSD$ and remove trailing space. no functional change.


# 1.5 01-Jul-2010 yasuoka

Translate Japanese comments or labels into English. Translation was
done by IIJ people (MATSUI Yoshihiro, SAITOH Masanobu, Tomoyuki Sahara),
yuo@ and myself.

This diff also includes
- delete part of useless comments, correct spelling.
- add man page of npppdctl.

There is no functional change.


Revision tags: OPENBSD_4_7_BASE
# 1.4 31-Jan-2010 yasuoka

privilege separation of npppd.

- Drop privilege after daemon initializing.
- Some system calls that requires root privileges were replaced to
wrapper functions that communicate with a separated privileged
process via IPC. And the privileged process checks whether the
operations are acceptable.


# 1.3 27-Jan-2010 yasuoka

Fixed 2 off-by-one problems.
(found by parfait, reported by jsg@)


# 1.2 13-Jan-2010 yasuoka

cleanup npppd code. delete IIJ local ifdef switches and fix warnings.
ok @dlg


# 1.1 11-Jan-2010 yasuoka

Initial import npppd(8). npppd is a new PPP daemon that handles many
ppp sessions as a server. It supports L2TP, PPTP and PPPoE as
tunneling.

ok mcbride@ dlg@ deraadt@ reyk@.


Revision tags: OPENBSD_6_2_BASE
# 1.21 19-Apr-2017 natano

Switch base tools from /dev/bpf0 to /dev/bpf. Now that /dev/bpf has been
around for two releases, it should be safe to do so.

ok bluhm deraadt sthen tb yasuoka


Revision tags: OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.20 28-May-2016 natano

Replace the /dev/bpf* open loop with a plain open("/dev/bpf0", ...).
ok deraadt jca


Revision tags: OPENBSD_5_9_BASE
# 1.19 17-Dec-2015 tb

Replace 'arc4random() % (2^k - 1)' by 'arc4random() & (2^k - 1)' to
avoid modulo bias. Part of a diff by Matthew Martin, reviewed by
deraadt@ and me.

ok deraadt@


# 1.18 11-Oct-2015 guenther

Simplify and lock down priv_open():
* kill the 'mode' argument
* fail if passed any flags other than O_ACCMODE OR O_NONBLOCK
* paranoia: mask O_CREAT when calling open() with only two arguments
* instead of using ioctl(FIONBIO) after the fact, pass O_NONBLOCK to
priv_open()

"good start" deraadt@
ok yasuoka@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.17 19-Jan-2015 deraadt

move to <limits.h> universe
ok yasuoka


# 1.16 27-Nov-2014 tobias

Fix typos in comments.

ok jmc, yasuoka


Revision tags: OPENBSD_5_6_BASE
# 1.15 21-Jul-2014 guenther

Switch from <sys/endian.h> or <machine/endian.h> to the new,
being-standardized <endian.h>

ok deraadt@ millert@ beck@


# 1.14 22-Mar-2014 yasuoka

Stop output "Stopped" log message of the tunnel protocols.


Revision tags: OPENBSD_5_4_BASE OPENBSD_5_5_BASE
# 1.13 20-Apr-2013 yasuoka

Don't use random() because it's not safe. Use arc4random() instead of
it. Suggested by deraadt.


# 1.12 16-Apr-2013 yasuoka

pppoed didn't work since it has been broken after the last
configuration parser change.

pointed out by todd.


Revision tags: OPENBSD_5_3_BASE
# 1.11 18-Sep-2012 yasuoka

New configuration syntax for npppd(8). `npppd.conf' will be based on
parse.y and `npppd-users' will be based on getcap(3). Add man pages.

feedback from giovanni


Revision tags: OPENBSD_5_2_BASE
# 1.10 08-May-2012 yasuoka

Trivial changes from the upstream(IIJ).
- fix styles, compile errors in some ifdef condition and compiler warnings.
- delete rtev* that was to work around routing socket overflows.
- delete is_ctrl argument from l2tp_ctrl_send_packet(). It's not used.
- tweak returning the exit status.
- use IPV6_IPSEC_POLICY for IPv6 socket.
(though npppd cannot set up a ipsec policy to the socket yet.)

ok mcbride henning


# 1.9 08-May-2012 yasuoka

Fix comments and styles. Delete unused variables and labels.
No binary changes.

ok mcbride henning


Revision tags: OPENBSD_5_1_BASE
# 1.8 18-Jan-2012 yasuoka

Fix compiler warnings and some styles.

ok sebastia sthen


Revision tags: OPENBSD_4_9_BASE OPENBSD_5_0_BASE
# 1.7 28-Feb-2011 dlg

fix a buffer overflow in the pppoe receive packet handling.

diff from yasuoka@
ok deraadt@


Revision tags: OPENBSD_4_8_BASE
# 1.6 02-Jul-2010 yasuoka

add $OpenBSD$ and remove trailing space. no functional change.


# 1.5 01-Jul-2010 yasuoka

Translate Japanese comments or labels into English. Translation was
done by IIJ people (MATSUI Yoshihiro, SAITOH Masanobu, Tomoyuki Sahara),
yuo@ and myself.

This diff also includes
- delete part of useless comments, correct spelling.
- add man page of npppdctl.

There is no functional change.


Revision tags: OPENBSD_4_7_BASE
# 1.4 31-Jan-2010 yasuoka

privilege separation of npppd.

- Drop privilege after daemon initializing.
- Some system calls that requires root privileges were replaced to
wrapper functions that communicate with a separated privileged
process via IPC. And the privileged process checks whether the
operations are acceptable.


# 1.3 27-Jan-2010 yasuoka

Fixed 2 off-by-one problems.
(found by parfait, reported by jsg@)


# 1.2 13-Jan-2010 yasuoka

cleanup npppd code. delete IIJ local ifdef switches and fix warnings.
ok @dlg


# 1.1 11-Jan-2010 yasuoka

Initial import npppd(8). npppd is a new PPP daemon that handles many
ppp sessions as a server. It supports L2TP, PPTP and PPPoE as
tunneling.

ok mcbride@ dlg@ deraadt@ reyk@.