From: Todd C. Miller Date: Mon, 14 Sep 1998 15:48:05 +0000 (+0000) Subject: kill unused localhost_mask var X-Git-Tag: SUDO_1_5_6~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8021b8cb881c459ddc99e7122f079ae71f8affa6;p=sudo kill unused localhost_mask var copy if name to ifr_tmp after we zero it --- diff --git a/interfaces.c b/interfaces.c index a62735a37..2dd404874 100644 --- a/interfaces.c +++ b/interfaces.c @@ -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));