summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2006-05-27 18:20:59 +0000
committerclaudio <claudio@openbsd.org>2006-05-27 18:20:59 +0000
commit26320e18f97e625ac2aab960a510bc0539733ed4 (patch)
tree82e2d3c5f45dff2ffa8f15a0502791ea2183bbe4
parentlets be nice and abort cvs when we find out there is (diff)
downloadwireguard-openbsd-26320e18f97e625ac2aab960a510bc0539733ed4.tar.xz
wireguard-openbsd-26320e18f97e625ac2aab960a510bc0539733ed4.zip
Do not print an error in case of ENOPROTOOPT. Install medias do not have
IPSec support and so will print a "route: spd-sysctl-estimate: Protocol not available" on upgrades. Requested and ok deraadt@
-rw-r--r--sbin/route/show.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sbin/route/show.c b/sbin/route/show.c
index a79650d4850..7063d31ba4f 100644
--- a/sbin/route/show.c
+++ b/sbin/route/show.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: show.c,v 1.50 2006/03/31 15:56:25 hshoexer Exp $ */
+/* $OpenBSD: show.c,v 1.51 2006/05/27 18:20:59 claudio Exp $ */
/* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */
/*
@@ -48,6 +48,7 @@
#include <arpa/inet.h>
#include <err.h>
+#include <errno.h>
#include <netdb.h>
#include <stdio.h>
#include <stddef.h>
@@ -165,8 +166,11 @@ p_rttables(int af, int Aflag)
mib[3] = NET_KEY_SPD_DUMP;
mib[4] = mib[5] = 0;
- if (sysctl(mib, 4, NULL, &needed, NULL, 0) == -1)
+ if (sysctl(mib, 4, NULL, &needed, NULL, 0) == -1) {
+ if (errno == ENOPROTOOPT)
+ return;
err(1, "spd-sysctl-estimate");
+ }
if (needed > 0) {
if ((buf = malloc(needed)) == 0)
err(1, NULL);