diff options
| author | Brooks Davis <brooks@FreeBSD.org> | 2024-07-04 11:27:10 +0000 |
|---|---|---|
| committer | Brooks Davis <brooks@FreeBSD.org> | 2024-07-04 11:27:10 +0000 |
| commit | a2e65d45a5c6def93e1bc8652a6fe686a63fbdb8 (patch) | |
| tree | 7e5b243c0b64348c092cbd243aba660681b252f2 /sbin/dhclient | |
| parent | 12be19572aeac33409c34924ba8f7f051c2ee704 (diff) | |
Diffstat (limited to 'sbin/dhclient')
| -rw-r--r-- | sbin/dhclient/dispatch.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sbin/dhclient/dispatch.c b/sbin/dhclient/dispatch.c index 310f477f8a4f..3108fe4365d1 100644 --- a/sbin/dhclient/dispatch.c +++ b/sbin/dhclient/dispatch.c @@ -76,7 +76,6 @@ discover_interfaces(struct interface_info *iface) { struct ifaddrs *ifap, *ifa; struct ifreq *tif; - int len = IFNAMSIZ + sizeof(struct sockaddr_storage); if (getifaddrs(&ifap) != 0) error("getifaddrs failed"); @@ -119,7 +118,7 @@ discover_interfaces(struct interface_info *iface) LLADDR(foo), foo->sdl_alen); } if (!iface->ifp) { - if ((tif = calloc(1, len)) == NULL) + if ((tif = calloc(1, sizeof(struct ifreq))) == NULL) error("no space to remember ifp"); strlcpy(tif->ifr_name, ifa->ifa_name, IFNAMSIZ); iface->ifp = tif; |
