Commit 12da2a43 authored by Yan Zheng's avatar Yan Zheng Committed by David S. Miller

[IPV6]: small fix for ipv6_dev_get_saddr(...)

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: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4060994c
...@@ -1045,9 +1045,10 @@ int ipv6_dev_get_saddr(struct net_device *daddr_dev, ...@@ -1045,9 +1045,10 @@ int ipv6_dev_get_saddr(struct net_device *daddr_dev,
} }
#endif #endif
/* Rule 8: Use longest matching prefix */ /* Rule 8: Use longest matching prefix */
if (hiscore.rule < 8) if (hiscore.rule < 8) {
hiscore.matchlen = ipv6_addr_diff(&ifa_result->addr, daddr); hiscore.matchlen = ipv6_addr_diff(&ifa_result->addr, daddr);
score.rule++; hiscore.rule++;
}
score.matchlen = ipv6_addr_diff(&ifa->addr, daddr); score.matchlen = ipv6_addr_diff(&ifa->addr, daddr);
if (score.matchlen > hiscore.matchlen) { if (score.matchlen > hiscore.matchlen) {
score.rule = 8; score.rule = 8;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment