diff options
author | 2016-05-23 18:51:52 +0000 | |
---|---|---|
committer | 2016-05-23 18:51:52 +0000 | |
commit | 998f69edcb0004be46f93d48a6d6b93b77466990 (patch) | |
tree | c4b95851332f3b138901bbd6ad4e3bf9313a30e8 /usr.sbin/ldpd/labelmapping.c | |
parent | Start sentences on new lines in ldpd.conf(5). (diff) | |
download | wireguard-openbsd-998f69edcb0004be46f93d48a6d6b93b77466990.tar.xz wireguard-openbsd-998f69edcb0004be46f93d48a6d6b93b77466990.zip |
Reject null labels for PW-ID FECs.
Diffstat (limited to 'usr.sbin/ldpd/labelmapping.c')
-rw-r--r-- | usr.sbin/ldpd/labelmapping.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/usr.sbin/ldpd/labelmapping.c b/usr.sbin/ldpd/labelmapping.c index 57bcd288945..6706b4f4c0b 100644 --- a/usr.sbin/ldpd/labelmapping.c +++ b/usr.sbin/ldpd/labelmapping.c @@ -1,4 +1,4 @@ -/* $OpenBSD: labelmapping.c,v 1.41 2016/05/23 17:43:42 renato Exp $ */ +/* $OpenBSD: labelmapping.c,v 1.42 2016/05/23 18:51:52 renato Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -350,11 +350,18 @@ recv_labelmessage(struct nbr *nbr, char *buf, uint16_t len, uint16_t type) int imsg_type = IMSG_NONE; me->map.flags |= flags; + if (me->map.type == MAP_TYPE_PWID) { + if (label <= MPLS_LABEL_RESERVED_MAX) { + session_shutdown(nbr, S_BAD_TLV_VAL, lm.msgid, + lm.type); + goto err; + } + if (me->map.flags & F_MAP_PW_STATUS) + me->map.pw_status = pw_status; + } me->map.label = label; if (me->map.flags & F_MAP_REQ_ID) me->map.requestid = reqid; - if (me->map.flags & F_MAP_PW_STATUS) - me->map.pw_status = pw_status; switch (type) { case MSG_TYPE_LABELMAPPING: |