I am trying to work around a problem, where a routing daemon (zebra) installs a subnet, that I then want to convert over to a connected route off an interface via ifconfig

e.g. on vlan2 I want to add an interface on the subnet 12.0.0.112/28. Before the ifconfig I see

# route get 12.0.0.112/28
route to: 12.0.0.112
destination: 12.0.0.112
mask: 255.255.255.240
gateway: 192.168.1.1
interface: vlan1
flags: <UP,GATEWAY,DONE,PROTO1,PRCLONING>
recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire
0 0 0 0 0 0 1500 0




In the case of the 12.0.0.112/28 network I guess i need to get the kernel and zebra to know that its not
flags: <UP,GATEWAY,DONE,PROTO1,PRCLONING>
but
flags: <UP,DONE,CLONING>


and via vlan2

Short of killing the routing daemon, doing the ifconfig, is there another way to do this ?

What about some ifconfig hackery ? Is this not where it dies ?

        if (newaddr && (setaddr || setmask)) {
                strncpy(afp->af_addreq, name, sizeof ifr.ifr_name);
                if (ioctl(s, afp->af_aifaddr, afp->af_addreq) < 0)
                        Perror("ioctl (SIOCAIFADDR)");
        }


What if I added a check for a flag/param (e.g. -force)


        if (newaddr && (setaddr || setmask) && !FORCE ) {
                strncpy(afp->af_addreq, name, sizeof ifr.ifr_name);
                if (ioctl(s, afp->af_aifaddr, afp->af_addreq) < 0)
                        Perror("ioctl (SIOCAIFADDR)");
        }



Is there a better way to do it ?

        ---Mike
--------------------------------------------------------------------
Mike Tancsa,                                      tel +1 519 651 3400
Sentex Communications,                            [EMAIL PROTECTED]
Providing Internet since 1994                    www.sentex.net
Cambridge, Ontario Canada                         www.sentex.net/mike

_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to