Commit ab4eb353 authored by YOSHIFUJI Hideaki / 吉藤英明's avatar YOSHIFUJI Hideaki / 吉藤英明 Committed by David S. Miller

ipv6: Process unicast packet with Router Alert by checking flag in skb.

Router Alert option is marked in skb.
Previously, IP6CB(skb)->ra was set to positive value for such packets.
Since commit dd3332bf ("ipv6: Store Router Alert option in IP6CB
directly."), IP6SKB_ROUTERALERT is set in IP6CB(skb)->flags, and
the value of Router Alert option (in network byte order) is set
to IP6CB(skb)->ra for such packets.

Multicast forwarding path uses that flag and value, but unicast
forwarding path does not use the flag and misuses IP6CB(skb)->ra
value.
Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a3d9dd89
...@@ -381,9 +381,8 @@ int ip6_forward(struct sk_buff *skb) ...@@ -381,9 +381,8 @@ int ip6_forward(struct sk_buff *skb)
* cannot be fragmented, because there is no warranty * cannot be fragmented, because there is no warranty
* that different fragments will go along one path. --ANK * that different fragments will go along one path. --ANK
*/ */
if (opt->ra) { if (unlikely(opt->flags & IP6SKB_ROUTERALERT)) {
u8 *ptr = skb_network_header(skb) + opt->ra; if (ip6_call_ra_chain(skb, ntohs(opt->ra)))
if (ip6_call_ra_chain(skb, (ptr[2]<<8) + ptr[3]))
return 0; return 0;
} }
......
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