Skip to content

Commit

Permalink
l2tp: rely on ppp layer for skb scrubbing
Browse files Browse the repository at this point in the history
Since 79c441a ("ppp: implement x-netns support"), the PPP layer
calls skb_scrub_packet() whenever the skb is received on the PPP
device. Manually resetting packet meta-data in the L2TP layer is thus
redundant.

Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Guillaume Nault authored and davem330 committed Jan 4, 2016
1 parent 04c67a9 commit 98f40b3
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions net/l2tp/l2tp_ppp.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,26 +230,11 @@ static void pppol2tp_recv(struct l2tp_session *session, struct sk_buff *skb, int

if (sk->sk_state & PPPOX_BOUND) {
struct pppox_sock *po;

l2tp_dbg(session, PPPOL2TP_MSG_DATA,
"%s: recv %d byte data frame, passing to ppp\n",
session->name, data_len);

/* We need to forget all info related to the L2TP packet
* gathered in the skb as we are going to reuse the same
* skb for the inner packet.
* Namely we need to:
* - reset xfrm (IPSec) information as it applies to
* the outer L2TP packet and not to the inner one
* - release the dst to force a route lookup on the inner
* IP packet since skb->dst currently points to the dst
* of the UDP tunnel
* - reset netfilter information as it doesn't apply
* to the inner packet either
*/
secpath_reset(skb);
skb_dst_drop(skb);
nf_reset(skb);

po = pppox_sk(sk);
ppp_input(&po->chan, skb);
} else {
Expand Down

0 comments on commit 98f40b3

Please sign in to comment.