[ovs-dev] [PATCH] match: Only print tp_src and tp_dst for TCP and UDP.

Ben Pfaff blp at nicira.com
Fri Feb 22 06:20:10 UTC 2013


Based on the commit message it isn't clear to me why we shouldn't cover ARP
here. (I don't have easy access to the full source code at the moment, so
maybe this implies a source code revision and maybe a commit message
revision and maybe I just misunderstand.)
On Feb 21, 2013 8:50 PM, "Justin Pettit" <jpettit at nicira.com> wrote:

> When printing a match, we would print "tp_src" and "tp_dst" if the
> packet wasn't ICMPv4 or ICMPv6.  Unfortunately, this doesn't cover ARP.
> This changes the check to only print those keys if the network protocol
> is TCP or UDP.
>
> Signed-off-by: Justin Pettit <jpettit at nicira.com>
> ---
>  lib/match.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/lib/match.c b/lib/match.c
> index f4b0a6c..2395fb4 100644
> --- a/lib/match.c
> +++ b/lib/match.c
> @@ -1053,7 +1053,8 @@ match_format(const struct match *match, struct ds
> *s, unsigned int priority)
>                              &wc->masks.nd_target);
>          format_eth_masked(s, "nd_sll", f->arp_sha, wc->masks.arp_sha);
>          format_eth_masked(s, "nd_tll", f->arp_tha, wc->masks.arp_tha);
> -    } else {
> +    } else if (f->nw_proto == IPPROTO_TCP ||
> +               f->nw_proto == IPPROTO_UDP) {
>          format_be16_masked(s, "tp_src", f->tp_src, wc->masks.tp_src);
>          format_be16_masked(s, "tp_dst", f->tp_dst, wc->masks.tp_dst);
>      }
> --
> 1.7.5.4
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20130221/f6e273a6/attachment-0003.html>


More information about the dev mailing list