[libvirt] [PATCH 06/26] Add helper methods for determining what protocol layer is used

Daniel P. Berrange berrange at redhat.com
Wed Apr 16 09:03:57 UTC 2014


On Tue, Apr 15, 2014 at 12:05:46PM -0400, Stefan Berger wrote:
> On 04/15/2014 10:30 AM, Daniel P. Berrange wrote:
> >On Tue, Apr 15, 2014 at 10:06:22AM -0400, Stefan Berger wrote:
> >>On 04/08/2014 11:37 AM, Daniel P. Berrange wrote:
> >>>+bool virNWFilterRuleIsProtocolEthernet(virNWFilterRuleDefPtr rule)
> >>>+{
> >>>+    if (rule->prtclType >= VIR_NWFILTER_RULE_PROTOCOL_NONE &&
> >>>+        rule->prtclType <= VIR_NWFILTER_RULE_PROTOCOL_IPV6)
> >>>+        return true;
> >>>+    return false;
> >>>+}
> >>I get a compilation error here. For me this code here works:
> >>
> >>     if (/* rule->prtclType >= VIR_NWFILTER_RULE_PROTOCOL_NONE && */
> >>         rule->prtclType <= VIR_NWFILTER_RULE_PROTOCOL_IPV6)
> >>         return true;
> >What is the actual error you get ?
> >
> >That constant exists in the header files
> >
> >$ git grep RULE_PROTOCOL_NONE src/conf/nwfilter_conf.h
> >src/conf/nwfilter_conf.h:    VIR_NWFILTER_RULE_PROTOCOL_NONE = 0,
> 
> Related to evaluation of >= 0 on unsigned int always being true.

Ah, ok, must be a gcc version warning difference. That makes sense
to change


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list