]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
ifreqs could have more than structs larger than sockaddr, so use the union size.
authorRoy Marples <roy@marples.name>
Fri, 22 Feb 2008 09:29:40 +0000 (09:29 +0000)
committerRoy Marples <roy@marples.name>
Fri, 22 Feb 2008 09:29:40 +0000 (09:29 +0000)
interface.c

index 1178382d93ce9b6da852ede8be3a72202c8a8733..32926243427ec25429f70d52114421ba6b8e7c4f 100644 (file)
@@ -250,8 +250,7 @@ static int _do_interface (const char *ifname,
 #ifdef __linux__
                p += sizeof (*ifr);
 #else
-               p += sizeof (ifr->ifr_name) +
-                       MAX (ifr->ifr_addr.sa_len, sizeof (struct sockaddr));
+               p += offsetof (struct ifreq, ifr_ifru) + ifr->ifr_addr.sa_len;
 #endif
 
                if (strcmp (ifname, ifr->ifr_name) != 0)