From: Roy Marples Date: Fri, 11 Jul 2008 10:13:23 +0000 (+0000) Subject: Save a few bytes here. Also, fill with 0 so that we mirror the BSD gratuitous ARP... X-Git-Tag: v4.0.2~203 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e94b2aca5b57b1d9518750dda2b5e5aa83bf5a0;p=thirdparty%2Fdhcpcd.git Save a few bytes here. Also, fill with 0 so that we mirror the BSD gratuitous ARP when adding an address. --- diff --git a/net.c b/net.c index 4dae17b5..f86bff28 100644 --- a/net.c +++ b/net.c @@ -638,10 +638,10 @@ send_arp(const struct interface *iface, int op, in_addr_t sip, in_addr_t tip) p += iface->hwlen; memcpy(p, &sip, sizeof(sip)); p += sizeof(sip); - /* ARP requests should ignore this, but we fill with 0xff - * for broadcast. */ - memset(p, 0xff, iface->hwlen); - p += iface->hwlen; + /* ARP requests should ignore this */ + retval = iface->hwlen; + while (retval--) + *p++ = '\0'; memcpy(p, &tip, sizeof(tip)); p += sizeof(tip); /* Zero pad if needed */