diff options
Diffstat (limited to 'usr.sbin/ldpd/keepalive.c')
-rw-r--r-- | usr.sbin/ldpd/keepalive.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/usr.sbin/ldpd/keepalive.c b/usr.sbin/ldpd/keepalive.c index 2d231a71d21..65a0e224448 100644 --- a/usr.sbin/ldpd/keepalive.c +++ b/usr.sbin/ldpd/keepalive.c @@ -1,4 +1,4 @@ -/* $OpenBSD: keepalive.c,v 1.14 2016/05/23 16:04:04 renato Exp $ */ +/* $OpenBSD: keepalive.c,v 1.15 2016/05/23 17:43:42 renato Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -40,7 +40,7 @@ void send_keepalive(struct nbr *nbr) { struct ibuf *buf; - u_int16_t size; + uint16_t size; size = LDP_HDR_SIZE + LDP_MSG_SIZE; if ((buf = ibuf_open(size)) == NULL) @@ -54,13 +54,12 @@ send_keepalive(struct nbr *nbr) } int -recv_keepalive(struct nbr *nbr, char *buf, u_int16_t len) +recv_keepalive(struct nbr *nbr, char *buf, uint16_t len) { struct ldp_msg ka; - bcopy(buf, &ka, sizeof(ka)); - - if (len != LDP_MSG_LEN) { + memcpy(&ka, buf, sizeof(ka)); + if (len != LDP_MSG_SIZE) { session_shutdown(nbr, S_BAD_MSG_LEN, ka.msgid, ka.type); return (-1); } |