Use AF_INET instead of AF_UNIX

Signed-off-by: Charles Myers <[email protected]>
---
 libc/network/if_indextoname.c | 2 +-
 libc/network/if_nametoindex.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libc/network/if_indextoname.c b/libc/network/if_indextoname.c
index e7f526d..edda5f0 100644
--- a/libc/network/if_indextoname.c
+++ b/libc/network/if_indextoname.c
@@ -10,7 +10,7 @@ char *if_indextoname(unsigned index, char *name)
        struct ifreq ifr;
        int fd, r;
 
-       if ((fd = socket(AF_UNIX, SOCK_DGRAM, 0)) < 0) return 0;
+       if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return 0;
        ifr.ifr_ifindex = index;
        r = ioctl(fd, SIOCGIFNAME, &ifr);
        close(fd);
diff --git a/libc/network/if_nametoindex.c b/libc/network/if_nametoindex.c
index bdaad47..bda749c 100644
--- a/libc/network/if_nametoindex.c
+++ b/libc/network/if_nametoindex.c
@@ -11,7 +11,7 @@ unsigned if_nametoindex(const char *name)
        struct ifreq ifr;
        int fd, r;
 
-       if ((fd = socket(AF_UNIX, SOCK_DGRAM, 0)) < 0) return -1;
+       if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return -1;
        strlcpy(ifr.ifr_name, name, sizeof ifr.ifr_name);
        r = ioctl(fd, SIOCGIFINDEX, &ifr);
        close(fd);
-- 
2.7.4

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to