Skip to content

Commit 49ce2d0

Browse files
committed
Accept own MAC for PF neighbour in case of TAP device
This is the FeBox case and it is ok to have the own MAC as the neighbour MAC in case of TAP device mode. Signed-off-by: Guvenc Gulce <[email protected]>
1 parent 7d5ff20 commit 49ce2d0

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

include/dp_port.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ struct dp_port *dp_get_port_by_pf_index(uint16_t index)
197197
}
198198

199199
static __rte_always_inline
200-
bool dp_conf_is_tap(void)
200+
bool dp_conf_is_tap_mode(void)
201201
{
202202
return dp_conf_get_nic_type() == DP_CONF_NIC_TYPE_TAP;
203203
}

src/dp_nat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ void dp_nat_chg_ip(struct dp_flow *df, struct rte_ipv4_hdr *ipv4_hdr,
269269
struct rte_udp_hdr *udp_hdr;
270270
struct rte_tcp_hdr *tcp_hdr;
271271
struct dp_port *in_port = dp_get_in_port(m);
272-
bool is_tap = dp_conf_is_tap();
272+
bool is_tap = dp_conf_is_tap_mode();
273273

274274
ipv4_hdr->hdr_checksum = 0;
275275
m->ol_flags |= RTE_MBUF_F_TX_IPV4;

src/dp_netlink.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "dp_log.h"
1414
#include "dp_netlink.h"
1515
#include "dp_util.h"
16+
#include "dp_port.h"
1617

1718
static int dp_read_neigh(struct nlmsghdr *nh, __u32 nll, struct rte_ether_addr *neigh,
1819
const struct rte_ether_addr *own_mac)
@@ -33,6 +34,9 @@ static int dp_read_neigh(struct nlmsghdr *nh, __u32 nll, struct rte_ether_addr *
3334
if (rt_attr->rta_type == NDA_LLADDR)
3435
memcpy(&neigh->addr_bytes, RTA_DATA(rt_attr), sizeof(neigh->addr_bytes));
3536
}
37+
// If it is a tap device, we make an exception with own MAC address check. FeBOX case
38+
if (dp_conf_is_tap_mode())
39+
return DP_OK;
3640
if (!DP_MAC_EQUAL(own_mac, neigh))
3741
return DP_OK;
3842
}

0 commit comments

Comments
 (0)