IPv6:fix BUG of ndisc_send_redirect()
Subsystems (3)
lyw
Acked-by YOSHIFUJI HideakiMr David:
I have submitted a patch to fix the ndisc_send_resirect(), and this
patch has been agreed by Mr yoshifuji. But you have not applied yet. The following is Mr yoshifuji's reply, and I submitted the patch again.
In article <[email protected]> (at Sat, 13 Jan 2007 17:12:40 +0800), Li Yewang <[email protected]> says:
Quoted 1 line
Quoted 1 line
When I tested IPv6 redirect function about kernel 2.6.19.1, and
found
Quoted 1 line
Quoted 1 line
that the kernel can send redirect packets whose target address is
global
Quoted 1 line
Quoted 1 line
address, and the target is not the actual endpoint of communication.
:
Quoted 2 lines
Quoted 2 lines
So, I think the send redirect function must check the target address also.
It is not mandatory, however, it is better to do this. I agree. (Note: In usual, we do not install gateway'ed route with global next-hop.)
--yoshfuji
Following is my patch:
net/ipv6/ndisc.c 2007-01-13 17:02:02.000000000 +0800 renamed from net/ipv6/ndisc.c 2007-01-29 18:12:35.036415512 +0800 +4 -0
@@ -1412,6 +1412,13 @@ void ndisc_send_redirect(struct sk_buff return; } + if (!ipv6_addr_equal(&skb->nh.ipv6h->daddr, target) && + !(ipv6_addr_type(target) & IPV6_ADDR_LINKLOCAL)) { + ND_PRINTK2(KERN_WARNING + "ICMPv6 Redirect: target address is not link-
local.\n");
+ return;
+ }
+
ndisc_flow_init(&fl, NDISC_REDIRECT, &saddr_buf, &skb->nh.ipv6h-
Quoted 1 line
saddr,
dev->ifindex);
From: lyw <[email protected]>
Date: Mon, 29 Jan 2007 18:16:36 +0800
Quoted 5 lines
Mr David:
I have submitted a patch to fix the
ndisc_send_resirect(), and this
patch has been agreed by Mr yoshifuji. But you have not applied yet. The following is Mr yoshifuji's reply, and I submitted the patch again.
I've applied your patch, thanks for reminding me.