diff options
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ldpd/init.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/ldpd/init.c b/usr.sbin/ldpd/init.c index ddaadf14d60..d4b7433860c 100644 --- a/usr.sbin/ldpd/init.c +++ b/usr.sbin/ldpd/init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init.c,v 1.27 2016/05/23 19:11:42 renato Exp $ */ +/* $OpenBSD: init.c,v 1.28 2016/06/08 21:28:09 renato Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -70,16 +70,19 @@ recv_init(struct nbr *nbr, char *buf, uint16_t len) session_shutdown(nbr, S_KEEPALIVE_BAD, init.msgid, init.type); return (-1); } - if (ntohs(sess.length) != SESS_PRMS_SIZE - TLV_HDR_LEN) { session_shutdown(nbr, S_BAD_TLV_LEN, init.msgid, init.type); return (-1); } - if (ntohs(sess.proto_version) != LDP_VERSION) { session_shutdown(nbr, S_BAD_PROTO_VER, init.msgid, init.type); return (-1); } + if (sess.lsr_id != leconf->rtr_id.s_addr || + ntohs(sess.lspace_id) != 0) { + session_shutdown(nbr, S_NO_HELLO, init.msgid, init.type); + return (-1); + } buf += SESS_PRMS_SIZE; len -= SESS_PRMS_SIZE; |