zcip: fix wrong comparison of source IP with our IP
authorVladislav Grishenko <themiron@mail.ru>
Thu, 19 Mar 2015 11:19:35 +0000 (16:19 +0500)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 22 Mar 2015 16:59:34 +0000 (17:59 +0100)
Commit "zcip: fix link-local IP conflict detection" has introduced
wrong comparsion of source IP with our IP. This leads to a new IP
being picked unnecessarily on every incoming ARP packet.

Signed-off-by: Vladislav Grishenko <themiron@mail.ru>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
networking/zcip.c

index a3307c5c970a371c017796f266c6d20b20808d63..962ba2e6059c4c6e8785bc36b34c22df47051006 100644 (file)
@@ -521,7 +521,7 @@ int zcip_main(int argc UNUSED_PARAM, char **argv)
                        target_ip_conflict = 0;
 
                        if (memcmp(&p.arp.arp_sha, &eth_addr, ETH_ALEN) != 0) {
-                               if (memcmp(p.arp.arp_spa, &ip.s_addr, sizeof(struct in_addr))) {
+                               if (memcmp(p.arp.arp_spa, &ip.s_addr, sizeof(struct in_addr)) == 0) {
                                        /* A probe or reply with source_ip == chosen ip */
                                        source_ip_conflict = 1;
                                }