]> git.meshlink.io Git - catta/blobdiff - avahi-autoipd/main.c
work around KDE misbehaviour. (Patch from Martin Putt; Closes #135)
[catta] / avahi-autoipd / main.c
index f4574dc12d15234d70e25d54a49ef39a1a6203c6..26a516ae98ae4c79c748013a245a4a589a781b85 100644 (file)
@@ -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;
     }
 
@@ -1464,7 +1464,6 @@ static int parse_command_line(int argc, char *argv[]) {
         { NULL, 0, NULL, 0 }
     };
 
-    opterr = 0;
     while ((c = getopt_long(argc, argv, "hDskrcVS:w", long_options, NULL)) >= 0) {
 
         switch(c) {
@@ -1523,7 +1522,6 @@ static int parse_command_line(int argc, char *argv[]) {
 #endif
 
             default:
-                fprintf(stderr, "Invalid command line argument: %s\n", argv[optind-1]);
                 return -1;
         }
     }