Why does this code return EEXIST?

Previous to this, the network interface would be down and networking as a
whole unconfigured.  It would have been brought up shortly before this
code, complete with a broadcast and netmask.

I didn't write this, I just maintain it now.

---------
    addr.sin_family = AF_INET;
    addr.sin_port = 0;
    inet_aton(netc.defaultGateway, &addr.sin_addr);
    memcpy(&route.rt_gateway, &addr, sizeof(addr));

    addr.sin_addr.s_addr = INADDR_ANY;
    memcpy(&route.rt_dst, &addr, sizeof(addr));
    memcpy(&route.rt_genmask, &addr, sizeof(addr));

    route.rt_flags = RTF_UP | RTF_GATEWAY;
    route.rt_metric = 0;

   if (ioctl(s, SIOCADDRT, &route) < 0) {
        close(s);
        errWindow(TRUE, _("SIOCADDRT: Couldn't setup a default route"), NULL ); 
    }
---------

It worked at one point (probably kernel 2.0), but it doesn't anymore.

It's driving me nuts, and the fact that I know enough to only be dangerous
isn't helping.

I have followed the path of the ioctl to fib_hash.c, where I *think* the
EEXIST is being returned.  I cannot make head nor tails of the code
though.

I had a couple thoughts:
1) I need to add a -host route to the gateway first?
2) The netmask/broadcast is set innapropriatly earlier and blocks this
route being added?
3) Something else....

I don't think 1 is true (anymore? I recall having to do that at one
point).
2) Isn't likely as I can reach anything in my subnet, just not out side of
it.
As for 3....that's why I'm asking you....

Dang!  Why do the first steps have hurt so much!

Ciao!

PS: What does fib mean (Forward Information Base)?

-- 
"No matter where you go, there you are."
                --Buckaroo Banzai (Adventures of Buckaroo Banzai)
                            
The Doctor What: Not that 'who' guy              http://docwhat.gerf.org/
[EMAIL PROTECTED]                    (finger [EMAIL PROTECTED] for PGP key)
KF6VNC
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]

Reply via email to