PPP: filter more packets in ppp_dump_packet

VJ packets, Compressed packets, IPv4 and IPv6 packets are useless in
the PPP packet dump. We properly filtered IPv4 and IPv6 packets but
we forgot filtering VJ and Compressed packets.

Improve the filtering rule to filter packets which are not auth
protocol (< 0xC000) and which are not control protocol (0x8000 bit
not set).
This commit is contained in:
Sylvain Rochet 2016-08-10 23:33:16 +02:00
parent 18fcc1d504
commit 3194c9c4cf

View File

@ -706,15 +706,11 @@ void ppp_dump_packet(const char *tag, unsigned char *p, int len) {
int proto;
/*
* don't print IPv4 and IPv6 packets.
* don't print data packets, i.e. IPv4, IPv6, VJ, and compressed packets.
*/
proto = (p[0] << 8) + p[1];
if (proto == PPP_IP)
if (proto < 0xC000 && (proto & ~0x8000) == proto)
return;
#if PPP_IPV6_SUPPORT
if (proto == PPP_IPV6)
return;
#endif
/*
* don't print LCP echo request/reply packets if the link is up.