diff options
author | 2016-06-11 01:52:33 +0000 | |
---|---|---|
committer | 2016-06-11 01:52:33 +0000 | |
commit | b502a0afcb5e5368db84b2cfe330aa5a92169f90 (patch) | |
tree | f15e52409a7fc0ee679cbde29516acd962ba3118 /usr.sbin/ldpd/labelmapping.c | |
parent | Use uint16_t for notification type. (diff) | |
download | wireguard-openbsd-b502a0afcb5e5368db84b2cfe330aa5a92169f90.tar.xz wireguard-openbsd-b502a0afcb5e5368db84b2cfe330aa5a92169f90.zip |
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/labelmapping.c')
-rw-r--r-- | usr.sbin/ldpd/labelmapping.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/ldpd/labelmapping.c b/usr.sbin/ldpd/labelmapping.c index 1b7a1e1b645..3aa63d7fd25 100644 --- a/usr.sbin/ldpd/labelmapping.c +++ b/usr.sbin/ldpd/labelmapping.c @@ -1,4 +1,4 @@ -/* $OpenBSD: labelmapping.c,v 1.47 2016/06/11 01:44:02 renato Exp $ */ +/* $OpenBSD: labelmapping.c,v 1.48 2016/06/11 01:52:33 renato Exp $ */ /* * Copyright (c) 2014, 2015 Renato Westphal <renato@openbsd.org> @@ -244,7 +244,7 @@ recv_labelmessage(struct nbr *nbr, char *buf, uint16_t len, uint16_t type) buf += TLV_HDR_LEN; len -= TLV_HDR_LEN; - switch (ntohs(tlv.type) & ~UNKNOWN_FLAG) { + switch (ntohs(tlv.type)) { case TLV_TYPE_LABELREQUEST: switch (type) { case MSG_TYPE_LABELMAPPING: |