summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ldpd/keepalive.c
diff options
context:
space:
mode:
authorrenato <renato@openbsd.org>2016-05-23 17:43:42 +0000
committerrenato <renato@openbsd.org>2016-05-23 17:43:42 +0000
commit3de9450904eb5b45f02b994078ffae323a1310b9 (patch)
tree6e3fb9c77ab3b84d9ead9178a6d6020d0b6e0776 /usr.sbin/ldpd/keepalive.c
parentMove setsockopt helper functions to a separate file. (diff)
downloadwireguard-openbsd-3de9450904eb5b45f02b994078ffae323a1310b9.tar.xz
wireguard-openbsd-3de9450904eb5b45f02b994078ffae323a1310b9.zip
Fix mess caused by my commit script.
I screwed up everything... trying to fix now.
Diffstat (limited to 'usr.sbin/ldpd/keepalive.c')
-rw-r--r--usr.sbin/ldpd/keepalive.c11
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);
}