]> granicus.if.org Git - sudo/commitdiff
kill unused localhost_mask var
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 14 Sep 1998 15:48:05 +0000 (15:48 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 14 Sep 1998 15:48:05 +0000 (15:48 +0000)
copy if name to ifr_tmp after we zero it

interfaces.c

index a62735a3712b26ed675aecafd7e88d0095467840..2dd404874b0e359f56011bf4867ece0c07eff884 100644 (file)
@@ -108,7 +108,6 @@ void load_interfaces()
     struct ifconf *ifconf;
     struct ifreq *ifr, ifr_tmp;
     struct sockaddr_in *sin;
-    unsigned int localhost_mask;
     int sock, n, i;
     size_t len = sizeof(struct ifconf) + BUFSIZ;
     char *previfname = "", *ifconf_buf = NULL;
@@ -116,9 +115,6 @@ void load_interfaces()
     struct strioctl strioctl;
 #endif /* _ISC */
 
-    /* so we can skip localhost and its ilk */
-    localhost_mask = inet_addr("127.0.0.0");
-
     sock = socket(AF_INET, SOCK_DGRAM, 0);
     if (sock < 0) {
        perror("socket");
@@ -217,6 +213,7 @@ void load_interfaces()
 
        /* get the netmask */
        (void) memset(&ifr_tmp, 0, sizeof(ifr_tmp));
+       strncpy(ifr_tmp.ifr_name, ifr->ifr_name, sizeof(ifr_tmp.ifr_name) - 1);
 #ifdef SIOCGIFNETMASK
 #ifdef _ISC
        STRSET(SIOCGIFNETMASK, (caddr_t) &ifr_tmp, sizeof(ifr_tmp));