Squashed commit of the following:
commit
0e87af6c8591908e68e8e3b60f98ff593566ef96
Author: Kaushal Bhandankar <kbhandan@cisco.com>
Date: Tue Mar 2 11:35:49 2021 -0500
packet_tracer: Do not log non-IP packets when enabled from shell and when a constraint is set
return false;
if ( !p.has_ip() )
- return false;
+ {
+ if ( set_bits & (SetBits::IP_PROTO|SetBits::SRC_PORT|SetBits::DST_PORT|SetBits::SRC_IP|SetBits::DST_IP) )
+ return false;
+ else
+ return true;
+ }
if ( (set_bits & SetBits::IP_PROTO) and (p.get_ip_proto_next() != ip_proto) )
return false;
if (s_pkt_trace->user_enabled or s_pkt_trace->shell_enabled)
{
+ if (s_pkt_trace->shell_enabled and
+ !s_pkt_trace->constraints.packet_match(p))
+ {
+ s_pkt_trace->active = false;
+ return;
+ }
+
if (!p.ptrs.ip_api.is_ip())
{
s_pkt_trace->add_eth_header_info(p);
}
else
{
- if (s_pkt_trace->shell_enabled and
- !s_pkt_trace->constraints.packet_match(p))
- {
- s_pkt_trace->active = false;
- return;
- }
s_pkt_trace->active = true;
s_pkt_trace->add_ip_header_info(p);
}