Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to drop invalid packets #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/liburdma/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -1764,12 +1764,14 @@ process_data_packet(struct usiw_qp *qp, struct rte_mbuf *mbuf)
RTE_LOG(NOTICE, USER1, "<dev=%" PRIx16 " qp=%" PRIx16 "> Drop packet with IPv4 next header %" PRIu8 " not UDP\n",
qp->shm_qp->dev_id, qp->shm_qp->qp_id,
ipv4_hdr->next_proto_id);
return;
}
if (ipv4_hdr->dst_addr != qp->dev->ipv4_addr) {
RTE_LOG(NOTICE, USER1, "<dev=%" PRIx16 " qp=%" PRIx16 "> Drop packet with IPv4 dst addr %" PRIx32 "; expected %" PRIx32 "\n",
qp->shm_qp->dev_id, qp->shm_qp->qp_id,
rte_be_to_cpu_32(ipv4_hdr->dst_addr),
rte_be_to_cpu_32(qp->dev->ipv4_addr));
return;
}

udp_hdr = (struct udp_hdr *)rte_pktmbuf_adj(mbuf, sizeof(*ipv4_hdr));
Expand All @@ -1778,6 +1780,7 @@ process_data_packet(struct usiw_qp *qp, struct rte_mbuf *mbuf)
qp->shm_qp->dev_id, qp->shm_qp->qp_id,
rte_be_to_cpu_16(udp_hdr->dst_port),
rte_be_to_cpu_16(qp->shm_qp->local_udp_port));
return;
}

ctx.src_ep = &qp->remote_ep;
Expand Down