I have found a capture filter in the tcpdump man page (and replicated in several other places) that does not make sense. The filter is: tcp[tcpflags] & (tcp-syn|tcp-fin) != 0 and not src and dst 192.168 Unless I misunderstand - the last part (and not src and dst net) is incorrect. The "not" would only negate src - dst would not be negated. Isn't this how that filter would actually have to be entered? tcp[tcpflags] & (tcp-syn|tcp-fin) != 0 and not (src or dst net 192.168) I've searched the net for over an hour and can't find the explanation - any help at all would be very much appreciated. asked 07 Sep '13, 12:02 kpalmgren edited 07 Sep '13, 12:42 |
One Answer:
If you print the BPF code for both of these statements, you'll see, that they are the same, meaning the filter is identical.
Without further checking, I would say, that's due to the precedence of the not operator. See man page of pcap-filter(7). Regards answered 07 Sep '13, 13:07 Kurt Knochner ♦ edited 07 Sep '13, 13:13 |