aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ip6_output.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/ip6_output.c')
-rw-r--r--net/ipv6/ip6_output.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 604809b89b67..7a98fc2a5d97 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -388,7 +388,6 @@ int ip6_forward(struct sk_buff *skb)
388 struct ipv6hdr *hdr = ipv6_hdr(skb); 388 struct ipv6hdr *hdr = ipv6_hdr(skb);
389 struct inet6_skb_parm *opt = IP6CB(skb); 389 struct inet6_skb_parm *opt = IP6CB(skb);
390 struct net *net = dev_net(dst->dev); 390 struct net *net = dev_net(dst->dev);
391 struct neighbour *n;
392 u32 mtu; 391 u32 mtu;
393 392
394 if (net->ipv6.devconf_all->forwarding == 0) 393 if (net->ipv6.devconf_all->forwarding == 0)
@@ -463,8 +462,7 @@ int ip6_forward(struct sk_buff *skb)
463 send redirects to source routed frames. 462 send redirects to source routed frames.
464 We don't send redirects to frames decapsulated from IPsec. 463 We don't send redirects to frames decapsulated from IPsec.
465 */ 464 */
466 n = dst_get_neighbour_noref(dst); 465 if (skb->dev == dst->dev && opt->srcrt == 0 && !skb_sec_path(skb)) {
467 if (skb->dev == dst->dev && n && opt->srcrt == 0 && !skb_sec_path(skb)) {
468 struct in6_addr *target = NULL; 466 struct in6_addr *target = NULL;
469 struct rt6_info *rt; 467 struct rt6_info *rt;
470 468
@@ -474,8 +472,8 @@ int ip6_forward(struct sk_buff *skb)
474 */ 472 */
475 473
476 rt = (struct rt6_info *) dst; 474 rt = (struct rt6_info *) dst;
477 if ((rt->rt6i_flags & RTF_GATEWAY)) 475 if (rt->rt6i_flags & RTF_GATEWAY)
478 target = (struct in6_addr*)&n->primary_key; 476 target = &rt->rt6i_gateway;
479 else 477 else
480 target = &hdr->daddr; 478 target = &hdr->daddr;
481 479