summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/iface.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/ppp/iface.c')
-rw-r--r--usr.sbin/ppp/iface.c9
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",
OpenPOWER on IntegriCloud