Use TUNSIFPID when we change our PID (if it exists).
This commit is contained in:
parent
bbdecb957c
commit
06b47306d1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=56350
@ -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
|
||||
}
|
||||
|
@ -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 *);
|
||||
|
@ -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 */
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user