diff options
author | Renato Westphal <renato@cvs.openbsd.org> | 2016-06-11 01:52:34 +0000 |
---|---|---|
committer | Renato Westphal <renato@cvs.openbsd.org> | 2016-06-11 01:52:34 +0000 |
commit | 7744abede631419e0d4fc57f9cd9b781723e3079 (patch) | |
tree | dc5ea9c0d23db3449b7ee1bc8f70dd153524ad65 /usr.sbin/ldpd/notification.c | |
parent | 51e57021c509724ee333855b78344a9ddcc9135e (diff) |
Make it possible to parse unknown TLVs in the future.
In the parsing of label and notification messages, we were always
unsetting the first bit of the TLV type before comparing it against the
types we know. We should not do this because our type constants can have
this bit set when appropriate.
By now the only unknown TLV supported by ldpd(8) is TLV_TYPE_DUALSTACK,
which is only used in Hello messages. But we might change this in the
future with support for MAC List TLVs and maybe RFC 7473.
Diffstat (limited to 'usr.sbin/ldpd/notification.c')
-rw-r--r-- | usr.sbin/ldpd/notification.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/ldpd/notification.c b/usr.sbin/ldpd/notification.c index d2eaff83194..87b2929b1f5 100644 --- a/usr.sbin/ldpd/notification.c +++ b/usr.sbin/ldpd/notification.c @@ -1,4 +1,4 @@ -/* $OpenBSD: notification.c,v 1.33 2016/06/11 01:46:36 renato Exp $ */ +/* $OpenBSD: notification.c,v 1.34 2016/06/11 01:52:33 renato Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -133,7 +133,7 @@ recv_notification(struct nbr *nbr, char *buf, uint16_t len) buf += TLV_HDR_LEN; len -= TLV_HDR_LEN; - switch (ntohs(tlv.type) & ~UNKNOWN_FLAG) { + switch (ntohs(tlv.type)) { case TLV_TYPE_EXTSTATUS: case TLV_TYPE_RETURNEDPDU: case TLV_TYPE_RETURNEDMSG: |