summaryrefslogtreecommitdiffstats
path: root/net/ipv6/udp.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-02-01 18:56:08 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-02-01 18:56:08 -0500
commit34229b277480f46c1e9a19f027f30b074512e68b (patch)
tree90d8b43ebceb850b0e7852d75283aebbd2abbc00 /net/ipv6/udp.c
parent2c923414d3963b959f65a8a6031972402e6a34a5 (diff)
parent53729eb174c1589f9185340ffe8c10b3f39f3ef3 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: "This looks like a lot but it's a mixture of regression fixes as well as fixes for longer standing issues. 1) Fix on-channel cancellation in mac80211, from Johannes Berg. 2) Handle CHECKSUM_COMPLETE properly in xt_TCPMSS netfilter xtables module, from Eric Dumazet. 3) Avoid infinite loop in UDP SO_REUSEPORT logic, also from Eric Dumazet. 4) Avoid a NULL deref if we try to set SO_REUSEPORT after a socket is bound, from Craig Gallek. 5) GRO key comparisons don't take lightweight tunnels into account, from Jesse Gross. 6) Fix struct pid leak via SCM credentials in AF_UNIX, from Eric Dumazet. 7) We need to set the rtnl_link_ops of ipv6 SIT tunnels before we register them, otherwise the NEWLINK netlink message is missing the proper attributes. From Thadeu Lima de Souza Cascardo. 8) Several Spectrum chip bug fixes for mlxsw switch driver, from Ido Schimmel 9) Handle fragments properly in ipv4 easly socket demux, from Eric Dumazet. 10) Don't ignore the ifindex key specifier on ipv6 output route lookups, from Paolo Abeni" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (128 commits) tcp: avoid cwnd undo after receiving ECN irda: fix a potential use-after-free in ircomm_param_request net: tg3: avoid uninitialized variable warning net: nb8800: avoid uninitialized variable warning net: vxge: avoid unused function warnings net: bgmac: clarify CONFIG_BCMA dependency net: hp100: remove unnecessary #ifdefs net: davinci_cpdma: use dma_addr_t for DMA address ipv6/udp: use sticky pktinfo egress ifindex on connect() ipv6: enforce flowi6_oif usage in ip6_dst_lookup_tail() netlink: not trim skb for mmaped socket when dump vxlan: fix a out of bounds access in __vxlan_find_mac net: dsa: mv88e6xxx: fix port VLAN maps fib_trie: Fix shift by 32 in fib_table_lookup net: moxart: use correct accessors for DMA memory ipv4: ipconfig: avoid unused ic_proto_used symbol bnxt_en: Fix crash in bnxt_free_tx_skbs() during tx timeout. bnxt_en: Exclude rx_drop_pkts hw counter from the stack's rx_dropped counter. bnxt_en: Ring free response from close path should use completion ring net_sched: drr: check for NULL pointer in drr_dequeue ...
Diffstat (limited to 'net/ipv6/udp.c')
-rw-r--r--net/ipv6/udp.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 5d2c2afffe7b..22e28a44e3c8 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -257,6 +257,7 @@ static struct sock *udp6_lib_lookup2(struct net *net,
257 struct sock *sk, *result; 257 struct sock *sk, *result;
258 struct hlist_nulls_node *node; 258 struct hlist_nulls_node *node;
259 int score, badness, matches = 0, reuseport = 0; 259 int score, badness, matches = 0, reuseport = 0;
260 bool select_ok = true;
260 u32 hash = 0; 261 u32 hash = 0;
261 262
262begin: 263begin:
@@ -270,14 +271,18 @@ begin:
270 badness = score; 271 badness = score;
271 reuseport = sk->sk_reuseport; 272 reuseport = sk->sk_reuseport;
272 if (reuseport) { 273 if (reuseport) {
273 struct sock *sk2;
274 hash = udp6_ehashfn(net, daddr, hnum, 274 hash = udp6_ehashfn(net, daddr, hnum,
275 saddr, sport); 275 saddr, sport);
276 sk2 = reuseport_select_sock(sk, hash, skb, 276 if (select_ok) {
277 sizeof(struct udphdr)); 277 struct sock *sk2;
278 if (sk2) { 278
279 result = sk2; 279 sk2 = reuseport_select_sock(sk, hash, skb,
280 goto found; 280 sizeof(struct udphdr));
281 if (sk2) {
282 result = sk2;
283 select_ok = false;
284 goto found;
285 }
281 } 286 }
282 matches = 1; 287 matches = 1;
283 } 288 }
@@ -321,6 +326,7 @@ struct sock *__udp6_lib_lookup(struct net *net,
321 unsigned int hash2, slot2, slot = udp_hashfn(net, hnum, udptable->mask); 326 unsigned int hash2, slot2, slot = udp_hashfn(net, hnum, udptable->mask);
322 struct udp_hslot *hslot2, *hslot = &udptable->hash[slot]; 327 struct udp_hslot *hslot2, *hslot = &udptable->hash[slot];
323 int score, badness, matches = 0, reuseport = 0; 328 int score, badness, matches = 0, reuseport = 0;
329 bool select_ok = true;
324 u32 hash = 0; 330 u32 hash = 0;
325 331
326 rcu_read_lock(); 332 rcu_read_lock();
@@ -358,14 +364,18 @@ begin:
358 badness = score; 364 badness = score;
359 reuseport = sk->sk_reuseport; 365 reuseport = sk->sk_reuseport;
360 if (reuseport) { 366 if (reuseport) {
361 struct sock *sk2;
362 hash = udp6_ehashfn(net, daddr, hnum, 367 hash = udp6_ehashfn(net, daddr, hnum,
363 saddr, sport); 368 saddr, sport);
364 sk2 = reuseport_select_sock(sk, hash, skb, 369 if (select_ok) {
370 struct sock *sk2;
371
372 sk2 = reuseport_select_sock(sk, hash, skb,
365 sizeof(struct udphdr)); 373 sizeof(struct udphdr));
366 if (sk2) { 374 if (sk2) {
367 result = sk2; 375 result = sk2;
368 goto found; 376 select_ok = false;
377 goto found;
378 }
369 } 379 }
370 matches = 1; 380 matches = 1;
371 } 381 }