summaryrefslogtreecommitdiff
path: root/usr.sbin/ldpd/kroute.c
diff options
context:
space:
mode:
authorMichele Marchetto <michele@cvs.openbsd.org>2009-09-28 09:48:47 +0000
committerMichele Marchetto <michele@cvs.openbsd.org>2009-09-28 09:48:47 +0000
commitc78baa5089cacd1d34ee1a8f76a8224c59c2aa6c (patch)
tree22584262af86344cadb050ee52d5d79aab032af6 /usr.sbin/ldpd/kroute.c
parentdd3b5c104c98aeb98ed009a467cbc53745b7ecbe (diff)
When a route is deleted, ldpd should remove labels associated with it from
lfib (the kernel lib) but not from the lib. These could be used later on when the route come back. ok claudio@
Diffstat (limited to 'usr.sbin/ldpd/kroute.c')
-rw-r--r--usr.sbin/ldpd/kroute.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/usr.sbin/ldpd/kroute.c b/usr.sbin/ldpd/kroute.c
index 0e8b50be5f1..2c20f48e54e 100644
--- a/usr.sbin/ldpd/kroute.c
+++ b/usr.sbin/ldpd/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.4 2009/08/06 09:07:49 michele Exp $ */
+/* $OpenBSD: kroute.c,v 1.5 2009/09/28 09:48:46 michele Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -412,7 +412,7 @@ kr_redist_remove(struct kroute_node *kn)
rr.kr = kn->r;
if (kn == NULL) {
- main_imsg_compose_lde(IMSG_NETWORK_DEL, 0, &rr,
+ main_imsg_compose_lde(IMSG_NETWORK_DEL, 0, &rr.kr,
sizeof(struct rroute));
}
}
@@ -484,7 +484,7 @@ kr_redistribute(struct kroute_node *kh)
sizeof(struct rroute));
} else {
rr.kr = kh->r;
- main_imsg_compose_lde(IMSG_NETWORK_DEL, 0, &rr,
+ main_imsg_compose_lde(IMSG_NETWORK_DEL, 0, &rr.kr,
sizeof(struct rroute));
}
}
@@ -1530,14 +1530,15 @@ dispatch_rtmsg(void)
continue;
if (!(kr->r.flags & F_KERNEL))
continue;
- /*
- * last route is getting removed request the
- * ldp route from the RDE to insert instead
- */
+
if (kr->r.flags & F_LDPD_INSERTED) {
- main_imsg_compose_lde(IMSG_KROUTE_GET, 0,
+ main_imsg_compose_lde(IMSG_NETWORK_DEL, 0,
&kr->r, sizeof(struct kroute));
+
+ send_rtlabelmsg(kr_state.fd, RTM_DELETE,
+ &kr->r, AF_MPLS);
}
+
if (kroute_remove(kr) == -1)
return (-1);
break;