diff options
author | sobomax <sobomax@FreeBSD.org> | 2002-08-18 07:05:00 +0000 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2002-08-18 07:05:00 +0000 |
commit | f6cebc060671b6c67f52080c35a0e55d5498cbf0 (patch) | |
tree | 344b7a3da98a22c060f844fe311e36665045f41f /sbin | |
parent | 2f2bf8ffc0ae7c92c322a28e5781db15fbca6226 (diff) | |
download | FreeBSD-src-f6cebc060671b6c67f52080c35a0e55d5498cbf0.zip FreeBSD-src-f6cebc060671b6c67f52080c35a0e55d5498cbf0.tar.gz |
Increase size of ifnet.if_flags from 16 bits (short) to 32 bits (int). To avoid
breaking application ABI use unused ifreq.ifru_flags[1] for upper 16 bits in
SIOCSIFFLAGS and SIOCGIFFLAGS ioctl's.
Reviewed by: -hackers, -net
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 9f37f99..537378b 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -999,14 +999,15 @@ setifflags(const char *vname, int value, int s, const struct afswtch *afp) exit(1); } strncpy(my_ifr.ifr_name, name, sizeof (my_ifr.ifr_name)); - flags = my_ifr.ifr_flags; + flags = (ifr->ifr_flags & 0xffff) | (my_ifr.ifr_flagshigh << 16); if (value < 0) { value = -value; flags &= ~value; } else flags |= value; - my_ifr.ifr_flags = flags; + my_ifr.ifr_flags = flags & 0xffff; + my_ifr.ifr_flagshigh = flags >> 16; if (ioctl(s, SIOCSIFFLAGS, (caddr_t)&my_ifr) < 0) Perror(vname); } |