X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest-pmd%2Fieee1588fwd.c;h=51170ee3eb147f567e78e048c5bb65441f1ca55b;hb=636615142baad5d5c27556942528e661f3586029;hp=c69023afe760e2ee526403bb7542722f5b3d8ccb;hpb=8a45731c028ec6f12c3209e07a8715346b8a4b62;p=dpdk.git diff --git a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c index c69023afe7..51170ee3eb 100644 --- a/app/test-pmd/ieee1588fwd.c +++ b/app/test-pmd/ieee1588fwd.c @@ -34,6 +34,7 @@ #include #include +#include #include "testpmd.h" @@ -123,6 +124,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs) { struct rte_mbuf *mb; struct ether_hdr *eth_hdr; + struct ether_addr addr; struct ptpv2_msg *ptp_hdr; uint16_t eth_type; uint32_t timesync_index; @@ -205,6 +207,11 @@ ieee1588_packet_fwd(struct fwd_stream *fs) /* Read and check the RX timestamp. */ port_ieee1588_rx_timestamp_check(fs->rx_port, timesync_index); + /* Swap dest and src mac addresses. */ + ether_addr_copy(ð_hdr->d_addr, &addr); + ether_addr_copy(ð_hdr->s_addr, ð_hdr->d_addr); + ether_addr_copy(&addr, ð_hdr->s_addr); + /* Forward PTP packet with hardware TX timestamp */ mb->ol_flags |= PKT_TX_IEEE1588_TMST; fs->tx_packets += 1;