Commit f859b0f6 authored by Eric W. Biederman's avatar Eric W. Biederman Committed by David S. Miller

ipv4: Cache net in iptunnel_xmit

Store net in a variable in ip_tunnel_xmit so it does not need
to be recomputed when it is used again.
Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 79288330
...@@ -53,6 +53,7 @@ int iptunnel_xmit(struct sock *sk, struct rtable *rt, struct sk_buff *skb, ...@@ -53,6 +53,7 @@ int iptunnel_xmit(struct sock *sk, struct rtable *rt, struct sk_buff *skb,
__u8 tos, __u8 ttl, __be16 df, bool xnet) __u8 tos, __u8 ttl, __be16 df, bool xnet)
{ {
int pkt_len = skb->len - skb_inner_network_offset(skb); int pkt_len = skb->len - skb_inner_network_offset(skb);
struct net *net = dev_net(rt->dst.dev);
struct iphdr *iph; struct iphdr *iph;
int err; int err;
...@@ -76,8 +77,7 @@ int iptunnel_xmit(struct sock *sk, struct rtable *rt, struct sk_buff *skb, ...@@ -76,8 +77,7 @@ int iptunnel_xmit(struct sock *sk, struct rtable *rt, struct sk_buff *skb,
iph->daddr = dst; iph->daddr = dst;
iph->saddr = src; iph->saddr = src;
iph->ttl = ttl; iph->ttl = ttl;
__ip_select_ident(dev_net(rt->dst.dev), iph, __ip_select_ident(net, iph, skb_shinfo(skb)->gso_segs ?: 1);
skb_shinfo(skb)->gso_segs ?: 1);
err = ip_local_out(sk, skb); err = ip_local_out(sk, skb);
if (unlikely(net_xmit_eval(err))) if (unlikely(net_xmit_eval(err)))
......
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