Bug 164329 - ip broadcast filter doesn't check network field
Summary: ip broadcast filter doesn't check network field
Alias: None
Product: Fedora
Classification: Fedora
Component: tcpdump
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Martin Stransky
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2005-07-26 22:41 UTC by Kenneth Porter
Modified: 2007-11-30 22:11 UTC (History)
0 users

Clone Of:
Last Closed: 2005-09-01 10:51:51 UTC

Attachments (Terms of Use)

Description Kenneth Porter 2005-07-26 22:41:29 UTC
Using tcpdump-3.9.1-1.src.rpm.

Using "ip broadcast" as a filter on an aliased interface fails because the
network part of the address is not checked for a match. For instance, here's an
invocation using a /24 setup:

[root@segw ken]# tcpdump -i eth1:1 ip broadcast -d -O
(000) ldh      [12]
(001) jeq      #0x800           jt 2    jf 9
(002) ld       [30]
(003) and      #0xff000000
(004) jeq      #0x0             jt 8    jf 5
(005) ld       [30]
(006) and      #0xff000000
(007) jeq      #0xff000000      jt 8    jf 9
(008) ret      #96
(009) ret      #0

Note how the host field is checked for all-zeroes and all-ones, but the network
field is not matched against the interface's configured address. This causes
lots of false positives on an unswitched network.

Comment 1 Martin Stransky 2005-09-01 10:51:51 UTC
In this case, you're using netmask If it isn't the correct one
(probably because libpcap can't obtain correct netmask from aliased interface),
you have to specify it with the "net" directive (see man tcpdump) instead the
"ip broadcast". If locally broadcasted packet goes to other subnets, it's a bug
in routing.

Note You need to log in before you can comment on or make changes to this bug.