Re: config BPQ Ethernet device

From: Jens David (gplkqit.weiersbwbm@nraef.org)
Date: Wed Jan 24 2001 - 18:50:47 EET

  • Next message: fms@avantop.com.tw: "Oops caused by mheardd"

    > On Wed, 24 Jan 2001, Jens David wrote:
    > >
    > > In fact it might be better to just fix the kernel this time.
    > > The fix is pretty self contained and consists only of the ax25_gifconf function.
    > > See af_ax25.c at the end.
    > > Whoever maintains the old stuff should just copy-and-paste it out and fix
    > > the stupid thing once for all. It will save a lot of time necessary to answer
    > > the questions.
    >
    > Tried that once. It broke traceroute IIRC. I'm not convinced the
    > ax25_gifconf returns what it is supposed to. I tried asking people about
    > what it should do (including Alan) but no-one seemed interested.

    Huh?
    Isn't that fairly obvious?
    See net/core/dev.c:

    /*
     * Perform a SIOCGIFCONF call. This structure will change
     * size eventually, and there is nothing I can do about it.
     * Thus we will need a 'compatibility mode'.
     */
    static int dev_ifconf(char *arg)
    {
    blablabla
    done = gifconf_list[i](dev, NULL, 0);
    blablabla
    }

    ...

    /* Protocol dependent address dumping routines */
    static gifconf_func_t * gifconf_list [NPROTO];

    int register_gifconf(unsigned int family, gifconf_func_t * gifconf)
    {
            if (family>=NPROTO)
                    return -EINVAL;
            gifconf_list[family] = gifconf;
            return 0;
    }

    Now, if an interface is an IP-capable interface the IP protocol
    does the job. Since Linux 2.0 or something however, not every
    interface does necessarily need to be an IP interface. If it
    has an IP address assigned, net/ipv4 takes over the job of
    paining out the ifconf structure:

    static int
    inet_gifconf(struct device *dev, char *buf, int len)
    {
       ... paint out structure ...
    }

    __initfunc(void devinet_init(void))
    {
            register_gifconf(PF_INET, inet_gifconf);
            ...
    }

    The SIOCGIFCONF ioctl() is expected to return a list if active
    interfaces. It is used in ifconfig and several ax.25 tools. If
    no function is registered to return at least the interface name,
    the interface basically does not exist in the list and thus the
    tool fails.

    If your traceroute can't cope with non-IP interfaces it is severely
    broken and needs to be fixed, though.

      -- Jens
    -
    To unsubscribe from this list: send the line "unsubscribe linux-hams" in
    the body of a message to gxtzkixn.dxafrcpzo@hide-154.nhs.uk



    This archive was generated by hypermail 2b30 : Wed Jan 24 2001 - 18:56:19 EET