Skip to content

Commit

Permalink
lib: fix the use of ipv4 packet id
Browse files Browse the repository at this point in the history
The packet id is set to 0 when IP_DF flag set,
this is identical to the kernel behavior

Signed-off-by: Ric Li <[email protected]>
  • Loading branch information
ricmli committed Oct 27, 2023
1 parent 873595c commit b0447ed
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 90 deletions.
2 changes: 1 addition & 1 deletion lib/src/mt_ptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ static void ptp_delay_req_task(struct mt_ptp_impl* ptp) {
ipv4_hdr->udp.dst_port = ipv4_hdr->udp.src_port;
ipv4_hdr->udp.dgram_cksum = 0;
ipv4_hdr->ip.time_to_live = 255;
ipv4_hdr->ip.packet_id = htons(ptp->t3_sequence_id);
ipv4_hdr->ip.fragment_offset = MT_IP_DONT_FRAGMENT_FLAG;
ipv4_hdr->ip.next_proto_id = IPPROTO_UDP;
ipv4_hdr->ip.hdr_checksum = 0;
mt_mbuf_init_ipv4(m);
Expand Down
3 changes: 0 additions & 3 deletions lib/src/mt_rtcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ int mt_rtcp_rx_send_nack_packet(struct mt_rtcp_rx* rx) {
udp = &hdr->udp;

rte_memcpy(hdr, &rx->udp_hdr, sizeof(*hdr));
ipv4->packet_id = htons(rx->ipv4_packet_id++);
mt_mbuf_init_ipv4(pkt);
pkt->data_len = sizeof(*hdr);

Expand Down Expand Up @@ -401,7 +400,6 @@ struct mt_rtcp_tx* mt_rtcp_tx_create(struct mtl_main_impl* impl,
}
tx->mbuf_ring = ring;

tx->ipv4_packet_id = 0;
tx->ssrc = ops->ssrc;
snprintf(tx->name, sizeof(tx->name) - 1, "%s", ops->name);
rte_memcpy(&tx->udp_hdr, ops->udp_hdr, sizeof(tx->udp_hdr));
Expand Down Expand Up @@ -455,7 +453,6 @@ struct mt_rtcp_rx* mt_rtcp_rx_create(struct mtl_main_impl* impl,

rx->parent = impl;
rx->port = ops->port;
rx->ipv4_packet_id = 0;
rx->ssrc = 0;
rx->nacks_send_interval = ops->nacks_send_interval;
rx->nacks_send_time = mt_get_tsc(impl);
Expand Down
2 changes: 0 additions & 2 deletions lib/src/mt_rtcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ struct mt_rtcp_tx {
bool active;
enum mt_rtp_payload_format payload_format;

uint16_t ipv4_packet_id;
uint16_t last_seq_num;

/* stat */
Expand All @@ -86,7 +85,6 @@ struct mt_rtcp_rx {
uint32_t ssrc;
bool active;

uint16_t ipv4_packet_id;
uint64_t nacks_send_time;

uint16_t last_seq;
Expand Down
3 changes: 0 additions & 3 deletions lib/src/st2110/st_header.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ struct st_tx_video_session_impl {
struct st_tx_video_session_handle_impl* st20_handle;
struct st22_tx_video_session_handle_impl* st22_handle;

uint16_t st20_ipv4_packet_id;
uint16_t st20_src_port[MTL_SESSION_PORT_MAX]; /* udp port */
uint16_t st20_dst_port[MTL_SESSION_PORT_MAX]; /* udp port */
struct st_rfc4175_video_hdr s_hdr[MTL_SESSION_PORT_MAX];
Expand Down Expand Up @@ -802,7 +801,6 @@ struct st_tx_audio_session_impl {
uint16_t st30_frame_idx; /* current frame index */
enum st30_tx_frame_status st30_frame_stat;

uint16_t st30_ipv4_packet_id;
uint16_t st30_src_port[MTL_SESSION_PORT_MAX]; /* udp port */
uint16_t st30_dst_port[MTL_SESSION_PORT_MAX]; /* udp port */
struct st_rfc3550_audio_hdr hdr[MTL_SESSION_PORT_MAX];
Expand Down Expand Up @@ -1020,7 +1018,6 @@ struct st_tx_ancillary_session_impl {
uint16_t st40_frame_idx; /* current frame index */
enum st40_tx_frame_status st40_frame_stat;

uint16_t st40_ipv4_packet_id;
uint16_t st40_src_port[MTL_SESSION_PORT_MAX]; /* udp port */
uint16_t st40_dst_port[MTL_SESSION_PORT_MAX]; /* udp port */
struct st_rfc8331_anc_hdr hdr[MTL_SESSION_PORT_MAX];
Expand Down
16 changes: 1 addition & 15 deletions lib/src/st2110/st_tx_ancillary_session.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ static int tx_ancillary_session_init_hdr(struct mtl_main_impl* impl,
ipv4->version_ihl = (4 << 4) | (sizeof(struct rte_ipv4_hdr) / 4);
ipv4->time_to_live = 64;
ipv4->type_of_service = 0;
ipv4->packet_id = 0;
ipv4->fragment_offset = MT_IP_DONT_FRAGMENT_FLAG;
ipv4->next_proto_id = IPPROTO_UDP;
mtl_memcpy(&ipv4->src_addr, sip, MTL_IP_ADDR_LEN);
Expand Down Expand Up @@ -354,15 +355,12 @@ static int tx_ancillary_session_update_redundant(struct st_tx_ancillary_session_
struct rte_mbuf* pkt_r,
const struct rte_mbuf* pkt_base) {
struct mt_udp_hdr* hdr = rte_pktmbuf_mtod(pkt_r, struct mt_udp_hdr*);
struct mt_udp_hdr* hdr_base = rte_pktmbuf_mtod(pkt_base, struct mt_udp_hdr*);
struct rte_ipv4_hdr* ipv4 = &hdr->ipv4;
struct rte_ipv4_hdr* ipv4_base = &hdr_base->ipv4;
struct rte_udp_hdr* udp = &hdr->udp;

/* update the hdr: eth, ip, udp */
rte_memcpy(hdr, &s->hdr[MTL_SESSION_PORT_R], sizeof(*hdr));

ipv4->packet_id = ipv4_base->packet_id;
ipv4->total_length = htons(pkt_r->pkt_len - pkt_r->l2_len);

udp->dgram_len = htons(pkt_r->pkt_len - pkt_r->l2_len - pkt_r->l3_len);
Expand Down Expand Up @@ -391,10 +389,6 @@ static int tx_ancillary_session_build_packet(struct st_tx_ancillary_session_impl
rte_memcpy(ipv4, &s->hdr[MTL_SESSION_PORT_P].ipv4, sizeof(hdr->ipv4));
rte_memcpy(udp, &s->hdr[MTL_SESSION_PORT_P].udp, sizeof(hdr->udp));

/* update ipv4 hdr */
ipv4->packet_id = htons(s->st40_ipv4_packet_id);
s->st40_ipv4_packet_id++;

/* update mbuf */
mt_mbuf_init_ipv4(pkt);
pkt->data_len = sizeof(struct rte_ether_hdr) + sizeof(struct rte_ipv4_hdr) +
Expand Down Expand Up @@ -563,10 +557,6 @@ static int tx_ancillary_session_rtp_update_packet(struct mtl_main_impl* impl,
rte_memcpy(ipv4, &s->hdr[MTL_SESSION_PORT_P].ipv4, sizeof(hdr->ipv4));
rte_memcpy(udp, &s->hdr[MTL_SESSION_PORT_P].udp, sizeof(hdr->udp));

/* update ipv4 hdr */
ipv4->packet_id = htons(s->st40_ipv4_packet_id);
s->st40_ipv4_packet_id++;

if (rtp->tmstamp != s->st40_rtp_time) {
/* start of a new frame */
s->st40_pkt_idx = 0;
Expand Down Expand Up @@ -612,11 +602,8 @@ static int tx_ancillary_session_build_packet_chain(struct mtl_main_impl* impl,
rte_memcpy(ipv4, &s->hdr[s_port].ipv4, sizeof(hdr->ipv4));
rte_memcpy(udp, &s->hdr[s_port].udp, sizeof(hdr->udp));

/* update ipv4 hdr */
ipv4->packet_id = htons(s->st40_ipv4_packet_id);
/* update only for primary */
if (s_port == MTL_SESSION_PORT_P) {
s->st40_ipv4_packet_id++;
/* update rtp time for rtp path */
if (ops->type == ST40_TYPE_RTP_LEVEL) {
struct st40_rfc8331_rtp_hdr* rtp =
Expand Down Expand Up @@ -1373,7 +1360,6 @@ static int tx_ancillary_session_attach(struct mtl_main_impl* impl,
s->tx_mono_pool = mt_has_tx_mono_pool(impl);
/* manually disable chain or any port can't support chain */
s->tx_no_chain = mt_has_tx_no_chain(impl) || !tx_ancillary_session_has_chain_buf(s);
s->st40_ipv4_packet_id = 0;
s->max_pkt_len = ST_PKT_MAX_ETHER_BYTES - sizeof(struct st_rfc8331_anc_hdr);

s->st40_frames_cnt = ops->framebuff_cnt;
Expand Down
15 changes: 1 addition & 14 deletions lib/src/st2110/st_tx_audio_session.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ static int tx_audio_session_init_hdr(struct mtl_main_impl* impl,
ipv4->version_ihl = (4 << 4) | (sizeof(struct rte_ipv4_hdr) / 4);
ipv4->time_to_live = 64;
ipv4->type_of_service = 0;
ipv4->packet_id = 0;
ipv4->fragment_offset = MT_IP_DONT_FRAGMENT_FLAG;
ipv4->total_length = htons(s->pkt_len + ST_PKT_AUDIO_HDR_LEN);
ipv4->next_proto_id = IPPROTO_UDP;
Expand Down Expand Up @@ -366,15 +367,12 @@ static int tx_audio_session_update_redundant(struct st_tx_audio_session_impl* s,
struct rte_mbuf* pkt_r,
const struct rte_mbuf* pkt_base) {
struct mt_udp_hdr* hdr = rte_pktmbuf_mtod(pkt_r, struct mt_udp_hdr*);
struct mt_udp_hdr* hdr_base = rte_pktmbuf_mtod(pkt_base, struct mt_udp_hdr*);
struct rte_ipv4_hdr* ipv4 = &hdr->ipv4;
struct rte_ipv4_hdr* ipv4_base = &hdr_base->ipv4;
struct rte_udp_hdr* udp = &hdr->udp;

/* update the hdr: eth, ip, udp */
rte_memcpy(hdr, &s->hdr[MTL_SESSION_PORT_R], sizeof(*hdr));

ipv4->packet_id = ipv4_base->packet_id;
ipv4->total_length = htons(pkt_r->pkt_len - pkt_r->l2_len);

udp->dgram_len = htons(pkt_r->pkt_len - pkt_r->l2_len - pkt_r->l3_len);
Expand Down Expand Up @@ -403,10 +401,6 @@ static int tx_audio_session_build_packet(struct st_tx_audio_session_impl* s,
rte_memcpy(ipv4, &s->hdr[MTL_SESSION_PORT_P].ipv4, sizeof(hdr->ipv4));
rte_memcpy(udp, &s->hdr[MTL_SESSION_PORT_P].udp, sizeof(hdr->udp));

/* update ipv4 hdr */
ipv4->packet_id = htons(s->st30_ipv4_packet_id);
s->st30_ipv4_packet_id++;

/* update mbuf */
mt_mbuf_init_ipv4(pkt);
pkt->data_len = sizeof(struct rte_ether_hdr) + sizeof(struct rte_ipv4_hdr) +
Expand Down Expand Up @@ -487,10 +481,6 @@ static int tx_audio_session_rtp_update_packet(struct st_tx_audio_session_impl* s
rte_memcpy(ipv4, &s->hdr[MTL_SESSION_PORT_P].ipv4, sizeof(hdr->ipv4));
rte_memcpy(udp, &s->hdr[MTL_SESSION_PORT_P].udp, sizeof(hdr->udp));

/* update ipv4 hdr */
ipv4->packet_id = htons(s->st30_ipv4_packet_id);
s->st30_ipv4_packet_id++;

if (rtp->tmstamp != s->st30_rtp_time_app) {
/* start of a new epoch */
s->st30_rtp_time_app = rtp->tmstamp;
Expand Down Expand Up @@ -536,10 +526,8 @@ static int tx_audio_session_build_packet_chain(struct st_tx_audio_session_impl*
rte_memcpy(udp, &s->hdr[s_port].udp, sizeof(hdr->udp));

/* update ipv4 hdr */
ipv4->packet_id = htons(s->st30_ipv4_packet_id);
/* update only for primary */
if (s_port == MTL_SESSION_PORT_P) {
s->st30_ipv4_packet_id++;
/* update rtp time for rtp path */
if (ops->type == ST30_TYPE_RTP_LEVEL) {
struct st_rfc3550_rtp_hdr* rtp =
Expand Down Expand Up @@ -1438,7 +1426,6 @@ static int tx_audio_session_attach(struct mtl_main_impl* impl,
s->tx_mono_pool = mt_has_tx_mono_pool(impl);
/* manually disable chain or any port can't support chain */
s->tx_no_chain = mt_has_tx_no_chain(impl) || !tx_audio_session_has_chain_buf(s);
s->st30_ipv4_packet_id = 0;

s->st30_frames_cnt = ops->framebuff_cnt;

Expand Down
50 changes: 3 additions & 47 deletions lib/src/st2110/st_tx_video_session.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,7 @@ static int tv_init_hdr(struct mtl_main_impl* impl, struct st_tx_video_session_im
ipv4->version_ihl = (4 << 4) | (sizeof(struct rte_ipv4_hdr) / 4);
ipv4->time_to_live = 64;
ipv4->type_of_service = 0;
ipv4->packet_id = 0; /* always 0 when DONT_FRAGMENT set */
ipv4->fragment_offset = MT_IP_DONT_FRAGMENT_FLAG;
ipv4->next_proto_id = IPPROTO_UDP;
mtl_memcpy(&ipv4->src_addr, sip, MTL_IP_ADDR_LEN);
Expand Down Expand Up @@ -891,15 +892,13 @@ static int tv_build_st20_redundant(struct st_tx_video_session_impl* s,
struct mt_udp_hdr* hdr = rte_pktmbuf_mtod(pkt_r, struct mt_udp_hdr*);
struct mt_udp_hdr* hdr_base = rte_pktmbuf_mtod(pkt_base, struct mt_udp_hdr*);
struct rte_ipv4_hdr* ipv4 = &hdr->ipv4;
struct rte_ipv4_hdr* ipv4_base = &hdr_base->ipv4;
struct rte_udp_hdr* udp = &hdr->udp;

/* update the hdr: eth, ip, udp */
rte_memcpy(hdr, &s->s_hdr[MTL_SESSION_PORT_R], sizeof(*hdr));
mt_mbuf_init_ipv4(pkt_r);
pkt_r->data_len = pkt_base->data_len;
pkt_r->pkt_len = pkt_r->data_len;
ipv4->packet_id = ipv4_base->packet_id;
ipv4->total_length = htons(pkt_r->pkt_len - pkt_r->l2_len);
udp->dgram_len = htons(pkt_r->pkt_len - pkt_r->l2_len - pkt_r->l3_len);
if (!s->eth_ipv4_cksum_offload[MTL_SESSION_PORT_R]) {
Expand Down Expand Up @@ -938,10 +937,6 @@ static int tv_build_st20(struct st_tx_video_session_impl* s, struct rte_mbuf* pk
/* copy the basic hdrs: eth, ip, udp, rtp */
rte_memcpy(hdr, &s->s_hdr[MTL_SESSION_PORT_P], sizeof(*hdr));

/* update ipv4 hdr */
ipv4->packet_id = htons(s->st20_ipv4_packet_id);
s->st20_ipv4_packet_id++;

if (s->multi_src_port) udp->src_port += (s->st20_pkt_idx / 128) % 8;

/* calculate payload header */
Expand Down Expand Up @@ -1044,10 +1039,6 @@ static int tv_build_st20_chain(struct st_tx_video_session_impl* s, struct rte_mb
/* copy the hdr: eth, ip, udp, rtp */
rte_memcpy(hdr, &s->s_hdr[MTL_SESSION_PORT_P], sizeof(*hdr));

/* update ipv4 hdr */
ipv4->packet_id = htons(s->st20_ipv4_packet_id);
s->st20_ipv4_packet_id++;

if (s->multi_src_port) udp->src_port += (s->st20_pkt_idx / 128) % 8;

if (single_line) {
Expand Down Expand Up @@ -1150,7 +1141,6 @@ static int tv_build_st20_redundant_chain(struct st_tx_video_session_impl* s,
struct st_rfc4175_video_hdr* hdr;
struct st_rfc4175_video_hdr* hdr_base;
struct rte_ipv4_hdr* ipv4;
struct rte_ipv4_hdr* ipv4_base;
struct st20_rfc4175_rtp_hdr* rtp;
struct st20_rfc4175_rtp_hdr* rtp_base;

Expand All @@ -1163,10 +1153,6 @@ static int tv_build_st20_redundant_chain(struct st_tx_video_session_impl* s,

/* update rtp */
hdr_base = rte_pktmbuf_mtod(pkt_base, struct st_rfc4175_video_hdr*);
ipv4_base = &hdr_base->ipv4;
/* update ipv4 hdr */
ipv4->packet_id = ipv4_base->packet_id;

rtp_base = &hdr_base->rtp;
rte_memcpy(rtp, rtp_base, sizeof(*rtp));

Expand Down Expand Up @@ -1216,10 +1202,6 @@ static int tv_build_rtp(struct mtl_main_impl* impl, struct st_tx_video_session_i
rte_memcpy(ipv4, &s->s_hdr[MTL_SESSION_PORT_P].ipv4, sizeof(hdr->ipv4));
rte_memcpy(udp, &s->s_hdr[MTL_SESSION_PORT_P].udp, sizeof(hdr->udp));

/* update ipv4 hdr */
ipv4->packet_id = htons(s->st20_ipv4_packet_id);
s->st20_ipv4_packet_id++;

if (s->multi_src_port) udp->src_port += (s->st20_pkt_idx / 128) % 8;

if (rtp->tmstamp != s->st20_rtp_time) {
Expand Down Expand Up @@ -1276,10 +1258,6 @@ static int tv_build_rtp_chain(struct mtl_main_impl* impl,
rte_memcpy(ipv4, &s->s_hdr[MTL_SESSION_PORT_P].ipv4, sizeof(hdr->ipv4));
rte_memcpy(udp, &s->s_hdr[MTL_SESSION_PORT_P].udp, sizeof(hdr->udp));

/* update ipv4 hdr */
ipv4->packet_id = htons(s->st20_ipv4_packet_id);
s->st20_ipv4_packet_id++;

if (s->multi_src_port) udp->src_port += (s->st20_pkt_idx / 128) % 8;

if (rtp->tmstamp != s->st20_rtp_time) {
Expand Down Expand Up @@ -1325,22 +1303,17 @@ static int tv_build_rtp_chain(struct mtl_main_impl* impl,
static int tv_build_rtp_redundant_chain(struct st_tx_video_session_impl* s,
struct rte_mbuf* pkt_r,
struct rte_mbuf* pkt_base) {
struct rte_ipv4_hdr *ipv4, *ipv4_base;
struct mt_udp_hdr *hdr, *hdr_base;
struct rte_ipv4_hdr* ipv4;
struct mt_udp_hdr* hdr;

hdr = rte_pktmbuf_mtod(pkt_r, struct mt_udp_hdr*);
ipv4 = &hdr->ipv4;
hdr_base = rte_pktmbuf_mtod(pkt_base, struct mt_udp_hdr*);
ipv4_base = &hdr_base->ipv4;

/* copy the hdr: eth, ip, udp */
rte_memcpy(&hdr->eth, &s->s_hdr[MTL_SESSION_PORT_R].eth, sizeof(hdr->eth));
rte_memcpy(ipv4, &s->s_hdr[MTL_SESSION_PORT_R].ipv4, sizeof(hdr->ipv4));
rte_memcpy(&hdr->udp, &s->s_hdr[MTL_SESSION_PORT_R].udp, sizeof(hdr->udp));

/* update ipv4 hdr */
ipv4->packet_id = ipv4_base->packet_id;

/* update mbuf */
pkt_r->data_len = pkt_base->data_len;
pkt_r->pkt_len = pkt_base->pkt_len;
Expand Down Expand Up @@ -1382,10 +1355,6 @@ static int tv_build_st22(struct st_tx_video_session_impl* s, struct rte_mbuf* pk
/* copy rtp */
rte_memcpy(rtp, &st22_info->rtp_hdr[MTL_SESSION_PORT_P], sizeof(*rtp));

/* update ipv4 hdr */
ipv4->packet_id = htons(s->st20_ipv4_packet_id);
s->st20_ipv4_packet_id++;

/* update rtp */
if (s->st20_pkt_idx >= (st22_info->st22_total_pkts - 1)) {
rtp->base.marker = 1;
Expand Down Expand Up @@ -1452,10 +1421,6 @@ static int tv_build_st22_chain(struct st_tx_video_session_impl* s, struct rte_mb
/* copy rtp */
rte_memcpy(rtp, &st22_info->rtp_hdr[MTL_SESSION_PORT_P], sizeof(*rtp));

/* update ipv4 hdr */
ipv4->packet_id = htons(s->st20_ipv4_packet_id);
s->st20_ipv4_packet_id++;

/* update rtp */
if (s->st20_pkt_idx >= (st22_info->st22_total_pkts - 1)) {
rtp->base.marker = 1;
Expand Down Expand Up @@ -1520,7 +1485,6 @@ static int tv_build_st22_redundant_chain(struct st_tx_video_session_impl* s,
struct st22_rfc9134_video_hdr* hdr;
struct st22_rfc9134_video_hdr* hdr_base;
struct rte_ipv4_hdr* ipv4;
struct rte_ipv4_hdr* ipv4_base;
struct st22_rfc9134_rtp_hdr* rtp;
struct st22_rfc9134_rtp_hdr* rtp_base;

Expand All @@ -1533,10 +1497,6 @@ static int tv_build_st22_redundant_chain(struct st_tx_video_session_impl* s,

/* update rtp */
hdr_base = rte_pktmbuf_mtod(pkt_base, struct st22_rfc9134_video_hdr*);
ipv4_base = &hdr_base->ipv4;
/* update ipv4 hdr */
ipv4->packet_id = ipv4_base->packet_id;

rtp_base = &hdr_base->rtp;
rte_memcpy(rtp, rtp_base, sizeof(*rtp));

Expand Down Expand Up @@ -2970,7 +2930,6 @@ static int tv_attach(struct mtl_main_impl* impl, struct st_tx_video_sessions_mgr
/* manually disable chain or any port can't support chain */
s->tx_no_chain = mt_has_tx_no_chain(impl) || !tv_has_chain_buf(s);
s->multi_src_port = mt_multi_src_port(impl);
s->st20_ipv4_packet_id = 0;

s->ring_count = ST_TX_VIDEO_SESSIONS_RING_SIZE;
/* make sure the ring is smaller than total pkts */
Expand Down Expand Up @@ -3727,9 +3686,6 @@ int st20_frame_tx_start(struct mtl_main_impl* impl, struct st_tx_video_session_i
/* copy the basic hdrs: eth, ip, udp, rtp */
rte_memcpy(hdr, &s->s_hdr[s_port], sizeof(*hdr));

/* update ipv4 hdr */
ipv4->packet_id = htons(s->st20_ipv4_packet_id);
s->st20_ipv4_packet_id++;
/* set timestamp */
rtp->base.tmstamp = htonl(s->pacing.rtp_time_stamp);
/* indicate it's user meta pkt */
Expand Down
4 changes: 0 additions & 4 deletions lib/src/udp/udp_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,6 @@ static int udp_build_tx_pkt(struct mtl_main_impl* impl, struct mudp_impl* s,
}

/* ip */
ipv4->packet_id = htons(s->ipv4_packet_id);
s->ipv4_packet_id++;
mtl_memcpy(&ipv4->dst_addr, dip, MTL_IP_ADDR_LEN);

/* udp */
Expand Down Expand Up @@ -276,8 +274,6 @@ static int udp_build_tx_msg_pkt(struct mtl_main_impl* impl, struct mudp_impl* s,
/* update dst mac */
rte_memcpy(mt_eth_d_addr(eth), &d_addr, sizeof(d_addr));
/* ip */
ipv4->packet_id = htons(s->ipv4_packet_id);
s->ipv4_packet_id++;
mtl_memcpy(&ipv4->dst_addr, dip, MTL_IP_ADDR_LEN);
/* udp */
udp->dst_port = addr_in->sin_port;
Expand Down
Loading

0 comments on commit b0447ed

Please sign in to comment.