[IPV6]: small fix for ipv6_dev_get_saddr(...)
authorYan Zheng <yanzheng@21cn.com>
Tue, 15 Nov 2005 05:42:46 +0000 (21:42 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 15 Nov 2005 05:42:46 +0000 (21:42 -0800)
The "score.rule++" doesn't make any sense for me.
According to codes above, I think it should be "hiscore.rule++;" .

Signed-off-by: Yan Zheng<yanzheng@21cn.com>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/addrconf.c

index ddcf7754eec2dd69d65c3ddabf91edad39277314..56a09a4ac4105d69d548d0311dfbd50f7bbd8454 100644 (file)
@@ -1045,9 +1045,10 @@ int ipv6_dev_get_saddr(struct net_device *daddr_dev,
                        }
 #endif
                        /* Rule 8: Use longest matching prefix */
-                       if (hiscore.rule < 8)
+                       if (hiscore.rule < 8) {
                                hiscore.matchlen = ipv6_addr_diff(&ifa_result->addr, daddr);
-                       score.rule++;
+                               hiscore.rule++;
+                       }
                        score.matchlen = ipv6_addr_diff(&ifa->addr, daddr);
                        if (score.matchlen > hiscore.matchlen) {
                                score.rule = 8;