summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2007-05-08 21:52:54 +0000
committerLennart Poettering <lennart@poettering.net>2007-05-08 21:52:54 +0000
commit0e1ff7b80d77fa1fb0a3ccb3c4b047e25c04afdd (patch)
tree414c2d71836befaa97df1a8df11f68d53fd4b285
parentdf9f7bd6252f8d5cc94431b6f9088636bf8280e9 (diff)
Don't pick the first 256 and the last 256 IP addresses from the IPv4LL range, as required by section 2.1 of the ipv4ll spec. (Noticed by grinsbalu)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1456 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
-rw-r--r--avahi-autoipd/main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/avahi-autoipd/main.c b/avahi-autoipd/main.c
index bf3e775..26a516a 100644
--- a/avahi-autoipd/main.c
+++ b/avahi-autoipd/main.c
@@ -762,9 +762,9 @@ recv_packet(int fd __unused, ArpPacket **packet, size_t *packet_len)
int is_ll_address(uint32_t addr) {
return
- (ntohl(addr) & IPV4LL_NETMASK) == IPV4LL_NETWORK &&
- ntohl(addr) != IPV4LL_NETWORK &&
- ntohl(addr) != IPV4LL_BROADCAST;
+ ((ntohl(addr) & IPV4LL_NETMASK) == IPV4LL_NETWORK) &&
+ ((ntohl(addr) & 0x0000FF00) != 0x0000) &&
+ ((ntohl(addr) & 0x0000FF00) != 0xFF00);
}
@@ -1094,7 +1094,7 @@ static int loop(int iface, uint32_t addr) {
load_address(address_fn, &addr);
if (addr && !is_ll_address(addr)) {
- daemon_log(LOG_WARNING, "Requested address %s is not from IPv4LL range 169.254/16, ignoring.", inet_ntop(AF_INET, &addr, buf, sizeof(buf)));
+ daemon_log(LOG_WARNING, "Requested address %s is not from IPv4LL range 169.254/16 or a reserved address, ignoring.", inet_ntop(AF_INET, &addr, buf, sizeof(buf)));
addr = 0;
}