ipv6: fix the check when handle RA
Subsystems (3)
RFC PATCH 1/1 ipv6: fix the check when handle RA
From: Li RongQing <[email protected]>
d9333196572(ipv6: Allow accepting RA from local IP addresses.) made ndisc_router_discovery to skip to handle RA when accept_ra_from_local is 0 and saddr of packet is not the device address, in fact, this condition should be handled
--- net/ipv6/ndisc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
net/ipv6/ndisc.c +4 -4
@@ -1152,8 +1152,8 @@ static void ndisc_router_discovery(struct sk_buff *skb)* accept_ra_from_local is set to true. */ if (!(in6_dev->cnf.accept_ra_from_local || -ipv6_chk_addr (dev_net (in6_dev->dev), &ipv6_hdr (skb)->saddr, -NULL ,0 ))) { + !ipv6_chk_addr (dev_net (in6_dev->dev), &ipv6_hdr (skb)->saddr, +NULL ,0 ))) {ND_PRINTK (2 , info,"RA from local address detected on dev: %s: default router ignored\n" , skb->dev->name);
@@ -1295,8 +1295,8 @@ skip_linkparms:#ifdef CONFIG_IPV6_ROUTE_INFO if (!(in6_dev->cnf.accept_ra_from_local || -ipv6_chk_addr (dev_net (in6_dev->dev), &ipv6_hdr (skb)->saddr, -NULL ,0 ))) { + !ipv6_chk_addr (dev_net (in6_dev->dev), &ipv6_hdr (skb)->saddr, +NULL ,0 ))) {ND_PRINTK (2 , info,"RA from local address detected on dev: %s: router info ignored.\n" , skb->dev->name);
Signature · 1 line
1.7.10.4
Hi,
Quoted 18 lines · On Do, 2014-07-10 at 16:29 +0800, [email protected] wrote:
From: Li RongQing <[email protected]>
d9333196572(ipv6: Allow accepting RA from local IP addresses.) made
ndisc_router_discoveryto skip to handle RA whenaccept_ra_from_localis 0 and saddr of packet is not the device address, in fact, this condition should be handledFixes d9333196572(ipv6: Allow accepting RA from local IP addresses.)Cc Ben Greear <[email protected]>Signed-off-by Li RongQing <[email protected]>net/ipv6/ndisc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)net/ipv6/ndisc.c +0
-0
net/ipv6/ndisc.c static void ndisc_router_discovery(struct sk_buff *skb) · line 1156
Quoted 7 lines
net/ipv6/ndisc.c +2
-2@@ -1152,8 +1152,8 @@ static void ndisc_router_discovery(struct sk_buff *skb)* accept_ra_from_local is set to true. */ if (!(in6_dev->cnf.accept_ra_from_local || -ipv6_chk_addr (dev_net (in6_dev->dev), &ipv6_hdr (skb)->saddr, -NULL ,0 ))) { + !ipv6_chk_addr (dev_net (in6_dev->dev), &ipv6_hdr (skb)->saddr, +NULL ,0 ))) {
Uh!
Instead of double negotiation can you please write
if (!in6_dev->cnf.accept_ra_from_local &&
ipv6_chk_addr(...)) {
printk(...);
goto skip;
}Thanks for fixing this, good catch!
Thanks,
Hannes