diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2006-05-27 18:21:00 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2006-05-27 18:21:00 +0000 |
commit | 70afaa5e04789d762c8607cc30bd3a790e0be217 (patch) | |
tree | ecf3cd07af777bba940ce10e2183c9852efda32b /sbin | |
parent | 94f6d0490363df1900a6994c25f0634dcb3884d1 (diff) |
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@
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/route/show.c | 8 |
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); |