X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fpcap%2Frte_eth_pcap.c;h=7655b3a7a5faa37b516055027be0e67bc08b5fba;hb=6d13ea8e8e49ab957deae2bba5ecf4a4bfe747d1;hp=65bbd7e2f4a31c7b5faeba49bea84d2dd1352b5c;hpb=9b3d42207c35516b1c62fbdf19da288e5c3d8356;p=dpdk.git diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c index 65bbd7e2f4..7655b3a7a5 100644 --- a/drivers/net/pcap/rte_eth_pcap.c +++ b/drivers/net/pcap/rte_eth_pcap.c @@ -11,7 +11,7 @@ #include #include -#if defined(RTE_EXEC_ENV_BSDAPP) +#if defined(RTE_EXEC_ENV_FREEBSD) #include #include #endif @@ -78,7 +78,7 @@ struct pmd_internals { struct pcap_rx_queue rx_queue[RTE_PMD_PCAP_MAX_QUEUES]; struct pcap_tx_queue tx_queue[RTE_PMD_PCAP_MAX_QUEUES]; char devargs[ETH_PCAP_ARG_MAXLEN]; - struct ether_addr eth_addr; + struct rte_ether_addr eth_addr; int if_index; int single_iface; int phy_mac; @@ -953,7 +953,7 @@ pmd_init_internals(struct rte_vdev_device *vdev, * derived from: 'locally administered':'p':'c':'a':'p':'iface_idx' * where the middle 4 characters are converted to hex. */ - (*internals)->eth_addr = (struct ether_addr) { + (*internals)->eth_addr = (struct rte_ether_addr) { .addr_bytes = { 0x02, 0x70, 0x63, 0x61, 0x70, iface_idx++ } }; (*internals)->phy_mac = 0; @@ -979,7 +979,7 @@ static int eth_pcap_update_mac(const char *if_name, struct rte_eth_dev *eth_dev, const unsigned int numa_node) { -#if defined(RTE_EXEC_ENV_LINUXAPP) +#if defined(RTE_EXEC_ENV_LINUX) void *mac_addrs; struct ifreq ifr; int if_fd = socket(AF_INET, SOCK_DGRAM, 0); @@ -1008,7 +1008,7 @@ eth_pcap_update_mac(const char *if_name, struct rte_eth_dev *eth_dev, return 0; -#elif defined(RTE_EXEC_ENV_BSDAPP) +#elif defined(RTE_EXEC_ENV_FREEBSD) void *mac_addrs; struct if_msghdr *ifm; struct sockaddr_dl *sdl; @@ -1084,8 +1084,8 @@ eth_from_pcaps_common(struct rte_vdev_device *vdev, struct devargs_queue *queue = &rx_queues->queue[i]; pp->rx_pcap[i] = queue->pcap; - snprintf(rx->name, sizeof(rx->name), "%s", queue->name); - snprintf(rx->type, sizeof(rx->type), "%s", queue->type); + strlcpy(rx->name, queue->name, sizeof(rx->name)); + strlcpy(rx->type, queue->type, sizeof(rx->type)); } for (i = 0; i < nb_tx_queues; i++) { @@ -1094,8 +1094,8 @@ eth_from_pcaps_common(struct rte_vdev_device *vdev, pp->tx_dumper[i] = queue->dumper; pp->tx_pcap[i] = queue->pcap; - snprintf(tx->name, sizeof(tx->name), "%s", queue->name); - snprintf(tx->type, sizeof(tx->type), "%s", queue->type); + strlcpy(tx->name, queue->name, sizeof(tx->name)); + strlcpy(tx->type, queue->type, sizeof(tx->type)); } return 0;