Skip to content

Commit a7093fe

Browse files
ebiedermdavem330
authored andcommitted
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" <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 77589ce commit a7093fe

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/net/ppp/pptp.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
169169
{
170170
struct sock *sk = (struct sock *) chan->private;
171171
struct pppox_sock *po = pppox_sk(sk);
172+
struct net *net = sock_net(sk);
172173
struct pptp_opt *opt = &po->proto.pptp;
173174
struct pptp_gre_header *hdr;
174175
unsigned int header_len = sizeof(*hdr);
@@ -187,7 +188,7 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
187188
if (sk_pppox(po)->sk_state & PPPOX_DEAD)
188189
goto tx_error;
189190

190-
rt = ip_route_output_ports(sock_net(sk), &fl4, NULL,
191+
rt = ip_route_output_ports(net, &fl4, NULL,
191192
opt->dst_addr.sin_addr.s_addr,
192193
opt->src_addr.sin_addr.s_addr,
193194
0, 0, IPPROTO_GRE,
@@ -279,7 +280,7 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
279280
nf_reset(skb);
280281

281282
skb->ip_summed = CHECKSUM_NONE;
282-
ip_select_ident(sock_net(sk), skb, NULL);
283+
ip_select_ident(net, skb, NULL);
283284
ip_send_check(iph);
284285

285286
ip_local_out(skb->sk, skb);

0 commit comments

Comments
 (0)