]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - net/ipv4/udp.c
net: spread __net_init, __net_exit
[mirror_ubuntu-artful-kernel.git] / net / ipv4 / udp.c
index 1f9534846ca9a3b457e00266cd84ba7b2cb42450..4f7d2122d8183b95cd49387d282445de894b2c04 100644 (file)
@@ -216,9 +216,8 @@ int udp_lib_get_port(struct sock *sk, unsigned short snum,
                 * force rand to be an odd multiple of UDP_HTABLE_SIZE
                 */
                rand = (rand | 1) * (udptable->mask + 1);
-               for (last = first + udptable->mask + 1;
-                    first != last;
-                    first++) {
+               last = first + udptable->mask + 1;
+               do {
                        hslot = udp_hashslot(udptable, net, first);
                        bitmap_zero(bitmap, PORTS_PER_CHAIN);
                        spin_lock_bh(&hslot->lock);
@@ -238,7 +237,7 @@ int udp_lib_get_port(struct sock *sk, unsigned short snum,
                                snum += rand;
                        } while (snum != first);
                        spin_unlock_bh(&hslot->lock);
-               }
+               } while (++first != last);
                goto fail;
        } else {
                hslot = udp_hashslot(udptable, net, snum);
@@ -2028,12 +2027,12 @@ static struct udp_seq_afinfo udp4_seq_afinfo = {
        },
 };
 
-static int udp4_proc_init_net(struct net *net)
+static int __net_init udp4_proc_init_net(struct net *net)
 {
        return udp_proc_register(net, &udp4_seq_afinfo);
 }
 
-static void udp4_proc_exit_net(struct net *net)
+static void __net_exit udp4_proc_exit_net(struct net *net)
 {
        udp_proc_unregister(net, &udp4_seq_afinfo);
 }