[OpenAFS-devel] Strange logic when failing to parse NetInfo file

Harald Barth haba@pdc.kth.se
Thu, 24 Feb 2005 07:14:52 +0100 (MET)


There is a strange logic what should happen if we fail
to match the IP numbers in the NetInfo file with the
interfaces of the system.

Suppose I have a server with two interfaces and I really want
it to talk only on interface 10.0.47.11. So I put 10.0.47.11
in my NetInfo file. Now the ethnernet driver or whatever fails
to load for that interface so that I only come up with the
other interface. In that case the logic in ParseNetInfoFile()
deducts that something is wrong and enables all interfaces.

openafs-1.3.78/src/util/netutils.c:ParseNetInfoFile()

    /* in case of any error, we use all the interfaces present */
    if (count <= 0) {
        sprintf(reason,
                "Error in reading/parsing Interface file\nUsing all configured interface addresses \n");
        for (i = 0; i < existNu; i++) {
            final[i] = existingAddr[i];
            mask[i] = existingMask[i];
            mtu[i] = existingMtu[i];
        }
        return existNu;
    }

I think this _may_ be OK if the NetInfo file was empty. Like

    if (count <= 0 && lineNo == 0) 

But even then. If you put it there, you probably wanted to list
interfaces and if you say you want to list interfaces and then
your list is empty: your problem.

I don't want to talk my fileservers on all interfaces just
because the one it is supposed to use has gone away for some
unrelated reason.

If you agree on this, it should go to openafs-bugs, yes?

Harald.