Skip to content

Commit

Permalink
grab hlim from sysctl. sync w/ openbsd
Browse files Browse the repository at this point in the history
  • Loading branch information
itojun committed May 26, 2002
1 parent 9e5c03c commit 900fd67
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion 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.
Expand Down Expand Up @@ -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>

Expand Down Expand Up @@ -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
Expand All @@ -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 */
Expand Down

0 comments on commit 900fd67

Please sign in to comment.