On Wed, Nov 03, 2010, Mahlon E. Smith wrote: > [...] > > Is there an alternative way to accomplish what I'm after with bird? Any > chance an option to the 'device' protocol to take link state into > consideration when determining availability is on the roadmap?
Looks like the attached patch (against 1.2.4) does the trick. Obviously, this'll only work on *bsd systems, I'll leave other OSs to those more experienced than I. :) -- Mahlon E. Smith http://www.martini.nu/contact.html
hotsoup-fbsd# diff -ruN bird-1.2.4 bird-1.2.4-mod diff -ruN bird-1.2.4/sysdep/bsd/krt-sock.c bird-1.2.4-mod/sysdep/bsd/krt-sock.c --- bird-1.2.4/sysdep/bsd/krt-sock.c 2010-08-03 15:44:51.000000000 +0000 +++ bird-1.2.4-mod/sysdep/bsd/krt-sock.c 2010-11-03 15:02:15.000000000 +0000 @@ -461,7 +461,7 @@ f.mtu = ifm->ifm_data.ifi_mtu; f.flags = 0; - if (fl & IFF_UP) + if ((fl & IFF_UP) && (ifm->ifm_data.ifi_link_state == LINK_STATE_UP)) f.flags |= IF_LINK_UP; if (fl & IFF_LOOPBACK) /* Loopback */ f.flags |= IF_MULTIACCESS | IF_LOOPBACK | IF_IGNORE;
pgpk4eKYV8uT2.pgp
Description: PGP signature