summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/ldpd/kroute.c18
-rw-r--r--usr.sbin/ldpd/lde_lib.c4
2 files changed, 15 insertions, 7 deletions
diff --git a/usr.sbin/ldpd/kroute.c b/usr.sbin/ldpd/kroute.c
index 37cbe5d3003..a9e1bbc031e 100644
--- a/usr.sbin/ldpd/kroute.c
+++ b/usr.sbin/ldpd/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.9 2010/03/25 12:05:18 claudio Exp $ */
+/* $OpenBSD: kroute.c,v 1.10 2010/04/13 15:39:29 michele Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -1118,10 +1118,18 @@ send_rtmsg(int fd, int action, struct kroute *kroute, u_int32_t family)
iov[iovcnt].iov_base = &label_out;
iov[iovcnt++].iov_len = sizeof(label_out);
- if (family == AF_MPLS)
- hdr.rtm_mpls = MPLS_OP_SWAP;
- else
- hdr.rtm_mpls = MPLS_OP_PUSH;
+ if (ntohl(kroute->remote_label) >> MPLS_LABEL_OFFSET ==
+ MPLS_LABEL_IMPLNULL) {
+ if (family == AF_MPLS)
+ hdr.rtm_mpls = MPLS_OP_POP;
+ else
+ return (0);
+ } else {
+ if (family == AF_MPLS)
+ hdr.rtm_mpls = MPLS_OP_SWAP;
+ else
+ hdr.rtm_mpls = MPLS_OP_PUSH;
+ }
}
diff --git a/usr.sbin/ldpd/lde_lib.c b/usr.sbin/ldpd/lde_lib.c
index fdbb4c8e6dd..a67b681ce27 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.14 2010/03/03 10:17:05 claudio Exp $ */
+/* $OpenBSD: lde_lib.c,v 1.15 2010/04/13 15:39:29 michele Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -118,7 +118,7 @@ rt_dump(pid_t pid)
rtctl.local_label = r->local_label;
rtctl.remote_label = r->remote_label;
- if (!r->present || r->remote_label == NO_LABEL)
+ if (!r->present)
rtctl.in_use = 0;
else
rtctl.in_use = 1;