mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
iptunnel: scrub packet in iptunnel_pull_header
Part of skb_scrub_packet was open coded in iptunnel_pull_header. Let it call skb_scrub_packet directly instead. Signed-off-by: Jiri Benc <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
c9e78efb6f
commit
7f290c9435
7 changed files with 12 additions and 13 deletions
|
|
@ -238,7 +238,7 @@ static int parse_gre_header(struct sk_buff *skb, struct tnl_ptk_info *tpi,
|
|||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
return iptunnel_pull_header(skb, hdr_len, tpi->proto);
|
||||
return iptunnel_pull_header(skb, hdr_len, tpi->proto, false);
|
||||
}
|
||||
|
||||
static void ipgre_err(struct sk_buff *skb, u32 info,
|
||||
|
|
|
|||
|
|
@ -86,7 +86,8 @@ void iptunnel_xmit(struct sock *sk, struct rtable *rt, struct sk_buff *skb,
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(iptunnel_xmit);
|
||||
|
||||
int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto)
|
||||
int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto,
|
||||
bool xnet)
|
||||
{
|
||||
if (unlikely(!pskb_may_pull(skb, hdr_len)))
|
||||
return -ENOMEM;
|
||||
|
|
@ -109,13 +110,10 @@ int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto)
|
|||
skb->protocol = inner_proto;
|
||||
}
|
||||
|
||||
nf_reset(skb);
|
||||
secpath_reset(skb);
|
||||
skb_clear_hash_if_not_l4(skb);
|
||||
skb_dst_drop(skb);
|
||||
skb->vlan_tci = 0;
|
||||
skb_set_queue_mapping(skb, 0);
|
||||
skb->pkt_type = PACKET_HOST;
|
||||
skb_scrub_packet(skb, xnet);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(iptunnel_pull_header);
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ static int ipip_rcv(struct sk_buff *skb)
|
|||
if (tunnel) {
|
||||
if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb))
|
||||
goto drop;
|
||||
if (iptunnel_pull_header(skb, 0, tpi.proto))
|
||||
if (iptunnel_pull_header(skb, 0, tpi.proto, false))
|
||||
goto drop;
|
||||
return ip_tunnel_rcv(tunnel, skb, &tpi, NULL, log_ecn_error);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue