inliniac/suricata — pull request #872 by inliniac (2014-03-05 09:23:50+00:00)
Title: Fix False Positive of rules with ports on portless protocols

In case of 'alert ip' rules that have ports, the port checks would
be bypassed for non-port protocols, such as ICMP. This would lead to
a rule matching: a false positive.

This patch adds a check. If the rule has a port setting other than
'any' and the protocol is not TCP, UDP or SCTP, then we rule won't
match.

Rules with 'alert ip' and ports are rare, so the impact should be
minimal.

Prscript:
- PR build: https://buildbot.suricata-ids.org/builders/inliniac/builds/219
- PR pcaps: https://buildbot.suricata-ids.org/builders/inliniac-pcap/builds/139

https://redmine.openinfosecfoundation.org/issues/611
Bug #611.