]> Pileus Git - ~andy/linux/blobdiff - net/ipv4/inet_connection_sock.c
tcp: bind() fix autoselection to share ports
[~andy/linux] / net / ipv4 / inet_connection_sock.c
index 2e4e24476c4c3ba1b1abb1463ff2f4123180ccad..ecd19b5a7ee2c1948ded8a7c07d62ec21986e4c8 100644 (file)
@@ -128,6 +128,11 @@ again:
                                                        goto have_snum;
                                                }
                                        }
+                                       if (!inet_csk(sk)->icsk_af_ops->bind_conflict(sk, tb)) {
+                                               spin_unlock(&head->lock);
+                                               snum = rover;
+                                               goto have_snum;
+                                       }
                                        goto next;
                                }
                        break;