* Note: doing an SIOCIGIFFLAGS scribbles on the union portion * of the ifreq structure, which may confuse other parts of ifconfig. * Make a private copy so we can avoid that. */
| 1301 | * Make a private copy so we can avoid that. |
| 1302 | */ |
| 1303 | static void |
| 1304 | setifflags(const char *vname, int value, int s, const struct afswtch *afp) |
| 1305 | { |
| 1306 | struct ifreq my_ifr; |
| 1307 | int flags; |
| 1308 | |
| 1309 | flags = getifflags(name, s); |
| 1310 | if (value < 0) { |
| 1311 | value = -value; |
| 1312 | flags &= ~value; |
| 1313 | } else |
| 1314 | flags |= value; |
| 1315 | memset(&my_ifr, 0, sizeof(my_ifr)); |
| 1316 | (void) strlcpy(my_ifr.ifr_name, name, sizeof(my_ifr.ifr_name)); |
| 1317 | my_ifr.ifr_flags = flags & 0xffff; |
| 1318 | my_ifr.ifr_flagshigh = flags >> 16; |
| 1319 | if (ioctl(s, SIOCSIFFLAGS, (caddr_t)&my_ifr) < 0) |
| 1320 | Perror(vname); |
| 1321 | } |
| 1322 | |
| 1323 | void |
| 1324 | setifcap(const char *vname, int value, int s, const struct afswtch *afp) |
nothing calls this directly
no test coverage detected