Skip to content

Commit

Permalink
[IPV6] NDISC: Fix is_router flag setting.
Browse files Browse the repository at this point in the history
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 <[email protected]>.

Signed-off-by: YOSHIFUJI Hideaki <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
yoshfuji authored and David S. Miller committed Sep 22, 2006
1 parent 8814c4b commit fc26d0a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions net/ipv6/ndisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh,
msg->icmph.icmp6_unused = 0;
msg->icmph.icmp6_router = router;
msg->icmph.icmp6_solicited = solicited;
msg->icmph.icmp6_override = !!override;
msg->icmph.icmp6_override = override;

/* Set the target address. */
ipv6_addr_copy(&msg->target, solicited_addr);
Expand Down Expand Up @@ -847,10 +847,7 @@ static void ndisc_recv_ns(struct sk_buff *skb)
goto out;
}

if (pneigh)
is_router = pneigh->flags & NTF_ROUTER;
else
is_router = idev->cnf.forwarding;
is_router = !!(pneigh ? pneigh->flags & NTF_ROUTER : idev->cnf.forwarding);

if (dad) {
struct in6_addr maddr;
Expand Down

0 comments on commit fc26d0a

Please sign in to comment.