RFC 4443 added two new codes for ICMPv6 destination unreachable messages (type 1):
5 - Source address failed ingress/egress policy 6 - Reject route to destination Before: $ sudo ./ping/ping6 2a03:4000:54:b9a::5 PING 2a03:4000:54:b9a::5 (2a03:4000:54:b9a::5): 56 data bytes 64 bytes from 2a03:4000:54:b9a::5: Destination unreachable: Unknown code 6 64 bytes from 2a03:4000:54:b9a::5: Destination unreachable: Unknown code 6 64 bytes from 2a03:4000:54:b9a::5: Destination unreachable: Unknown code 6 ^C--- 2a03:4000:54:b9a::5 ping statistics --- 3 packets transmitted, 0 packets received, 100% packet loss After: $ sudo ./ping/ping6 2a03:4000:54:b9a::5 PING 2a03:4000:54:b9a::5 (2a03:4000:54:b9a::5): 56 data bytes 64 bytes from 2a03:4000:54:b9a::5: Destination unreachable: Reject route to destination 64 bytes from 2a03:4000:54:b9a::5: Destination unreachable: Reject route to destination 64 bytes from 2a03:4000:54:b9a::5: Destination unreachable: Reject route to destination ^C--- 2a03:4000:54:b9a::5 ping statistics --- 3 packets transmitted, 0 packets received, 100% packet loss Signed-off-by: Enrik Berkhan <enrik.berk...@inka.de> --- ping/ping6.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ping/ping6.c b/ping/ping6.c index 91b60dd6..1e458507 100644 --- a/ping/ping6.c +++ b/ping/ping6.c @@ -55,6 +55,16 @@ #include "ping6.h" #include "libinetutils.h" +/* RFC 4443 addition not yet available in libc headers */ +#ifndef ICMP6_DST_UNREACH_POLICYFAIL +#define ICMP6_DST_UNREACH_POLICYFAIL 5 +#endif + +/* RFC 4443 addition not yet available in libc headers */ +#ifndef ICMP6_DST_UNREACH_REJECTROUTE +#define ICMP6_DST_UNREACH_REJECTROUTE 6 +#endif + static PING *ping; bool is_root = false; unsigned char *data_buffer; @@ -637,6 +647,8 @@ static struct icmp_code_descr icmp_dest_unreach_desc[] = { {ICMP6_DST_UNREACH_BEYONDSCOPE, "Beyond scope of source address"}, {ICMP6_DST_UNREACH_ADDR, "Address unreachable"}, {ICMP6_DST_UNREACH_NOPORT, "Port unreachable"}, + {ICMP6_DST_UNREACH_POLICYFAIL, "Source address failed ingress/egress policy"}, + {ICMP6_DST_UNREACH_REJECTROUTE, "Reject route to destination"}, }; static void -- 2.34.1