diff mbox series

[ovs-dev,ovs] ofproto-dpif-xlate: Allow specific tunnel packets sent outside.

Message ID 20210130145611.78958-1-xiangxia.m.yue@gmail.com
State Deferred
Headers show
Series [ovs-dev,ovs] ofproto-dpif-xlate: Allow specific tunnel packets sent outside. | expand

Commit Message

Tonghao Zhang Jan. 30, 2021, 2:56 p.m. UTC
From: Tonghao Zhang <xiangxia.m.yue@gmail.com>

This patch adds more strict limitation to tunnel packets.
If the source and destination address are the local address.
the tunnel packets will be sent to outside.

This is useful, for example, if we upgrade the openvswitch:
One OvS may send these packets outside, and the physical switch
can send that packets back in hairpin mode, then other OvS may
process them.

Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
---
 ofproto/ofproto-dpif-xlate.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

0-day Robot Jan. 30, 2021, 3:10 p.m. UTC | #1
Bleep bloop.  Greetings Tonghao Zhang, I am a robot and I have tried out your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
WARNING: Line has non-spaces leading whitespace
WARNING: Line has trailing whitespace
#36 FILE: ofproto/ofproto-dpif-xlate.c:4111:
    

Lines checked: 43, Warnings: 2, Errors: 0


Please check this out.  If you feel there has been an error, please email aconole@redhat.com

Thanks,
0-day Robot
Simon Horman Oct. 6, 2023, 9:55 a.m. UTC | #2
On Sat, Jan 30, 2021 at 10:56:11PM +0800, xiangxia.m.yue@gmail.com wrote:
> From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> 
> This patch adds more strict limitation to tunnel packets.
> If the source and destination address are the local address.
> the tunnel packets will be sent to outside.
> 
> This is useful, for example, if we upgrade the openvswitch:
> One OvS may send these packets outside, and the physical switch
> can send that packets back in hairpin mode, then other OvS may
> process them.
> 
> Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>

Hi Tonghao Zhang,

This patch appears to have gone stale in patchwork, for one reason or
another. If it is still relevant then I think it needs to be revisited,
by being reposted after appropriate preparation.

As such I'm marking this patch as "Deferred" in patchwork.

No action is required unless there is a desire to revisit this patch.
diff mbox series

Patch

diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index 7108c8a30138..80c631993f05 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -4101,7 +4101,15 @@  terminate_native_tunnel(struct xlate_ctx *ctx, struct flow *flow,
         }
     }
 
-    return *tnl_port != ODPP_NONE;
+    /* Allow tunnel packets which source, and destination address
+     * are the local address to be sent outside. */
+    if (*tnl_port != ODPP_NONE &&
+        (flow->nw_src != flow->nw_dst ||
+         !ipv6_addr_equals(&flow->ipv6_src, &flow->ipv6_dst))) {
+        return true;
+    }
+    
+    return false;
 }
 
 static void