diff options
author | brian <brian@FreeBSD.org> | 2000-01-21 00:33:27 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2000-01-21 00:33:27 +0000 |
commit | a29610fe9a9a062d76bd0f17dd006ce6997c60c4 (patch) | |
tree | 0e45f01178ebc6c99f48edcb1267b522780b3b0c | |
parent | b5a9af645e9609d1aa46a41309b617b059bcf66e (diff) | |
download | FreeBSD-src-a29610fe9a9a062d76bd0f17dd006ce6997c60c4.zip FreeBSD-src-a29610fe9a9a062d76bd0f17dd006ce6997c60c4.tar.gz |
Use TUNSIFPID when we change our PID (if it exists).
-rw-r--r-- | usr.sbin/ppp/bundle.c | 11 | ||||
-rw-r--r-- | usr.sbin/ppp/bundle.h | 1 | ||||
-rw-r--r-- | usr.sbin/ppp/main.c | 1 |
3 files changed, 12 insertions, 1 deletions
diff --git a/usr.sbin/ppp/bundle.c b/usr.sbin/ppp/bundle.c index 9ee00e2..a15b63e 100644 --- a/usr.sbin/ppp/bundle.c +++ b/usr.sbin/ppp/bundle.c @@ -30,7 +30,7 @@ #include <sys/socket.h> #include <netinet/in.h> #include <net/if.h> -#include <net/if_tun.h> /* For TUNSIFMODE & TUNSLMODE */ +#include <net/if_tun.h> /* For TUNSIFMODE, TUNSLMODE & TUNSIFPID*/ #include <arpa/inet.h> #include <net/route.h> #include <netinet/in_systm.h> @@ -1738,6 +1738,7 @@ bundle_setsid(struct bundle *bundle, int holdsession) read(fds[0], &done, 1); /* uu_locks are mine ! */ close(fds[0]); setsid(); + bundle_ChangedPID(bundle); log_Printf(LogPHASE, "%d -> %d: %s session control\n", (int)orig, (int)getpid(), holdsession ? "Passed" : "Dropped"); @@ -1940,3 +1941,11 @@ bundle_WantAutoloadTimer(struct bundle *bundle) return 0; } + +void +bundle_ChangedPID(struct bundle *bundle) +{ +#ifdef TUNSIFPID + ioctl(bundle->dev.fd, TUNSIFPID, 0); +#endif +} diff --git a/usr.sbin/ppp/bundle.h b/usr.sbin/ppp/bundle.h index f52ed0c..613924c 100644 --- a/usr.sbin/ppp/bundle.h +++ b/usr.sbin/ppp/bundle.h @@ -187,3 +187,4 @@ extern void bundle_AdjustFilters(struct bundle *, struct in_addr *, extern void bundle_CalculateBandwidth(struct bundle *); extern void bundle_AutoAdjust(struct bundle *, int, int); extern int bundle_WantAutoloadTimer(struct bundle *); +extern void bundle_ChangedPID(struct bundle *); diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c index 18c7529..10269e6 100644 --- a/usr.sbin/ppp/main.c +++ b/usr.sbin/ppp/main.c @@ -463,6 +463,7 @@ main(int argc, char **argv) bundle->notify.fd = bgpipe[1]; } + bundle_ChangedPID(bundle); bundle_LockTun(bundle); /* we have a new pid */ } |