summaryrefslogtreecommitdiff
path: root/sys/net/rtsock.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2007-09-09 12:01:59 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2007-09-09 12:01:59 +0000
commit1d1dc042dbf29e6c033bd8b38bf65fe37f95b621 (patch)
treea7c773baf79b54b62cbcc5c55f8452ee8e85c931 /sys/net/rtsock.c
parent63ebb0bb225b6a1b478a8dc4ed48132be16a3413 (diff)
Only clear the message header if it is called from a sysctl walk. This
unbreaks RTM_GET. Problem reported by fkr@
Diffstat (limited to 'sys/net/rtsock.c')
-rw-r--r--sys/net/rtsock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index ae33fddc40c..76f246ee9d0 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtsock.c,v 1.66 2007/09/08 16:55:05 claudio Exp $ */
+/* $OpenBSD: rtsock.c,v 1.67 2007/09/09 12:01:58 claudio Exp $ */
/* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */
/*
@@ -691,7 +691,7 @@ again:
rw->w_where = 0;
}
}
- if (cp) /* clear the message header */
+ if (cp && w) /* clear the message header */
bzero(cp0, hlen);
if (cp && vers != RTM_OVERSION) {