1# test divert-reply with icmp and socket reuse
2
3use strict;
4use warnings;
5use Socket;
6
7our %args = (
8    socktype => Socket::SOCK_RAW,
9    protocol => sub { shift->{af} eq "inet" ? "icmp" : "icmp6" },
10    client => {
11	func => sub {
12	    my $self = shift;
13	    write_icmp_echo($self, $$);
14	    read_icmp_echo($self, "reply");
15	    write_icmp_echo($self, $$+1);
16	    read_icmp_echo($self, "reply");
17	},
18	out => "ICMP6?",
19	in => "ICMP6? reply",
20    },
21    # no server as our kernel does the icmp reply automatically
22    divert => "reply",
23);
24