X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/7fbec6b880d00f074fc056c3754a19a5a4c5b25c..a87d6a044893dace0534e91d77ce236a101d5794:/print-ip6.c diff --git a/print-ip6.c b/print-ip6.c index b6893cf3..9f8b4dbf 100644 --- a/print-ip6.c +++ b/print-ip6.c @@ -53,6 +53,7 @@ ip6_finddst(netdissect_options *ndo, struct in6_addr *dst, const void *dst_addr; const struct ip6_rthdr *dp; const struct ip6_rthdr0 *dp0; + const struct ip6_srh *srh; const u_char *p; int i, len; @@ -114,6 +115,19 @@ ip6_finddst(netdissect_options *ndo, struct in6_addr *dst, p += 16; } break; + case IPV6_RTHDR_TYPE_4: + /* IPv6 Segment Routing Header (SRH) */ + srh = (const struct ip6_srh *)dp; + if (len % 2 == 1) + goto trunc; + p = (const u_char *) srh->srh_segments; + /* + * The list of segments are encoded in the reverse order. + * Accordingly, the final DA is encoded in srh_segments[0] + */ + ND_TCHECK_16(p); + dst_addr = (const void *)p; + break; default: break;