diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-07-08 09:41:06 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-07-08 09:41:06 +0000 |
commit | 8a82fbde58252dc64049c506b6f5a3687a336ead (patch) | |
tree | a63ef14949298dd589520c86287202992a7451ed /usr.sbin/ldpd/ldpe.c | |
parent | 0bbf0b9ab20aa08e746f9d871ea9c940929613bb (diff) |
Kill more code in kroute.c that is unneeded in ldpd. ldpd is a bit strange
since it does not care that much about reachability of routes. The idea is
to have diverse LSP in the kernel and the kernel should then decide which
path should be used.
OK michele@
Diffstat (limited to 'usr.sbin/ldpd/ldpe.c')
-rw-r--r-- | usr.sbin/ldpd/ldpe.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/usr.sbin/ldpd/ldpe.c b/usr.sbin/ldpd/ldpe.c index 14a410f38c2..a2b802a0a5b 100644 --- a/usr.sbin/ldpd/ldpe.c +++ b/usr.sbin/ldpd/ldpe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldpe.c,v 1.10 2010/05/26 13:56:07 nicm Exp $ */ +/* $OpenBSD: ldpe.c,v 1.11 2010/07/08 09:41:05 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -282,7 +282,7 @@ ldpe_dispatch_main(int fd, short event, void *bula) struct imsgbuf *ibuf = &iev->ibuf; struct iface *iface = NULL; struct kif *kif; - int n, link_ok, shut = 0; + int n, link_new, link_old, shut = 0; if (event & EV_READ) { if ((n = imsg_read(ibuf)) == -1) @@ -307,17 +307,24 @@ ldpe_dispatch_main(int fd, short event, void *bula) sizeof(struct kif)) fatalx("IFINFO imsg with wrong len"); kif = imsg.data; - link_ok = (kif->flags & IFF_UP) && + link_new = (kif->flags & IFF_UP) && (LINK_STATE_IS_UP(kif->link_state) || (kif->link_state == LINK_STATE_UNKNOWN && kif->media_type != IFT_CARP)); LIST_FOREACH(iface, &leconf->iface_list, entry) { if (kif->ifindex == iface->ifindex) { + link_old = (iface->flags & IFF_UP) && + (LINK_STATE_IS_UP(iface->linkstate) + || (iface->linkstate == + LINK_STATE_UNKNOWN && + iface->media_type != IFT_CARP)); iface->flags = kif->flags; iface->linkstate = kif->link_state; - if (link_ok) { + if (link_new == link_old) + continue; + if (link_new) { if_fsm(iface, IF_EVT_UP); log_warnx("interface %s up", iface->name); |