Squashed commit of the following:
commit
5847f19f97b1ffbc82f969af25f09402a723fba6
Author: Masud Hasan <mashasan@cisco.com>
Date: Mon May 11 19:42:35 2020 -0400
main: Fixing some issues reported by Coverity
}
else if (p->active->is_packet_held() and Stream::set_packet_action_to_hold(p))
{
- if (p->flow and p->flow->flags.trigger_detained_packet_event)
+ if (p->flow->flags.trigger_detained_packet_event)
DataBus::publish(DETAINED_PACKET_EVENT, p);
}
else
// FIXIT-M want to disable time wait
int on = 1;
- setsockopt(listener, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
+ if (setsockopt(listener, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) < 0)
+ FatalError("setsockopt() call failed: %s", get_error(errno));
if (::bind(listener, sock_addr, sock_addr_size) < 0)
FatalError("bind failed: %s\n", get_error(errno));
"all | ip | noip | tcp | notcp | udp | noudp | icmp | noicmp | none", "all",
"checksums to verify" },
- { "decode_drops", Parameter::PT_BOOL, nullptr, "false",
- "enable dropping of packets by the decoder" },
-
{ "id", Parameter::PT_INT, "0:65535", "0",
"correlate unified2 events with configuration" },
else if ( v.is("checksum_eval") )
ConfigChecksumMode(v.get_string());
- else if ( v.is("decode_drops") )
- p->decoder_drop = v.get_bool();
-
else if ( v.is("id") )
{
p->user_policy_id = v.get_uint16();
{
framework_policy = nullptr;
cloned = false;
+ if (other_inspection_policy)
+ policy_id = other_inspection_policy->policy_id;
InspectorManager::new_policy(this, other_inspection_policy);
}
uint32_t checksum_eval;
uint32_t checksum_drop;
uint32_t normal_mask;
-
- bool decoder_drop;
};
//-------------------------------------------------------------------------
void clone_dbus(snort::SnortConfig*, const char*);
public:
- PolicyId policy_id;
+ PolicyId policy_id = 0;
PolicyMode policy_mode = POLICY_MODE__MAX;
uint32_t user_policy_id = 0;
uuid_t uuid{};
if (p->is_ip6() && (net_frag_offset == 0))
{
const ip::IP6Frag* const fragHdr = layer::get_inner_ip6_frag();
- ft->ip_proto = fragHdr->ip6f_nxt;
+ if (fragHdr)
+ ft->ip_proto = fragHdr->ip6f_nxt;
}
/*
UserTracker& ut = p->is_from_client() ? server : client;
- if ( p->ptrs.decode_flags & DECODE_SOF or !ut.splitter )
+ if ( !ut.splitter or p->ptrs.decode_flags & DECODE_SOF )
start(p, flow);
if ( p->data && p->dsize )