diff mbox

[ovs-dev,v2,09/14] ofproto-dpif-xlate: use IPv6 for tnl_neigh_cache

Message ID 1448458277-28154-10-git-send-email-cascardo@redhat.com
State Accepted
Headers show

Commit Message

Thadeu Lima de Souza Cascardo Nov. 25, 2015, 1:31 p.m. UTC
Use IPv4-mapped address and replace tnl_arp_lookup with tnl_neigh_lookup.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
---
 ofproto/ofproto-dpif-xlate.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Ben Pfaff Nov. 30, 2015, 6:45 p.m. UTC | #1
On Wed, Nov 25, 2015 at 11:31:12AM -0200, Thadeu Lima de Souza Cascardo wrote:
> Use IPv4-mapped address and replace tnl_arp_lookup with tnl_neigh_lookup.
> 
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>

Applied, thanks!
diff mbox

Patch

diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index 75511b8..05baf6c 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -423,7 +423,7 @@  struct xc_entry {
         } group;
         struct {
             char br_name[IFNAMSIZ];
-            ovs_be32 d_ip;
+            struct in6_addr d_ipv6;
         } tnl_neigh_cache;
     } u;
 };
@@ -2774,7 +2774,7 @@  build_tunnel_send(struct xlate_ctx *ctx, const struct xport *xport,
         entry = xlate_cache_add_entry(ctx->xin->xcache, XC_TNL_NEIGH);
         ovs_strlcpy(entry->u.tnl_neigh_cache.br_name, out_dev->xbridge->name,
                     sizeof entry->u.tnl_neigh_cache.br_name);
-        entry->u.tnl_neigh_cache.d_ip = d_ip;
+        in6_addr_set_mapped_ipv4(&entry->u.tnl_neigh_cache.d_ipv6, d_ip);
     }
 
     xlate_report(ctx, "tunneling from "ETH_ADDR_FMT" "IP_FMT
@@ -5357,8 +5357,8 @@  xlate_push_stats(struct xlate_cache *xcache,
             break;
         case XC_TNL_NEIGH:
             /* Lookup neighbor to avoid timeout. */
-            tnl_arp_lookup(entry->u.tnl_neigh_cache.br_name,
-                           entry->u.tnl_neigh_cache.d_ip, &dmac);
+            tnl_neigh_lookup(entry->u.tnl_neigh_cache.br_name,
+                             &entry->u.tnl_neigh_cache.d_ipv6, &dmac);
             break;
         default:
             OVS_NOT_REACHED();