[libvirt] [tck PATCH v2 3/5] filter for proper IP address in tcpdump looking for broadcast packet

Laine Stump posted 5 patches 7 years, 3 months ago
[libvirt] [tck PATCH v2 3/5] filter for proper IP address in tcpdump looking for broadcast packet
Posted by Laine Stump 7 years, 3 months ago
In the no-mac-broadcast test, a ping is sent to 192.168.122.255, but
tcpdump is set to look for packets with a destination IP of
255.255.255.255. Change it to check for the correct IP address and
also for mac broadcast (which is what the no-mac-broadcast filter
actually looks at). This should eliminate the "false success" that was
happening because tcpdump wasn't actually seeing the broadcast packet
the guest was sending, as well as catching the "false failure" caused
by tcpdump seeing other traffic from the guest unrelated to the test
(which happened to be broadcasts sent to 255.255.255.255).

Signed-off-by: Laine Stump <laine@laine.org>
---

Unchanged from V1, it just had no review.

 scripts/nwfilter/230-no-mac-broadcast.t | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/nwfilter/230-no-mac-broadcast.t b/scripts/nwfilter/230-no-mac-broadcast.t
index 6ab20d8..758005c 100644
--- a/scripts/nwfilter/230-no-mac-broadcast.t
+++ b/scripts/nwfilter/230-no-mac-broadcast.t
@@ -80,7 +80,7 @@ ok($ebtable =~ "-d Broadcast -j DROP", "check ebtables entry for \"-d Broadcast
 
 # prepare tcpdump
 diag "prepare tcpdump";
-system("/usr/sbin/tcpdump -v -i virbr0 -n host 255.255.255.255 2> /tmp/tcpdump.log &");
+system("/usr/sbin/tcpdump -v -i virbr0 -n host 192.168.122.255 and ether host ff:ff:ff:ff:ff:ff 2> /tmp/tcpdump.log &");
 
 # log into guest
 diag "ssh'ing into $guestip";
-- 
2.14.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [tck PATCH v2 3/5] filter for proper IP address in tcpdump looking for broadcast packet
Posted by Daniel P. Berrangé 7 years, 3 months ago
On Thu, Feb 08, 2018 at 02:19:37PM -0500, Laine Stump wrote:
> In the no-mac-broadcast test, a ping is sent to 192.168.122.255, but
> tcpdump is set to look for packets with a destination IP of
> 255.255.255.255. Change it to check for the correct IP address and
> also for mac broadcast (which is what the no-mac-broadcast filter
> actually looks at). This should eliminate the "false success" that was
> happening because tcpdump wasn't actually seeing the broadcast packet
> the guest was sending, as well as catching the "false failure" caused
> by tcpdump seeing other traffic from the guest unrelated to the test
> (which happened to be broadcasts sent to 255.255.255.255).
> 
> Signed-off-by: Laine Stump <laine@laine.org>
> ---
> 
> Unchanged from V1, it just had no review.
> 
>  scripts/nwfilter/230-no-mac-broadcast.t | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [tck PATCH v2 3/5] filter for proper IP address in tcpdump looking for broadcast packet
Posted by Stefan Berger 7 years, 3 months ago
On 02/08/2018 02:19 PM, Laine Stump wrote:
> In the no-mac-broadcast test, a ping is sent to 192.168.122.255, but
> tcpdump is set to look for packets with a destination IP of
> 255.255.255.255. Change it to check for the correct IP address and
> also for mac broadcast (which is what the no-mac-broadcast filter
> actually looks at). This should eliminate the "false success" that was
> happening because tcpdump wasn't actually seeing the broadcast packet
> the guest was sending, as well as catching the "false failure" caused
> by tcpdump seeing other traffic from the guest unrelated to the test
> (which happened to be broadcasts sent to 255.255.255.255).
>
> Signed-off-by: Laine Stump <laine@laine.org>
Review-by: Stefan Berger <stefanb@linux.vnet.ibm.com>

> ---
>
> Unchanged from V1, it just had no review.
>
>   scripts/nwfilter/230-no-mac-broadcast.t | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/nwfilter/230-no-mac-broadcast.t b/scripts/nwfilter/230-no-mac-broadcast.t
> index 6ab20d8..758005c 100644
> --- a/scripts/nwfilter/230-no-mac-broadcast.t
> +++ b/scripts/nwfilter/230-no-mac-broadcast.t
> @@ -80,7 +80,7 @@ ok($ebtable =~ "-d Broadcast -j DROP", "check ebtables entry for \"-d Broadcast
>
>   # prepare tcpdump
>   diag "prepare tcpdump";
> -system("/usr/sbin/tcpdump -v -i virbr0 -n host 255.255.255.255 2> /tmp/tcpdump.log &");
> +system("/usr/sbin/tcpdump -v -i virbr0 -n host 192.168.122.255 and ether host ff:ff:ff:ff:ff:ff 2> /tmp/tcpdump.log &");
>
>   # log into guest
>   diag "ssh'ing into $guestip";


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list