Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[cascardo/linux.git] / net / ipv4 / netfilter / nf_nat_amanda.c
index c31b876..0f23b3f 100644 (file)
@@ -44,9 +44,16 @@ static unsigned int help(struct sk_buff *skb,
 
        /* Try to get same port: if not, try to change it. */
        for (port = ntohs(exp->saved_proto.tcp.port); port != 0; port++) {
+               int ret;
+
                exp->tuple.dst.u.tcp.port = htons(port);
-               if (nf_ct_expect_related(exp) == 0)
+               ret = nf_ct_expect_related(exp);
+               if (ret == 0)
+                       break;
+               else if (ret != -EBUSY) {
+                       port = 0;
                        break;
+               }
        }
 
        if (port == 0)