From: Justin Pettit Date: Fri, 22 Feb 2013 02:46:20 +0000 (-0800) Subject: match: Only print tp_src and tp_dst for TCP and UDP. X-Git-Tag: v1.11.0~363 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=9a9a690cc0bc07bb2a0fa01221492cdab61673e3;p=cascardo%2Fovs.git match: Only print tp_src and tp_dst for TCP and UDP. 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 --- diff --git a/lib/match.c b/lib/match.c index f4b0a6c14..2395fb483 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); }