gnrc_sock_ip: fix memcpy()/memset() sizeof-type
The type in the `sizeof()` is just plain wrong. This fixes it.
This commit is contained in:
parent
0c22fffcd1
commit
653e36277c
@ -27,7 +27,7 @@
|
|||||||
#include "gnrc_sock_internal.h"
|
#include "gnrc_sock_internal.h"
|
||||||
|
|
||||||
int sock_ip_create(sock_ip_t *sock, const sock_ip_ep_t *local,
|
int sock_ip_create(sock_ip_t *sock, const sock_ip_ep_t *local,
|
||||||
const sock_ip_ep_t *remote, uint8_t proto, uint16_t flags)
|
const sock_ip_ep_t *remote, uint8_t proto, uint16_t flags)
|
||||||
{
|
{
|
||||||
assert(sock);
|
assert(sock);
|
||||||
if ((local != NULL) && (remote != NULL) &&
|
if ((local != NULL) && (remote != NULL) &&
|
||||||
@ -36,14 +36,14 @@ int sock_ip_create(sock_ip_t *sock, const sock_ip_ep_t *local,
|
|||||||
(local->netif != remote->netif)) {
|
(local->netif != remote->netif)) {
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
memset(&sock->local, 0, sizeof(sock_ip_t));
|
memset(&sock->local, 0, sizeof(sock_ip_ep_t));
|
||||||
if (local != NULL) {
|
if (local != NULL) {
|
||||||
if (gnrc_af_not_supported(local->family)) {
|
if (gnrc_af_not_supported(local->family)) {
|
||||||
return -EAFNOSUPPORT;
|
return -EAFNOSUPPORT;
|
||||||
}
|
}
|
||||||
memcpy(&sock->local, local, sizeof(sock_ip_t));
|
memcpy(&sock->local, local, sizeof(sock_ip_ep_t));
|
||||||
}
|
}
|
||||||
memset(&sock->remote, 0, sizeof(sock_ip_t));
|
memset(&sock->remote, 0, sizeof(sock_ip_ep_t));
|
||||||
if (remote != NULL) {
|
if (remote != NULL) {
|
||||||
if (gnrc_af_not_supported(remote->family)) {
|
if (gnrc_af_not_supported(remote->family)) {
|
||||||
return -EAFNOSUPPORT;
|
return -EAFNOSUPPORT;
|
||||||
@ -51,7 +51,7 @@ int sock_ip_create(sock_ip_t *sock, const sock_ip_ep_t *local,
|
|||||||
if (gnrc_ep_addr_any(remote)) {
|
if (gnrc_ep_addr_any(remote)) {
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
memcpy(&sock->remote, remote, sizeof(sock_ip_t));
|
memcpy(&sock->remote, remote, sizeof(sock_ip_ep_t));
|
||||||
}
|
}
|
||||||
gnrc_sock_create(&sock->reg, GNRC_NETTYPE_IPV6,
|
gnrc_sock_create(&sock->reg, GNRC_NETTYPE_IPV6,
|
||||||
proto);
|
proto);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user