Skip to content

Commit 7645c66

Browse files
authored
Merge pull request #10336 from miri64/backport/2018.10/emb6/fix/sock-info-src
emb6_sock_udp: copy receive remote correctly [backport 2018.10]
2 parents 40938f1 + 3b9b212 commit 7645c66

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/emb6/contrib/sock/udp/emb6_sock_udp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ int sock_udp_recv(sock_udp_t *sock, void *data, size_t max_len,
187187
if (remote != NULL) {
188188
remote->family = AF_INET6;
189189
remote->netif = SOCK_ADDR_ANY_NETIF;
190-
memcpy(&remote->addr, &sock->recv_info.src, sizeof(ipv6_addr_t));
190+
memcpy(&remote->addr, sock->recv_info.src, sizeof(ipv6_addr_t));
191191
remote->port = sock->recv_info.src_port;
192192
}
193193
res = (int)sock->recv_info.datalen;
@@ -235,11 +235,11 @@ int sock_udp_send(sock_udp_t *sock, const void *data, size_t len,
235235
else if (sock->sock.udp_conn->rport == 0) {
236236
return -ENOTCONN;
237237
}
238-
/* cppcheck-supress nullPointerRedundantCheck
239-
* remote == NULL implies that sock != NULL (see assert at start of
238+
/* cppcheck-suppress nullPointerRedundantCheck
239+
* (reason: remote == NULL implies that sock != NULL (see assert at start of
240240
* function) * that's why it is okay in the if-statement above to check
241241
* sock->... without checking (sock != NULL) first => this check afterwards
242-
* isn't redundant */
242+
* isn't redundant) */
243243
if (sock == NULL) {
244244
int res;
245245
if ((res = _reg(&tmp, NULL, NULL, NULL, NULL)) < 0) {

0 commit comments

Comments
 (0)