diff options
author | David S. Miller <davem@davemloft.net> | 2012-01-27 15:32:19 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-01-27 21:00:08 -0500 |
commit | c45a3dfb59c0f17bdbd294dd01efb2d7f99a32c7 (patch) | |
tree | a7b4f99a97ab012371f91fa7a2fbdc52bb584f74 | |
parent | 4991969a1027826c3db19dd3e600e145603e6928 (diff) | |
download | op-kernel-dev-c45a3dfb59c0f17bdbd294dd01efb2d7f99a32c7.zip op-kernel-dev-c45a3dfb59c0f17bdbd294dd01efb2d7f99a32c7.tar.gz |
ipv6: Eliminate dst_get_neighbour_noref() usage in ip6_forward().
It's only used to get at neigh->primary_key, which in this context is
always going to be the same as rt->rt6i_gateway.
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv6/ip6_output.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 604809b..7a98fc2 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c @@ -388,7 +388,6 @@ int ip6_forward(struct sk_buff *skb) struct ipv6hdr *hdr = ipv6_hdr(skb); struct inet6_skb_parm *opt = IP6CB(skb); struct net *net = dev_net(dst->dev); - struct neighbour *n; u32 mtu; if (net->ipv6.devconf_all->forwarding == 0) @@ -463,8 +462,7 @@ int ip6_forward(struct sk_buff *skb) send redirects to source routed frames. We don't send redirects to frames decapsulated from IPsec. */ - n = dst_get_neighbour_noref(dst); - if (skb->dev == dst->dev && n && opt->srcrt == 0 && !skb_sec_path(skb)) { + if (skb->dev == dst->dev && opt->srcrt == 0 && !skb_sec_path(skb)) { struct in6_addr *target = NULL; struct rt6_info *rt; @@ -474,8 +472,8 @@ int ip6_forward(struct sk_buff *skb) */ rt = (struct rt6_info *) dst; - if ((rt->rt6i_flags & RTF_GATEWAY)) - target = (struct in6_addr*)&n->primary_key; + if (rt->rt6i_flags & RTF_GATEWAY) + target = &rt->rt6i_gateway; else target = &hdr->daddr; |