use correct interface name when setting flags; fixes ifconfig ... create ... up
Noticed by: Chris Anderson
This commit is contained in:
parent
36dc08476d
commit
fab0828067
@ -697,13 +697,13 @@ setifflags(const char *vname, int value, int s, const struct afswtch *afp)
|
||||
struct ifreq my_ifr;
|
||||
int flags;
|
||||
|
||||
bcopy((char *)&ifr, (char *)&my_ifr, sizeof(struct ifreq));
|
||||
memset(&my_ifr, 0, sizeof(my_ifr));
|
||||
(void) strlcpy(my_ifr.ifr_name, name, sizeof(my_ifr.ifr_name));
|
||||
|
||||
if (ioctl(s, SIOCGIFFLAGS, (caddr_t)&my_ifr) < 0) {
|
||||
Perror("ioctl (SIOCGIFFLAGS)");
|
||||
exit(1);
|
||||
}
|
||||
strncpy(my_ifr.ifr_name, name, sizeof (my_ifr.ifr_name));
|
||||
flags = (my_ifr.ifr_flags & 0xffff) | (my_ifr.ifr_flagshigh << 16);
|
||||
|
||||
if (value < 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user