[OpenAFS-devel] NetRestrict doesn't work as expected

Robert Gerlach gerlach@tubit.tu-berlin.de
Mon, 16 Mar 2009 17:20:32 +0100


The previous patch is wrong, this is the right one.

--- openafs-1.4.8/src/util/netutils.c
+++ openafs-1.4.8/src/util/netutils.c
@@ -194,8 +194,12 @@

        /* Check if we need to exclude this address */
        for (i = 0; i < neaddrs; i++) {
-           if (eAddrs[i] && (eAddrs[i] == addr)) {
-               eAddrs[i] = 0;  /* Yes - exclude it by zeroing it for now */
+           if((addr & 0xff000000) == 0xff000000) {
+               if((eAddrs[i] & addr) == eAddrs[i])
+                   eAddrs[i] = 0;      /* Yes - exclude it by zeroing it for 
now */
+           } else {
+               if(eAddrs[i] == addr)
+                   eAddrs[i] = 0;      /* Yes - exclude it by zeroing it for 
now */
            }
        }
     }                          /* while */


  Robert