[ovs-dev] [PATCH 2/3] Do not print ICMP fields for non IP packets.

Ben Pfaff blp at nicira.com
Mon Oct 22 19:36:23 UTC 2012


On Sat, Oct 20, 2012 at 12:49:12PM -0500, Ethan Jackson wrote:
> > -    if (f->nw_proto == IPPROTO_ICMP) {
> > +    if (f->dl_type == htons(ETH_TYPE_IP) &&
> > +        f->nw_proto == IPPROTO_ICMP) {
> >          format_be16_masked(s, "icmp_type", f->tp_src, wc->masks.tp_src);
> >          format_be16_masked(s, "icmp_code", f->tp_dst, wc->masks.tp_dst);
> > -    } else if (f->nw_proto == IPPROTO_ICMPV6) {
> > +    } else if (f->dl_type == htons(ETH_TYPE_IPV6) &&
> > +               f->nw_proto == IPPROTO_ICMPV6) {
> 
> Traditionally we've put the && on the next line so you end up with:

A lot of people disagree with this so some time ago we removed the
text that required binary operators at the beginning of a line.



More information about the dev mailing list