ipvs: avoid lookup for fwmark 0
authorJulian Anastasov <ja@ssi.bg>
Fri, 4 Mar 2011 10:26:17 +0000 (12:26 +0200)
committerSimon Horman <horms@verge.net.au>
Tue, 15 Mar 2011 00:36:48 +0000 (09:36 +0900)
  Restore the previous behaviour to lookup for fwmark
service only when fwmark is non-null. This saves only CPU.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Hans Schillstrom <hans@schillstrom.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
net/netfilter/ipvs/ip_vs_ctl.c

index c73b0c8..f0369d6 100644 (file)
@@ -411,9 +411,11 @@ ip_vs_service_get(struct net *net, int af, __u32 fwmark, __u16 protocol,
        /*
         *      Check the table hashed by fwmark first
         */
-       svc = __ip_vs_svc_fwm_find(net, af, fwmark);
-       if (fwmark && svc)
-               goto out;
+       if (fwmark) {
+               svc = __ip_vs_svc_fwm_find(net, af, fwmark);
+               if (svc)
+                       goto out;
+       }
 
        /*
         *      Check the table hashed by <protocol,addr,port>