summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichele Marchetto <michele@cvs.openbsd.org>2010-01-19 18:03:09 +0000
committerMichele Marchetto <michele@cvs.openbsd.org>2010-01-19 18:03:09 +0000
commit51c784659c6d39636e75fa282bd785f0b411007a (patch)
tree051a6c78ec93751a5d028af7d79c0137246477e4
parent8e6b029efc55b83bd72c8cc0ccf91ba90bbb9a81 (diff)
Don't fatalx() when a static route is deleted.
ok claudio@
-rw-r--r--usr.sbin/ldpd/lde_lib.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/usr.sbin/ldpd/lde_lib.c b/usr.sbin/ldpd/lde_lib.c
index a4274ca2d20..1f18dbb3a18 100644
--- a/usr.sbin/ldpd/lde_lib.c
+++ b/usr.sbin/ldpd/lde_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lde_lib.c,v 1.8 2010/01/08 16:45:51 michele Exp $ */
+/* $OpenBSD: lde_lib.c,v 1.9 2010/01/19 18:03:08 michele Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -300,15 +300,13 @@ lde_kernel_remove(struct kroute *kr)
rl->label = rn->remote_label;
ln = lde_find_address(rn->nexthop);
- if (ln == NULL)
- fatalx("lde_kernel_remove: unable to find neighbor");
-
- rl->nexthop = ln;
-
- TAILQ_INSERT_TAIL(&rn->labels_list, rl, entry);
+ if (ln != NULL) {
+ rl->nexthop = ln;
+ TAILQ_INSERT_TAIL(&rn->labels_list, rl, entry);
+ } else
+ free (rl);
}
- /* XXX */
rn->remote_label = 0;
rn->nexthop.s_addr = INADDR_ANY;
rn->present = 0;