mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-11-09 16:20:55 +00:00
Fix length->netmask conversions to avoid undefined behaviour.
This commit is contained in:
1 parent
15b1b7e9c3
commit
10cfc0ddb3
2 files changed
+3
-2
No files matched your search
+2
-1
@@ -208,7 +208,8 @@ int iface_enumerate(int family, void *parm, int (*callback)())
|
||||
struct in_addr netmask, addr, broadcast;
|
||||
char *label = NULL;
|
||||
|
||||
netmask.s_addr = htonl(0xffffffff << (32 - ifa->ifa_prefixlen));
|
||||
netmask.s_addr = htonl(~(in_addr_t)0 << (32 - ifa->ifa_prefixlen));
|
||||
|
||||
addr.s_addr = 0;
|
||||
broadcast.s_addr = 0;
|
||||
|
||||
|
||||
Reference in new issue
Block a user