diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2015-10-08 00:48:43 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-08 14:27:00 +0300 |
commit | a7093fefa543afad2bf292bba163800e81a4ba33 (patch) | |
tree | 2a56bea439ecfc5c566cd7dd57ceb3e776eda3f7 /drivers/net/ppp/pptp.c | |
parent | 77589ce0f84dd99cc946fd71fe6fb44dd8220d0a (diff) | |
download | linux-a7093fefa543afad2bf292bba163800e81a4ba33.tar.xz |
ppp: Cache net in pptp_xmit
Compute net and store it in a variable in pptp_xmit, so that the value
can be reused the next time it is needed.
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ppp/pptp.c')
-rw-r--r-- | drivers/net/ppp/pptp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ppp/pptp.c b/drivers/net/ppp/pptp.c index 6bef7be10671..5243ab6ed4d4 100644 --- a/drivers/net/ppp/pptp.c +++ b/drivers/net/ppp/pptp.c @@ -169,6 +169,7 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb) { struct sock *sk = (struct sock *) chan->private; struct pppox_sock *po = pppox_sk(sk); + struct net *net = sock_net(sk); struct pptp_opt *opt = &po->proto.pptp; struct pptp_gre_header *hdr; unsigned int header_len = sizeof(*hdr); @@ -187,7 +188,7 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb) if (sk_pppox(po)->sk_state & PPPOX_DEAD) goto tx_error; - rt = ip_route_output_ports(sock_net(sk), &fl4, NULL, + rt = ip_route_output_ports(net, &fl4, NULL, opt->dst_addr.sin_addr.s_addr, opt->src_addr.sin_addr.s_addr, 0, 0, IPPROTO_GRE, @@ -279,7 +280,7 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb) nf_reset(skb); skb->ip_summed = CHECKSUM_NONE; - ip_select_ident(sock_net(sk), skb, NULL); + ip_select_ident(net, skb, NULL); ip_send_check(iph); ip_local_out(skb->sk, skb); |