Skip to content
Browse files

grab hlim from sysctl. sync w/ openbsd

  • Loading branch information...
1 parent 9e5c03c commit 900fd67946652213f2bc1a5c2f58b3adbeb88e2b itojun committed
Showing with 7 additions and 1 deletion.
  1. +7 −1 kame/kame/traceroute6/traceroute6.c
View
8 kame/kame/traceroute6/traceroute6.c
@@ -1,4 +1,4 @@
-/* $KAME: traceroute6.c,v 1.50 2002/05/26 13:12:07 itojun Exp $ */
+/* $KAME: traceroute6.c,v 1.51 2002/05/26 14:42:51 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -252,6 +252,7 @@ static char sccsid[] = "@(#)traceroute.c 8.1 (Berkeley) 6/6/93";
#include <sys/uio.h>
#include <sys/file.h>
#include <sys/ioctl.h>
+#include <sys/sysctl.h>
#include <netinet/in.h>
@@ -360,6 +361,8 @@ main(argc, argv)
static u_char *rcvcmsgbuf;
char hbuf[NI_MAXHOST], src0[NI_MAXHOST];
char *ep;
+ int mib[4] = { CTL_NET, PF_INET6, IPPROTO_IPV6, IPV6CTL_DEFHLIM };
+ size_t size = sizeof(max_hops);
/*
* Receive ICMP
@@ -373,6 +376,9 @@ main(argc, argv)
seteuid(getuid());
setuid(getuid());
+ (void) sysctl(mib, sizeof(mib)/sizeof(mib[0]), &max_hops, &size,
+ NULL, 0);
+
/* set a minimum set of socket options */
on = 1;
/* specify to tell receiving interface */

0 comments on commit 900fd67

Please sign in to comment.
Something went wrong with that request. Please try again.