diff mbox

[ovs-dev] match: Only print external tunnel flags.

Message ID 1471566325-113956-1-git-send-email-jesse@kernel.org
State Accepted
Headers show

Commit Message

Jesse Gross Aug. 19, 2016, 12:25 a.m. UTC
Some tunnel flags are purely internal implementation details (primarily
FLOW_TNL_F_UDPIF). These shouldn't be output when we format tunnel
flows, so this masks them out.

Signed-off-by: Jesse Gross <jesse@kernel.org>
---
 lib/match.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Ben Pfaff Aug. 19, 2016, 3:54 p.m. UTC | #1
On Thu, Aug 18, 2016 at 05:25:25PM -0700, Jesse Gross wrote:
> Some tunnel flags are purely internal implementation details (primarily
> FLOW_TNL_F_UDPIF). These shouldn't be output when we format tunnel
> flows, so this masks them out.
> 
> Signed-off-by: Jesse Gross <jesse@kernel.org>

Acked-by: Ben Pfaff <blp@ovn.org>
Jesse Gross Aug. 19, 2016, 4:56 p.m. UTC | #2
On Fri, Aug 19, 2016 at 8:54 AM, Ben Pfaff <blp@ovn.org> wrote:
> On Thu, Aug 18, 2016 at 05:25:25PM -0700, Jesse Gross wrote:
>> Some tunnel flags are purely internal implementation details (primarily
>> FLOW_TNL_F_UDPIF). These shouldn't be output when we format tunnel
>> flows, so this masks them out.
>>
>> Signed-off-by: Jesse Gross <jesse@kernel.org>
>
> Acked-by: Ben Pfaff <blp@ovn.org>

Thanks, I applied this to master, branch-2.6, and branch-2.5.
diff mbox

Patch

diff --git a/lib/match.c b/lib/match.c
index d5deb7d..d78e6a1 100644
--- a/lib/match.c
+++ b/lib/match.c
@@ -1035,9 +1035,9 @@  format_flow_tunnel(struct ds *s, const struct match *match)
     if (wc->masks.tunnel.ip_ttl) {
         ds_put_format(s, "tun_ttl=%"PRIu8",", tnl->ip_ttl);
     }
-    if (wc->masks.tunnel.flags) {
+    if (wc->masks.tunnel.flags & FLOW_TNL_F_MASK) {
         format_flags_masked(s, "tun_flags", flow_tun_flag_to_string,
-                            tnl->flags,
+                            tnl->flags & FLOW_TNL_F_MASK,
                             wc->masks.tunnel.flags & FLOW_TNL_F_MASK,
                             FLOW_TNL_F_MASK);
         ds_put_char(s, ',');