+ // TODO: Handle more options?
+
+ const struct icmp6hdr *icmpv6 = NULL;
+ if (frag6 == NULL || (frag6->frag_off & BE16(IP6_FRAGOFF)) == 0) {
+ if (v6nexthdr == IP_PROTO_TCP) {
+ CHECK_LEN(l4hdr, tcphdr);
+ tcp = (struct tcphdr*) l4hdr;
+ sport = BE16(tcp->source);
+ dport = BE16(tcp->dest);
+ ports_valid = 1;
+ } else if (v6nexthdr == IP_PROTO_UDP) {
+ CHECK_LEN(l4hdr, udphdr);
+ const struct udphdr *udp = (struct udphdr*) l4hdr;
+ sport = BE16(udp->source);
+ dport = BE16(udp->dest);
+ ports_valid = 1;
+ } else if (v6nexthdr == IP6_PROTO_ICMPV6) {
+ CHECK_LEN(l4hdr, icmp6hdr);
+ icmpv6 = (struct icmp6hdr*) l4hdr;
+ }
+ }