Merge branch 'parisc-4.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller...
[deliverable/linux.git] / net / rds / bind.c
index b22ea956522b420ca77e5c762f82957ee457f071..095f6ce583fee33eee431dc88e04a26c01db2d4d 100644 (file)
@@ -81,6 +81,8 @@ static int rds_add_bound(struct rds_sock *rs, __be32 addr, __be16 *port)
 
        if (*port != 0) {
                rover = be16_to_cpu(*port);
+               if (rover == RDS_FLAG_PROBE_PORT)
+                       return -EINVAL;
                last = rover;
        } else {
                rover = max_t(u16, prandom_u32(), 2);
@@ -91,12 +93,16 @@ static int rds_add_bound(struct rds_sock *rs, __be32 addr, __be16 *port)
                if (rover == 0)
                        rover++;
 
+               if (rover == RDS_FLAG_PROBE_PORT)
+                       continue;
                key = ((u64)addr << 32) | cpu_to_be16(rover);
                if (rhashtable_lookup_fast(&bind_hash_table, &key, ht_parms))
                        continue;
 
                rs->rs_bound_key = key;
                rs->rs_bound_addr = addr;
+               net_get_random_once(&rs->rs_hash_initval,
+                                   sizeof(rs->rs_hash_initval));
                rs->rs_bound_port = cpu_to_be16(rover);
                rs->rs_bound_node.next = NULL;
                rds_sock_addref(rs);
This page took 0.029309 seconds and 5 git commands to generate.