]> git.ozlabs.org Git - ppp.git/commit
pppd: implement net-init, net-pre-up and net-down.
authorJaco Kroon <jaco@uls.co.za>
Tue, 26 Sep 2023 12:45:13 +0000 (14:45 +0200)
committerJaco Kroon <jaco@uls.co.za>
Tue, 3 Oct 2023 05:55:17 +0000 (07:55 +0200)
commit39063981f7605a994851eec4a7acae86b2327983
tree45ad26c437ee83e191cf76a0c9bcaa93e5332bee
parentf5aa69baefa83c1d9316f5736c2b6521eff44a81
pppd: implement net-init, net-pre-up and net-down.

net-init executes as a blocking script directly after the unit number
becomes available.  This can be used to initialise aspects related to
the ppp connection that lives outside of the ppp connection.  It can
also be used to clean up (in the author's extremely unlikely case) where
a previous pppd crashed, and net-down didn't execute in order to clean
up.

net-pre-up executes as a blocking script after auth, prior to NCPs being
negotiated.  Unlike ip-pre-up this is guaranteed to execute prior to the
interface being brought up, and can be used in an NCP agnostic manner to
pre-initialise aspects of the interface for which it still needs to be
down (amongst others it's recommended that firewall changes happen
here).

net-down executes in a non-blocking manner just prior to pppd
terminating and can be used to clean up actions from previous scripts.

You will notice that I mention ip-pre-up doesn't gaurantee that the
interface will still be down, this is because in a Linux world all
protocols runs on the same interface, compared to solaris where I'm
informed each protocol runs on it's own sub-interface, each of which has
it's own operational state.  The man page for pppd has also been
adjusted to indicate as much.

Signed-off-by: Jaco Kroon <jaco@uls.co.za>
pppd/main.c
pppd/pathnames.h
pppd/pppd.8