mirror of https://github.com/M66B/NetGuard.git
Native recognize ICMPv6
This commit is contained in:
parent
8d9ecd010b
commit
ef0231f560
|
@ -128,7 +128,7 @@ public class LogAdapter extends CursorAdapter {
|
|||
// https://en.wikipedia.org/wiki/List_of_IP_protocol_numbers
|
||||
if (protocol == 0) // HOPOPT
|
||||
tvProtocol.setText("HOPO" + version);
|
||||
else if (protocol == 1) // ICMP
|
||||
else if (protocol == 1 || protocol == 58) // ICMPv4/v6
|
||||
tvProtocol.setText("ICMP" + version);
|
||||
else if (protocol == 6) // TCP
|
||||
tvProtocol.setText("TCP" + version);
|
||||
|
|
|
@ -898,7 +898,8 @@ void check_tcp_sockets(const struct arguments *args, fd_set *rfds, fd_set *wfds,
|
|||
}
|
||||
}
|
||||
|
||||
//https://en.wikipedia.org/wiki/IPv6_packet#Extension_headers
|
||||
// https://en.wikipedia.org/wiki/IPv6_packet#Extension_headers
|
||||
// http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml
|
||||
int is_lower_layer(int protocol) {
|
||||
// No next header = 59
|
||||
return (protocol == 0 || // Hop-by-Hop Options
|
||||
|
@ -912,7 +913,10 @@ int is_lower_layer(int protocol) {
|
|||
}
|
||||
|
||||
int is_upper_layer(int protocol) {
|
||||
return (protocol == IPPROTO_TCP || protocol == IPPROTO_UDP || protocol == IPPROTO_ICMP);
|
||||
return (protocol == IPPROTO_TCP ||
|
||||
protocol == IPPROTO_UDP ||
|
||||
protocol == IPPROTO_ICMP ||
|
||||
protocol == 58); // ICMP for IPv6
|
||||
}
|
||||
|
||||
void handle_ip(const struct arguments *args, const uint8_t *pkt, const size_t length) {
|
||||
|
|
Loading…
Reference in New Issue