summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/ldpd/hello.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/ldpd/hello.c b/usr.sbin/ldpd/hello.c
index 721fd0ddf4e..1e16691de2e 100644
--- a/usr.sbin/ldpd/hello.c
+++ b/usr.sbin/ldpd/hello.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hello.c,v 1.43 2016/05/23 19:14:03 renato Exp $ */
+/* $OpenBSD: hello.c,v 1.44 2016/06/08 23:14:03 renato Exp $ */
/*
* Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org>
@@ -478,7 +478,9 @@ tlv_decode_opt_hello_prms(char *buf, uint16_t len, int *tlvs_rcvd, int af,
case TLV_TYPE_IPV4TRANSADDR:
if (tlv_len != sizeof(addr->v4))
return (-1);
- if (af != AF_INET || ldp_addrisset(AF_INET, addr))
+ if (af != AF_INET)
+ return (-1);
+ if (*tlvs_rcvd & F_HELLO_TLV_RCVD_ADDR)
break;
memcpy(&addr->v4, buf + TLV_HDR_LEN, sizeof(addr->v4));
*tlvs_rcvd |= F_HELLO_TLV_RCVD_ADDR;
@@ -486,7 +488,9 @@ tlv_decode_opt_hello_prms(char *buf, uint16_t len, int *tlvs_rcvd, int af,
case TLV_TYPE_IPV6TRANSADDR:
if (tlv_len != sizeof(addr->v6))
return (-1);
- if (af != AF_INET6 || ldp_addrisset(AF_INET6, addr))
+ if (af != AF_INET6)
+ return (-1);
+ if (*tlvs_rcvd & F_HELLO_TLV_RCVD_ADDR)
break;
memcpy(&addr->v6, buf + TLV_HDR_LEN, sizeof(addr->v6));
*tlvs_rcvd |= F_HELLO_TLV_RCVD_ADDR;