Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/traceroute6 do not bark even if IPsec is turned off...
details: https://anonhg.NetBSD.org/src/rev/9fbe059a6198
branches: trunk
changeset: 475999:9fbe059a6198
user: itojun <itojun%NetBSD.org@localhost>
date: Fri Sep 03 01:49:16 1999 +0000
description:
do not bark even if IPsec is turned off in kernel.
diffstat:
usr.sbin/traceroute6/traceroute6.c | 22 ++++++++++++++--------
1 files changed, 14 insertions(+), 8 deletions(-)
diffs (54 lines):
diff -r 28868a60c492 -r 9fbe059a6198 usr.sbin/traceroute6/traceroute6.c
--- a/usr.sbin/traceroute6/traceroute6.c Fri Sep 03 00:24:56 1999 +0000
+++ b/usr.sbin/traceroute6/traceroute6.c Fri Sep 03 01:49:16 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: traceroute6.c,v 1.4 1999/07/30 01:19:58 itojun Exp $ */
+/* $NetBSD: traceroute6.c,v 1.5 1999/09/03 01:49:16 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -78,7 +78,7 @@
#else
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: traceroute6.c,v 1.4 1999/07/30 01:19:58 itojun Exp $");
+__RCSID("$NetBSD: traceroute6.c,v 1.5 1999/09/03 01:49:16 itojun Exp $");
#endif
#endif
@@ -529,11 +529,14 @@
{
int len;
char buf[16];
+
+ /*
+ * do not raise error even if setsockopt fails, kernel may have ipsec
+ * turned off.
+ */
if ((len = ipsec_set_policy(buf, sizeof(buf), "bypass")) < 0)
errx(1, ipsec_strerror());
- if (setsockopt(rcvsock, IPPROTO_IPV6, IPV6_IPSEC_POLICY,
- buf, len) < 0)
- err(1, "Unable to set IPSec policy");
+ (void)setsockopt(rcvsock, IPPROTO_IPV6, IPV6_IPSEC_POLICY, buf, len);
}
#else
{
@@ -588,11 +591,14 @@
{
int len;
char buf[16];
+
+ /*
+ * do not raise error even if setsockopt fails, kernel may have ipsec
+ * turned off.
+ */
if ((len = ipsec_set_policy(buf, sizeof(buf), "bypass")) < 0)
errx(1, ipsec_strerror());
- if (setsockopt(sndsock, IPPROTO_IPV6, IPV6_IPSEC_POLICY,
- buf, len) < 0)
- err(1, "Unable to set IPSec policy");
+ (void)setsockopt(sndsock, IPPROTO_IPV6, IPV6_IPSEC_POLICY, buf, len);
}
#else
{
Home |
Main Index |
Thread Index |
Old Index