Skip to content

Commit

Permalink
controller: fix ip buffering with static routes
Browse files Browse the repository at this point in the history
When the ARP request is sent to a gw router and not to the final
destination of the packet buffered_packets_map needs to be updated using
next-hop IP address and not the destination one.

Fixes: 2e5cdb4 ("OVN: add buffering support for ip packets")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Acked-by: Ankur Sharma <ankur.sharma@nutanix.com>
Signed-off-by: Numan Siddique <numans@ovn.org>
  • Loading branch information
LorenzoBianconi authored and numansiddique committed May 28, 2020
1 parent fda9a1d commit 526f920
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions controller/pinctrl.c
Expand Up @@ -1381,8 +1381,7 @@ pinctrl_find_buffered_packets(const struct in6_addr *ip, uint32_t hash)

/* Called with in the pinctrl_handler thread context. */
static int
pinctrl_handle_buffered_packets(const struct flow *ip_flow,
struct dp_packet *pkt_in,
pinctrl_handle_buffered_packets(struct dp_packet *pkt_in,
const struct match *md, bool is_arp)
OVS_REQUIRES(pinctrl_mutex)
{
Expand All @@ -1391,9 +1390,10 @@ pinctrl_handle_buffered_packets(const struct flow *ip_flow,
struct in6_addr addr;

if (is_arp) {
addr = in6_addr_mapped_ipv4(ip_flow->nw_dst);
addr = in6_addr_mapped_ipv4(htonl(md->flow.regs[0]));
} else {
addr = ip_flow->ipv6_dst;
ovs_be128 ip6 = hton128(flow_get_xxreg(&md->flow, 0));
memcpy(&addr, &ip6, sizeof addr);
}

uint32_t hash = hash_bytes(&addr, sizeof addr, 0);
Expand Down Expand Up @@ -1434,7 +1434,7 @@ pinctrl_handle_arp(struct rconn *swconn, const struct flow *ip_flow,
}

ovs_mutex_lock(&pinctrl_mutex);
pinctrl_handle_buffered_packets(ip_flow, pkt_in, md, true);
pinctrl_handle_buffered_packets(pkt_in, md, true);
ovs_mutex_unlock(&pinctrl_mutex);

/* Compose an ARP packet. */
Expand Down Expand Up @@ -5281,7 +5281,7 @@ pinctrl_handle_nd_ns(struct rconn *swconn, const struct flow *ip_flow,
}

ovs_mutex_lock(&pinctrl_mutex);
pinctrl_handle_buffered_packets(ip_flow, pkt_in, md, false);
pinctrl_handle_buffered_packets(pkt_in, md, false);
ovs_mutex_unlock(&pinctrl_mutex);

uint64_t packet_stub[128 / 8];
Expand Down

0 comments on commit 526f920

Please sign in to comment.