aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexei Starovoitov <[email protected]>2019-06-03 13:38:49 -0700
committerAlexei Starovoitov <[email protected]>2019-06-03 13:38:49 -0700
commite7f3dd281cf916fe1231eca1a967c09d8f1a1fad (patch)
tree294de439bd74c0d6b281b47e61ed2e164b6fab1c
parent1e692f09e091bf5c8b38384f297d6dae5dbf0f12 (diff)
parent257a525fe2e49584842c504a92c27097407f778f (diff)
Merge branch 'reuseport-fixes'
Martin Lau says: ==================== s series has fixes when running reuseport's bpf_prog for udp lookup. If there is reuseport's bpf_prog, the common issue is the reuseport code path expects skb->data pointing to the transport header (udphdr here). A couple of commits broke this expectation. The issue is specific to running bpf_prog, so bpf tag is used for this series. Please refer to the individual commit message for details. ==================== Signed-off-by: Alexei Starovoitov <[email protected]>
-rw-r--r--net/ipv4/udp.c6
-rw-r--r--net/ipv6/udp.c4
2 files changed, 7 insertions, 3 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 8fb250ed53d4..85db0e3d7f3f 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -503,7 +503,11 @@ static inline struct sock *__udp4_lib_lookup_skb(struct sk_buff *skb,
struct sock *udp4_lib_lookup_skb(struct sk_buff *skb,
__be16 sport, __be16 dport)
{
- return __udp4_lib_lookup_skb(skb, sport, dport, &udp_table);
+ const struct iphdr *iph = ip_hdr(skb);
+
+ return __udp4_lib_lookup(dev_net(skb->dev), iph->saddr, sport,
+ iph->daddr, dport, inet_iif(skb),
+ inet_sdif(skb), &udp_table, NULL);
}
EXPORT_SYMBOL_GPL(udp4_lib_lookup_skb);
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 07fa579dfb96..4e52c37bb836 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -243,7 +243,7 @@ struct sock *udp6_lib_lookup_skb(struct sk_buff *skb,
return __udp6_lib_lookup(dev_net(skb->dev), &iph->saddr, sport,
&iph->daddr, dport, inet6_iif(skb),
- inet6_sdif(skb), &udp_table, skb);
+ inet6_sdif(skb), &udp_table, NULL);
}
EXPORT_SYMBOL_GPL(udp6_lib_lookup_skb);
@@ -515,7 +515,7 @@ int __udp6_lib_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
struct net *net = dev_net(skb->dev);
sk = __udp6_lib_lookup(net, daddr, uh->dest, saddr, uh->source,
- inet6_iif(skb), inet6_sdif(skb), udptable, skb);
+ inet6_iif(skb), inet6_sdif(skb), udptable, NULL);
if (!sk) {
/* No socket for error: try tunnels before discarding */
sk = ERR_PTR(-ENOENT);