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

Robert Gerlach gerlach@tubit.tu-berlin.de
Mon, 9 Mar 2009 20:25:46 +0100


Hello,

I had the same issue as Steve in [1] (wildcards doesn't work in NetRestrict). 
I made this patch to solve it for me.

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

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



[1] http://www.openafs.org/pipermail/openafs-info/2007-March/025590.html