diff options
author | sobomax <sobomax@FreeBSD.org> | 2002-08-29 12:52:28 +0000 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2002-08-29 12:52:28 +0000 |
commit | 1b5413df630ad344a5a866e4f975d1a6ecc97b6b (patch) | |
tree | bf6fa5bf3cde5d37361cdaf648e7b799b38c9f19 /usr.sbin/ppp | |
parent | f3872b5db52561c99009ec5d27daca1d178a656d (diff) | |
download | FreeBSD-src-1b5413df630ad344a5a866e4f975d1a6ecc97b6b.zip FreeBSD-src-1b5413df630ad344a5a866e4f975d1a6ecc97b6b.tar.gz |
Correctly handle ifr.ifr_flags/ifr.ifr_flagshigh like ifconfig(8) does.
MFC after: 1 day
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r-- | usr.sbin/ppp/iface.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/ppp/iface.c b/usr.sbin/ppp/iface.c index 05951d4..e29bf75 100644 --- a/usr.sbin/ppp/iface.c +++ b/usr.sbin/ppp/iface.c @@ -548,7 +548,7 @@ static int iface_ChangeFlags(const char *ifname, int flags, int how) { struct ifreq ifrq; - int s; + int s, new_flags; s = ID0socket(PF_INET, SOCK_DGRAM, 0); if (s < 0) { @@ -565,11 +565,14 @@ iface_ChangeFlags(const char *ifname, int flags, int how) close(s); return 0; } + new_flags = (ifrq.ifr_flags & 0xffff) | (ifrq.ifr_flagshigh << 16); if (how == IFACE_ADDFLAGS) - ifrq.ifr_flags |= flags; + new_flags |= flags; else - ifrq.ifr_flags &= ~flags; + new_flags &= ~flags; + ifrq.ifr_flags = new_flags & 0xffff; + ifrq.ifr_flagshigh = new_flags >> 16; if (ID0ioctl(s, SIOCSIFFLAGS, &ifrq) < 0) { log_Printf(LogERROR, "iface_ChangeFlags: ioctl(SIOCSIFFLAGS): %s\n", |