summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ldpd/labelmapping.c
diff options
context:
space:
mode:
authorrenato <renato@openbsd.org>2016-05-23 16:04:04 +0000
committerrenato <renato@openbsd.org>2016-05-23 16:04:04 +0000
commit9277622bd580276fecb89cfff5029583d08af385 (patch)
tree8c47f3e7848a47e73af9c3a5e4d69111d8a2da44 /usr.sbin/ldpd/labelmapping.c
parentRespect the received Max PDU Length field. (diff)
downloadwireguard-openbsd-9277622bd580276fecb89cfff5029583d08af385.tar.xz
wireguard-openbsd-9277622bd580276fecb89cfff5029583d08af385.zip
Improve the parser of TCP/session packets.
Add more safeguards against malformed packets and fix existing ones. Also, rename a few variables and constants to match their real meaning. For example, rename gen_msg_tlv() to gen_msg_hdr() because this function generates an LDP header, not a TLV. Finally, clean-up all the send_* functions so they all follow the same pattern.
Diffstat (limited to 'usr.sbin/ldpd/labelmapping.c')
-rw-r--r--usr.sbin/ldpd/labelmapping.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/ldpd/labelmapping.c b/usr.sbin/ldpd/labelmapping.c
index 617e5f82ca8..9b24bdb7890 100644
--- a/usr.sbin/ldpd/labelmapping.c
+++ b/usr.sbin/ldpd/labelmapping.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: labelmapping.c,v 1.35 2016/05/23 15:14:07 renato Exp $ */
+/* $OpenBSD: labelmapping.c,v 1.36 2016/05/23 16:04:04 renato Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -389,7 +389,7 @@ recv_labelmessage(struct nbr *nbr, char *buf, u_int16_t len, u_int16_t type)
free(me);
}
- return (ntohs(lm.length));
+ return (0);
err:
mapping_list_clr(&mh);