aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/traceroute6
diff options
context:
space:
mode:
authorYoshinobu Inoue <shin@FreeBSD.org>2000-02-24 19:06:05 +0000
committerYoshinobu Inoue <shin@FreeBSD.org>2000-02-24 19:06:05 +0000
commit53c9088f688ee6fee2a93029f8eb2612d7afd01c (patch)
tree4f2070445af713d1e5a582adfc84126342f7abf9 /usr.sbin/traceroute6
parent88a845c11d2f2056fe0249f52144e77e1dcdf41a (diff)
downloadsrc-53c9088f688ee6fee2a93029f8eb2612d7afd01c.tar.gz
src-53c9088f688ee6fee2a93029f8eb2612d7afd01c.zip
Notes
Diffstat (limited to 'usr.sbin/traceroute6')
-rw-r--r--usr.sbin/traceroute6/traceroute6.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/usr.sbin/traceroute6/traceroute6.c b/usr.sbin/traceroute6/traceroute6.c
index b006ac2b67fc..65f80e70626d 100644
--- a/usr.sbin/traceroute6/traceroute6.c
+++ b/usr.sbin/traceroute6/traceroute6.c
@@ -365,6 +365,15 @@ main(argc, argv)
static u_char rcvcmsgbuf[CMSG_SPACE(sizeof(struct in6_pktinfo))
+ CMSG_SPACE(sizeof(int))];
+ /*
+ * Receive ICMP
+ */
+ if ((rcvsock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6)) < 0) {
+ perror("traceroute6: icmp socket");
+ exit(5);
+ }
+ setuid(getuid());
+
on = 1;
seq = 0;
@@ -482,13 +491,6 @@ main(argc, argv)
}
(void) bzero((char *)outpacket, datalen);
- /*
- * Receive ICMP
- */
- if ((rcvsock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6)) < 0) {
- perror("traceroute6: icmp socket");
- exit(5);
- }
/* initialize msghdr for receiving packets */
rcviov[0].iov_base = (caddr_t)packet;
rcviov[0].iov_len = sizeof(packet);