summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
209c508)
Detected by Coverity in CID
1433760
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
memset(&ifr, 0, sizeof(ifr));
strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
memset(&ifr, 0, sizeof(ifr));
strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
- ioctl(sock_ioctl, SIOCGIFFLAGS, &ifr);
+ if (ioctl(sock_ioctl, SIOCGIFFLAGS, &ifr) < 0)
+ return -1;
+
ifr.ifr_flags |= add;
ifr.ifr_flags &= ~rem;
return ioctl(sock_ioctl, SIOCSIFFLAGS, &ifr);
ifr.ifr_flags |= add;
ifr.ifr_flags &= ~rem;
return ioctl(sock_ioctl, SIOCSIFFLAGS, &ifr);