Skip to content

Commit cd131d5

Browse files
committed
Fix dmesg spamming with own MAC error
1 parent 7f1dc36 commit cd131d5

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/dp_nat.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,8 +792,7 @@ int dp_allocate_sync_snat_port(const struct netnat_portmap_key *portmap_key,
792792
if (ret == -EEXIST) {
793793
rte_free(sync_metadata);
794794
return DP_OK; // ignore duplicates, trust the primary dpservice
795-
}
796-
else if (ret != -ENOENT) {
795+
} else if (ret != -ENOENT) {
797796
rte_free(sync_metadata);
798797
return ret;
799798
}

src/dp_sync.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55

66
#define DP_SYNC_HEADERS_LEN (sizeof(struct rte_ether_hdr) + sizeof(struct dp_sync_hdr))
77

8-
// TODO condition on when to run - only send packets after being asked? (need the other dpservice and a valid request?)
9-
// but maybe not, just spam anyway??
10-
// also this is already checked elsewhere I think - validate this
8+
static const struct rte_ether_addr sync_mac_src = { .addr_bytes = { 0x02, 'd', 'p', 's', 0, 1 } };
9+
static const struct rte_ether_addr sync_mac_dst = { .addr_bytes = { 0x02, 'd', 'p', 's', 0, 2 } };
10+
1111

1212
static struct rte_mbuf *dp_sync_alloc_message(uint8_t msg_type, uint16_t payload_len)
1313
{
1414
struct dp_dpdk_layer *dp_layer = get_dpdk_layer();
15-
const struct dp_port *port = dp_get_sync_port();
1615
struct rte_mbuf *pkt;
1716
struct rte_ether_hdr *eth_hdr;
1817
struct dp_sync_hdr *sync_hdr;
@@ -29,8 +28,8 @@ static struct rte_mbuf *dp_sync_alloc_message(uint8_t msg_type, uint16_t payload
2928
rte_pktmbuf_free(pkt);
3029
return NULL;
3130
}
32-
rte_ether_addr_copy(&port->own_mac, &eth_hdr->src_addr);
33-
rte_ether_addr_copy(&port->neigh_mac, &eth_hdr->src_addr);
31+
rte_ether_addr_copy(&sync_mac_src, &eth_hdr->src_addr);
32+
rte_ether_addr_copy(&sync_mac_dst, &eth_hdr->dst_addr);
3433
eth_hdr->ether_type = htons(DP_SYNC_ETHERTYPE);
3534

3635
sync_hdr = (struct dp_sync_hdr *)(eth_hdr + 1);

0 commit comments

Comments
 (0)