Merge pull request #15757 from maribu/sock-aux-cleanup
sys/net/gnrc/sock: cleanup & fix aux handling
This commit is contained in:
commit
9029d6f7c2
@ -158,18 +158,13 @@ ssize_t sock_ip_recv_buf_aux(sock_ip_t *sock, void **data, void **buf_ctx,
|
||||
return -EPROTO;
|
||||
}
|
||||
#if IS_USED(MODULE_SOCK_AUX_LOCAL)
|
||||
if ((aux != NULL) && (aux->flags & SOCK_AUX_GET_LOCAL)) {
|
||||
if (aux != NULL) {
|
||||
aux->flags &= ~(SOCK_AUX_GET_LOCAL);
|
||||
}
|
||||
#endif
|
||||
#if IS_USED(MODULE_SOCK_AUX_TIMESTAMP)
|
||||
if ((aux != NULL) && (aux->flags & SOCK_AUX_GET_TIMESTAMP)) {
|
||||
/* check if network interface did provide a timestamp; this depends on
|
||||
* hardware support. A timestamp of zero is used to indicate a missing
|
||||
* timestamp */
|
||||
if (aux->timestamp > 0) {
|
||||
aux->flags &= ~SOCK_AUX_GET_TIMESTAMP;
|
||||
}
|
||||
if ((aux != NULL) && (_aux.flags & GNRC_SOCK_RECV_AUX_FLAG_TIMESTAMP)) {
|
||||
aux->flags &= ~(SOCK_AUX_GET_TIMESTAMP);
|
||||
}
|
||||
#endif
|
||||
*data = pkt->data;
|
||||
|
||||
@ -258,13 +258,8 @@ ssize_t sock_udp_recv_buf_aux(sock_udp_t *sock, void **data, void **buf_ctx,
|
||||
}
|
||||
#endif
|
||||
#if IS_USED(MODULE_SOCK_AUX_TIMESTAMP)
|
||||
if ((aux != NULL) && (aux->flags & SOCK_AUX_GET_TIMESTAMP)) {
|
||||
/* check if network interface did provide a timestamp; this depends on
|
||||
* hardware support. A timestamp of zero is used to indicate a missing
|
||||
* timestamp */
|
||||
if (_aux.flags & GNRC_SOCK_RECV_AUX_FLAG_TIMESTAMP) {
|
||||
aux->flags &= ~SOCK_AUX_GET_TIMESTAMP;
|
||||
}
|
||||
if ((aux != NULL) && (_aux.flags & GNRC_SOCK_RECV_AUX_FLAG_TIMESTAMP)) {
|
||||
aux->flags &= ~SOCK_AUX_GET_TIMESTAMP;
|
||||
}
|
||||
#endif
|
||||
*data = pkt->data;
|
||||
|
||||
@ -7,7 +7,7 @@ ifeq (1, $(AUX_LOCAL))
|
||||
USEMODULE += sock_aux_local
|
||||
endif
|
||||
|
||||
ifeq (1, $(AUX_LOCAL))
|
||||
ifeq (1, $(AUX_TIMESTAMP))
|
||||
USEMODULE += sock_aux_timestamp
|
||||
endif
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ ifeq (1, $(AUX_LOCAL))
|
||||
USEMODULE += sock_aux_local
|
||||
endif
|
||||
|
||||
ifeq (1, $(AUX_LOCAL))
|
||||
ifeq (1, $(AUX_TIMESTAMP))
|
||||
USEMODULE += sock_aux_timestamp
|
||||
endif
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user