From: Roy Marples Date: Wed, 30 Apr 2014 09:35:48 +0000 (+0000) Subject: Fix an unassigned memory error. X-Git-Tag: v6.4.0~87 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4cadf4dd5dc757510c7cda7a26cd1e4691c7f5c9;p=thirdparty%2Fdhcpcd.git Fix an unassigned memory error. --- diff --git a/if-linux.c b/if-linux.c index ad52bba7..0a272561 100644 --- a/if-linux.c +++ b/if-linux.c @@ -773,9 +773,6 @@ if_openrawsocket(struct interface *ifp, int protocol) return -1; } #endif - su.sll.sll_family = PF_PACKET; - su.sll.sll_protocol = htons(protocol); - su.sll.sll_ifindex = (int)ifp->index; /* Install the DHCP filter */ memset(&pf, 0, sizeof(pf)); if (protocol == ETHERTYPE_ARP) { @@ -794,6 +791,11 @@ if_openrawsocket(struct interface *ifp, int protocol) goto eexit; } #endif + + memset(&su, 0, sizeof(su)); + su.sll.sll_family = PF_PACKET; + su.sll.sll_protocol = htons(protocol); + su.sll.sll_ifindex = (int)ifp->index; if (bind(s, &su.sa, sizeof(su)) == -1) goto eexit; return s;