Commit d8d28457 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Check for IFF_UP in interface_operational.

parent 87fab4bd
......@@ -543,7 +543,16 @@ kernel_setup_interface(int setup, const char *ifname, int ifindex)
int
kernel_interface_operational(const char *ifname, int ifindex)
{
return 1;
struct ifreq req;
int rc;
memset(&req, 0, sizeof(req));
memset(&req, 0, sizeof(req));
strncpy(req.ifr_name, ifname, sizeof(req.ifr_name));
rc = ioctl(dgram_socket, SIOCGIFFLAGS, &req);
if(rc < 0)
return -1;
return ((req.ifr_flags & IFF_UP) != 0);
}
int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment