summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRenato Westphal <renato@cvs.openbsd.org>2016-06-11 01:44:03 +0000
committerRenato Westphal <renato@cvs.openbsd.org>2016-06-11 01:44:03 +0000
commitf48cd372a68e15c468bd1a2a52d30c0a0407a024 (patch)
treedd1e1ef711e8d07cbfffb89898d55cb5c56ae70b
parentb72349420194a4b3613f6a9e83cced0b18771f2f (diff)
Fix parsing of multiple optional TLVs in label and notification messages.
We were accepting at most one optional TLV. Fixes IxANVL LDP test 15.3.
-rw-r--r--usr.sbin/ldpd/labelmapping.c7
-rw-r--r--usr.sbin/ldpd/notification.c7
2 files changed, 2 insertions, 12 deletions
diff --git a/usr.sbin/ldpd/labelmapping.c b/usr.sbin/ldpd/labelmapping.c
index fc1b998a223..1b7a1e1b645 100644
--- a/usr.sbin/ldpd/labelmapping.c
+++ b/usr.sbin/ldpd/labelmapping.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: labelmapping.c,v 1.46 2016/05/23 19:14:03 renato Exp $ */
+/* $OpenBSD: labelmapping.c,v 1.47 2016/06/11 01:44:02 renato Exp $ */
/*
* Copyright (c) 2014, 2015 Renato Westphal <renato@openbsd.org>
@@ -241,11 +241,6 @@ recv_labelmessage(struct nbr *nbr, char *buf, uint16_t len, uint16_t type)
}
memcpy(&tlv, buf, sizeof(tlv));
- if (ntohs(tlv.length) != len - TLV_HDR_LEN) {
- session_shutdown(nbr, S_BAD_TLV_LEN, lm.msgid,
- lm.type);
- goto err;
- }
buf += TLV_HDR_LEN;
len -= TLV_HDR_LEN;
diff --git a/usr.sbin/ldpd/notification.c b/usr.sbin/ldpd/notification.c
index 7e823557285..538ca41636b 100644
--- a/usr.sbin/ldpd/notification.c
+++ b/usr.sbin/ldpd/notification.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: notification.c,v 1.31 2016/06/08 22:00:12 renato Exp $ */
+/* $OpenBSD: notification.c,v 1.32 2016/06/11 01:44:02 renato Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -130,11 +130,6 @@ recv_notification(struct nbr *nbr, char *buf, uint16_t len)
}
memcpy(&tlv, buf, sizeof(tlv));
- if (ntohs(tlv.length) > len - TLV_HDR_LEN) {
- session_shutdown(nbr, S_BAD_TLV_LEN, not.msgid,
- not.type);
- return (-1);
- }
buf += TLV_HDR_LEN;
len -= TLV_HDR_LEN;