Skip to content

Commit f80a69b

Browse files
committed
Skip ipv6 mobility header
1 parent 52a7f2b commit f80a69b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

input/parser.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,13 @@ uint16_t skip_ipv6_ext_hdrs(const u_char *data_ptr, uint16_t data_len, Packet *p
307307
hdrs_len += (ext->ip6e_len << 2) - 2;
308308
} else if (next_hdr == IPPROTO_FRAGMENT) {
309309
hdrs_len += 8;
310+
} else if (next_hdr == IPPROTO_MH) {
311+
hdrs_len += (ext->ip6e_len << 3) + 8;
312+
// Mobility header can't have payload now but may have it in the future
313+
if (ext->ip6e_nxt == IPPROTO_NONE) {
314+
pkt->ip_proto = ext->ip6e_nxt;
315+
break;
316+
}
310317
} else {
311318
break;
312319
}
@@ -386,7 +393,7 @@ inline uint16_t parse_tcp_hdr(const u_char *data_ptr, uint16_t data_len, Packet
386393
pkt->src_port = ntohs(tcp->source);
387394
pkt->dst_port = ntohs(tcp->dest);
388395
pkt->tcp_seq = ntohl(tcp->seq);
389-
pkt->tcp_ack = ntohl(tcp->ack_seq);
396+
pkt->tcp_ack = ntohl(tcp->ack_seq);
390397
pkt->tcp_flags = (uint8_t) *(data_ptr + 13) & 0xFF;
391398
pkt->tcp_window = ntohs(tcp->window);
392399

0 commit comments

Comments
 (0)