diff options
author | 2005-07-07 19:29:24 +0000 | |
---|---|---|
committer | 2005-07-07 19:29:24 +0000 | |
commit | 0dfd169831d34fbfb0f788fa77c6073d27fec310 (patch) | |
tree | 54ba6f3ad1017998f1ae45fd6fcda8a3752afed8 /usr.sbin/sasyncd/monitor.c | |
parent | add a field to CVSFILE which holds the timestamp from the Entries file. (diff) | |
download | wireguard-openbsd-0dfd169831d34fbfb0f788fa77c6073d27fec310.tar.xz wireguard-openbsd-0dfd169831d34fbfb0f788fa77c6073d27fec310.zip |
when reading of sadb/spd data fails don't call
memset with a len of (unsigned)-1. ok ho@
Diffstat (limited to 'usr.sbin/sasyncd/monitor.c')
-rw-r--r-- | usr.sbin/sasyncd/monitor.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/sasyncd/monitor.c b/usr.sbin/sasyncd/monitor.c index 496f3b9668c..cc2ba5e5b89 100644 --- a/usr.sbin/sasyncd/monitor.c +++ b/usr.sbin/sasyncd/monitor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: monitor.c,v 1.4 2005/05/26 19:19:51 ho Exp $ */ +/* $OpenBSD: monitor.c,v 1.5 2005/07/07 19:29:24 moritz Exp $ */ /* * Copyright (c) 2005 Håkan Olsson. All rights reserved. @@ -175,11 +175,12 @@ int monitor_get_pfkey_snap(u_int8_t **sadb, u_int32_t *sadbsize, u_int8_t **spd, u_int32_t *spdsize) { - u_int32_t rbytes; - + u_int32_t v; + ssize_t rbytes; + /* We write a (any) value to the monitor socket to start a snapshot. */ - rbytes = 0; - if (write(m_state.s, &rbytes, sizeof rbytes) < 1) + v = 0; + if (write(m_state.s, &v, sizeof v) < 1) return -1; /* Read SADB data. */ |