<br><font size=2 face="sans-serif">Stefan Berger<br>
IBM T. J. Watson Research Center, <br>
Hawthorne, NY, USA<br>
tel#: +1 914 784 7767 , <br>
fax#: +1 914 784 6225<br>
e-mail: stefanb@us.ibm.com</font>
<br>
<br><tt><font size=2>libvir-list-bounces@redhat.com wrote on 08/13/2010
04:21:45 PM:<br>
<br>
> [image removed] </font></tt>
<br><tt><font size=2>> <br>
> Re: [libvirt] [PATCH v2] nwfilter: Discard class D and E IP <br>
> addresses when sniffing packets</font></tt>
<br><tt><font size=2>> <br>
> Eric Blake </font></tt>
<br><tt><font size=2>> <br>
> to:</font></tt>
<br><tt><font size=2>> <br>
> Stefan Berger</font></tt>
<br><tt><font size=2>> <br>
> 08/13/2010 04:36 PM</font></tt>
<br><tt><font size=2>> <br>
> Sent by:</font></tt>
<br><tt><font size=2>> <br>
> libvir-list-bounces@redhat.com</font></tt>
<br><tt><font size=2>> <br>
> Cc:</font></tt>
<br><tt><font size=2>> <br>
> libvir-list</font></tt>
<br><tt><font size=2>> <br>
> On 08/13/2010 02:15 PM, Stefan Berger wrote:<br>
> >  V2: Corrected comment and simplified mask to check for
class D and E IP<br>
> > addresses<br>
> > <br>
> > When sniffing the network traffic, discard class D and E IP addresses<br>
> > when sniffing traffic. This was a reason why filters were not
correctly<br>
> > rebuilt on VMs on the local 192.* network when libvirt was restarted
and<br>
> > those VMs did not use a DHCP request to get its IP address.<br>
> > <br>
> <br>
> > -                  
 // skip eth. bcast and mcast addresses,<br>
> > -                  
 // and zero address in DHCP Requests<br>
> > -                  
 if ((ntohl(vmaddr)&  0xc0000000) || vmaddr == 0) {<br>
> > +                  
 // skip mcast addresses (224.0.0.0 - 239.255.255.255),<br>
> > +                  
 // class E (240.0.0.0 - 255.255.255.255, includes eth.<br>
> > +                  
 // bcast) and zero address in DHCP Requests<br>
> > +                  
 if ( (ntohl(vmaddr)&  0xe0000000) == 0xe0000000 ||<br>
>                    
                     
^^<br>
> [stupid thunderbird bug - why does it reformat quoted text for no
reason?]</font></tt>
<br>
<br><tt><font size=2>Wow, yes, that's not how I posted it.</font></tt>
<br>
<br><tt><font size=2>Could have also done something like (ntohl(vmaddr)
>> 29) == 7, but what we have is easier to understand...</font></tt>
<br><tt><font size=2><br>
> <br>
> > +                  
      vmaddr == 0) {<br>
> <br>
> ACK; looks better.</font></tt>
<br>
<br><tt><font size=2>Pushed.</font></tt>
<br>
<br><tt><font size=2>  Stefan<br>
</font></tt>