diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2016-09-17 09:24:52 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2016-09-17 09:24:52 +0000 |
commit | 484aba8c906e47b5f079e888efe7fdb8fc33d397 (patch) | |
tree | e940c414033d09ca3ba7081987987bb7a1a90b91 /sbin | |
parent | 53e584491cc4782971871f566b36357f86ee3ca4 (diff) |
Merge socket options that are set only when -v is given.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ping6/ping6.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c index 22dc19f15ef..1387fe0b08e 100644 --- a/sbin/ping6/ping6.c +++ b/sbin/ping6/ping6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ping6.c,v 1.205 2016/09/17 09:23:42 florian Exp $ */ +/* $OpenBSD: ping6.c,v 1.206 2016/09/17 09:24:51 florian Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -501,6 +501,9 @@ main(int argc, char *argv[]) if (setsockopt(s, IPPROTO_IPV6, IPV6_RECVDSTOPTS, &opton, (socklen_t)sizeof(opton))) err(1, "setsockopt(IPV6_RECVDSTOPTS)"); + if (setsockopt(s, IPPROTO_IPV6, IPV6_RECVRTHDR, &opton, + sizeof(opton))) + err(1, "setsockopt(IPV6_RECVRTHDR)"); } if ((moptions & MULTICAST_NOLOOP) && @@ -538,15 +541,6 @@ main(int argc, char *argv[]) (socklen_t)sizeof(filt)) < 0) err(1, "setsockopt(ICMP6_FILTER)"); - /* let the kernel pass extension headers of incoming packets */ - if ((options & F_VERBOSE) != 0) { - int opton = 1; - - if (setsockopt(s, IPPROTO_IPV6, IPV6_RECVRTHDR, &opton, - sizeof(opton))) - err(1, "setsockopt(IPV6_RECVRTHDR)"); - } - if (hoplimit != -1) { /* set IP6 packet options */ if ((scmsg = malloc( CMSG_SPACE(sizeof(int)))) == NULL) |