5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
24 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
25 # Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
30 # Test ip:::{send,receive} of IPv6 ICMP to a local address. This creates a
31 # temporary lo0/inet6 interface if one doesn't already exist.
33 # This may fail due to:
35 # 1. A change to the ip stack breaking expected probe behavior,
36 # which is the reason we are testing.
37 # 2. Unrelated ICMPv6 on lo0 traced by accident.
40 if (( $# != 1 )); then
41 print
-u2 "expected one argument: <dtrace-path>"
48 if ! ifconfig lo0 inet6
> /dev
/null
2>&1; then
49 if ! ifconfig lo0 inet6 plumb up
; then
50 print
-u2 "could not plumb lo0 inet6 for testing"
58 $dtrace -c "/usr/sbin/ping -A inet6 $local 3" -qs /dev
/stdin
<<EOF | sort -n
60 /args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
61 args[5]->ipv6_nexthdr == IPPROTO_ICMPV6/
63 printf("1 ip:::send (");
64 printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength);
65 printf("args[5]: %d %d %d)\n",
66 args[5]->ipv6_ver, args[5]->ipv6_tclass, args[5]->ipv6_plen);
70 /args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
71 args[5]->ipv6_nexthdr == IPPROTO_ICMPV6/
73 printf("2 ip:::receive (");
74 printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength);
75 printf("args[5]: %d %d %d)\n",
76 args[5]->ipv6_ver, args[5]->ipv6_tclass, args[5]->ipv6_plen);
80 if (( removeinet6
)); then
81 ifconfig lo0 inet6 unplumb