From 396297a993b03772165413ee9cd30fe4d89af87e Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Tue, 3 Aug 2021 10:33:17 +0800 Subject: [PATCH] [ethernetif] replace rt_memcpy with SMEMCPY --- components/net/lwip-1.4.1/src/netif/ethernetif.c | 8 ++++---- components/net/lwip-2.0.2/src/netif/ethernetif.c | 8 ++++---- components/net/lwip-2.0.3/src/netif/ethernetif.c | 8 ++++---- components/net/lwip-2.1.2/src/netif/ethernetif.c | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/components/net/lwip-1.4.1/src/netif/ethernetif.c b/components/net/lwip-1.4.1/src/netif/ethernetif.c index 4565f5e528..40cd8fb6ef 100644 --- a/components/net/lwip-1.4.1/src/netif/ethernetif.c +++ b/components/net/lwip-1.4.1/src/netif/ethernetif.c @@ -201,14 +201,14 @@ int lwip_netdev_ping(struct netdev *netif, const char *host, size_t data_len, { return -RT_ERROR; } - rt_memcpy(&h, &res->ai_addr, sizeof(struct sockaddr_in *)); - rt_memcpy(&ina, &h->sin_addr, sizeof(ina)); + SMEMCPY(&h, &res->ai_addr, sizeof(struct sockaddr_in *)); + SMEMCPY(&ina, &h->sin_addr, sizeof(ina)); lwip_freeaddrinfo(res); if (inet_aton(inet_ntoa(ina), &target_addr) == 0) { return -RT_ERROR; } - rt_memcpy(&(ping_resp->ip_addr), &target_addr, sizeof(ip_addr_t)); + SMEMCPY(&(ping_resp->ip_addr), &target_addr, sizeof(ip_addr_t)); /* new a socket */ if ((s = lwip_socket(AF_INET, SOCK_RAW, IP_PROTO_ICMP)) < 0) @@ -331,7 +331,7 @@ static int netdev_add(struct netif *lwip_netif) netdev->mtu = lwip_netif->mtu; netdev->ops = &lwip_netdev_ops; netdev->hwaddr_len = lwip_netif->hwaddr_len; - rt_memcpy(netdev->hwaddr, lwip_netif->hwaddr, lwip_netif->hwaddr_len); + SMEMCPY(netdev->hwaddr, lwip_netif->hwaddr, lwip_netif->hwaddr_len); netdev->ip_addr = lwip_netif->ip_addr; netdev->gw = lwip_netif->gw; netdev->netmask = lwip_netif->netmask; diff --git a/components/net/lwip-2.0.2/src/netif/ethernetif.c b/components/net/lwip-2.0.2/src/netif/ethernetif.c index 1c0f3ca9b2..0b1943fdff 100644 --- a/components/net/lwip-2.0.2/src/netif/ethernetif.c +++ b/components/net/lwip-2.0.2/src/netif/ethernetif.c @@ -210,14 +210,14 @@ int lwip_netdev_ping(struct netdev *netif, const char *host, size_t data_len, { return -RT_ERROR; } - rt_memcpy(&h, &res->ai_addr, sizeof(struct sockaddr_in *)); - rt_memcpy(&ina, &h->sin_addr, sizeof(ina)); + SMEMCPY(&h, &res->ai_addr, sizeof(struct sockaddr_in *)); + SMEMCPY(&ina, &h->sin_addr, sizeof(ina)); lwip_freeaddrinfo(res); if (inet_aton(inet_ntoa(ina), &target_addr) == 0) { return -RT_ERROR; } - rt_memcpy(&(ping_resp->ip_addr), &target_addr, sizeof(ip_addr_t)); + SMEMCPY(&(ping_resp->ip_addr), &target_addr, sizeof(ip_addr_t)); /* new a socket */ if ((s = lwip_socket(AF_INET, SOCK_RAW, IP_PROTO_ICMP)) < 0) @@ -340,7 +340,7 @@ static int netdev_add(struct netif *lwip_netif) netdev->mtu = lwip_netif->mtu; netdev->ops = &lwip_netdev_ops; netdev->hwaddr_len = lwip_netif->hwaddr_len; - rt_memcpy(netdev->hwaddr, lwip_netif->hwaddr, lwip_netif->hwaddr_len); + SMEMCPY(netdev->hwaddr, lwip_netif->hwaddr, lwip_netif->hwaddr_len); netdev->ip_addr = lwip_netif->ip_addr; netdev->gw = lwip_netif->gw; netdev->netmask = lwip_netif->netmask; diff --git a/components/net/lwip-2.0.3/src/netif/ethernetif.c b/components/net/lwip-2.0.3/src/netif/ethernetif.c index 1c0f3ca9b2..0b1943fdff 100644 --- a/components/net/lwip-2.0.3/src/netif/ethernetif.c +++ b/components/net/lwip-2.0.3/src/netif/ethernetif.c @@ -210,14 +210,14 @@ int lwip_netdev_ping(struct netdev *netif, const char *host, size_t data_len, { return -RT_ERROR; } - rt_memcpy(&h, &res->ai_addr, sizeof(struct sockaddr_in *)); - rt_memcpy(&ina, &h->sin_addr, sizeof(ina)); + SMEMCPY(&h, &res->ai_addr, sizeof(struct sockaddr_in *)); + SMEMCPY(&ina, &h->sin_addr, sizeof(ina)); lwip_freeaddrinfo(res); if (inet_aton(inet_ntoa(ina), &target_addr) == 0) { return -RT_ERROR; } - rt_memcpy(&(ping_resp->ip_addr), &target_addr, sizeof(ip_addr_t)); + SMEMCPY(&(ping_resp->ip_addr), &target_addr, sizeof(ip_addr_t)); /* new a socket */ if ((s = lwip_socket(AF_INET, SOCK_RAW, IP_PROTO_ICMP)) < 0) @@ -340,7 +340,7 @@ static int netdev_add(struct netif *lwip_netif) netdev->mtu = lwip_netif->mtu; netdev->ops = &lwip_netdev_ops; netdev->hwaddr_len = lwip_netif->hwaddr_len; - rt_memcpy(netdev->hwaddr, lwip_netif->hwaddr, lwip_netif->hwaddr_len); + SMEMCPY(netdev->hwaddr, lwip_netif->hwaddr, lwip_netif->hwaddr_len); netdev->ip_addr = lwip_netif->ip_addr; netdev->gw = lwip_netif->gw; netdev->netmask = lwip_netif->netmask; diff --git a/components/net/lwip-2.1.2/src/netif/ethernetif.c b/components/net/lwip-2.1.2/src/netif/ethernetif.c index 81dd792f29..bd4db225ee 100644 --- a/components/net/lwip-2.1.2/src/netif/ethernetif.c +++ b/components/net/lwip-2.1.2/src/netif/ethernetif.c @@ -208,14 +208,14 @@ int lwip_netdev_ping(struct netdev *netif, const char *host, size_t data_len, { return -RT_ERROR; } - rt_memcpy(&h, &res->ai_addr, sizeof(struct sockaddr_in *)); - rt_memcpy(&ina, &h->sin_addr, sizeof(ina)); + SMEMCPY(&h, &res->ai_addr, sizeof(struct sockaddr_in *)); + SMEMCPY(&ina, &h->sin_addr, sizeof(ina)); lwip_freeaddrinfo(res); if (inet_aton(inet_ntoa(ina), &target_addr) == 0) { return -RT_ERROR; } - rt_memcpy(&(ping_resp->ip_addr), &target_addr, sizeof(ip_addr_t)); + SMEMCPY(&(ping_resp->ip_addr), &target_addr, sizeof(ip_addr_t)); /* new a socket */ if ((s = lwip_socket(AF_INET, SOCK_RAW, IP_PROTO_ICMP)) < 0) @@ -338,7 +338,7 @@ static int netdev_add(struct netif *lwip_netif) netdev->mtu = lwip_netif->mtu; netdev->ops = &lwip_netdev_ops; netdev->hwaddr_len = lwip_netif->hwaddr_len; - rt_memcpy(netdev->hwaddr, lwip_netif->hwaddr, lwip_netif->hwaddr_len); + SMEMCPY(netdev->hwaddr, lwip_netif->hwaddr, lwip_netif->hwaddr_len); netdev->ip_addr = lwip_netif->ip_addr; netdev->gw = lwip_netif->gw; netdev->netmask = lwip_netif->netmask; -- GitLab