aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ndisc.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2006-09-22 17:44:53 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-22 18:20:27 -0400
commitfc26d0abd5afd2b5268a7dbdbf8be1095ce5703e (patch)
treebfb7beca3f0286920e5518541e10c380a6fb8ac6 /net/ipv6/ndisc.c
parent8814c4b533817df825485ff32ce6ac406c3a54d1 (diff)
[IPV6] NDISC: Fix is_router flag setting.
We did not send appropriate IsRouter flag if the forwarding setting is positive even value. Let's give 1/0 value to ndisc_send_na(). Also, existing users of ndisc_send_na() give 0/1 to override, we can omit redundant operation in that function. Bug hinted by Nicolas Dichtel <nicolas.dichtel@6wind.com>. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ndisc.c')
-rw-r--r--net/ipv6/ndisc.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 76517a5f6576..0304b5fe8d6a 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -496,7 +496,7 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh,
496 msg->icmph.icmp6_unused = 0; 496 msg->icmph.icmp6_unused = 0;
497 msg->icmph.icmp6_router = router; 497 msg->icmph.icmp6_router = router;
498 msg->icmph.icmp6_solicited = solicited; 498 msg->icmph.icmp6_solicited = solicited;
499 msg->icmph.icmp6_override = !!override; 499 msg->icmph.icmp6_override = override;
500 500
501 /* Set the target address. */ 501 /* Set the target address. */
502 ipv6_addr_copy(&msg->target, solicited_addr); 502 ipv6_addr_copy(&msg->target, solicited_addr);
@@ -847,10 +847,7 @@ static void ndisc_recv_ns(struct sk_buff *skb)
847 goto out; 847 goto out;
848 } 848 }
849 849
850 if (pneigh) 850 is_router = !!(pneigh ? pneigh->flags & NTF_ROUTER : idev->cnf.forwarding);
851 is_router = pneigh->flags & NTF_ROUTER;
852 else
853 is_router = idev->cnf.forwarding;
854 851
855 if (dad) { 852 if (dad) {
856 struct in6_addr maddr; 853 struct in6_addr maddr;