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;
|
return -EPROTO;
|
||||||
}
|
}
|
||||||
#if IS_USED(MODULE_SOCK_AUX_LOCAL)
|
#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);
|
aux->flags &= ~(SOCK_AUX_GET_LOCAL);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if IS_USED(MODULE_SOCK_AUX_TIMESTAMP)
|
#if IS_USED(MODULE_SOCK_AUX_TIMESTAMP)
|
||||||
if ((aux != NULL) && (aux->flags & SOCK_AUX_GET_TIMESTAMP)) {
|
if ((aux != NULL) && (_aux.flags & GNRC_SOCK_RECV_AUX_FLAG_TIMESTAMP)) {
|
||||||
/* check if network interface did provide a timestamp; this depends on
|
aux->flags &= ~(SOCK_AUX_GET_TIMESTAMP);
|
||||||
* hardware support. A timestamp of zero is used to indicate a missing
|
|
||||||
* timestamp */
|
|
||||||
if (aux->timestamp > 0) {
|
|
||||||
aux->flags &= ~SOCK_AUX_GET_TIMESTAMP;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
*data = pkt->data;
|
*data = pkt->data;
|
||||||
|
|||||||
@ -258,13 +258,8 @@ ssize_t sock_udp_recv_buf_aux(sock_udp_t *sock, void **data, void **buf_ctx,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if IS_USED(MODULE_SOCK_AUX_TIMESTAMP)
|
#if IS_USED(MODULE_SOCK_AUX_TIMESTAMP)
|
||||||
if ((aux != NULL) && (aux->flags & SOCK_AUX_GET_TIMESTAMP)) {
|
if ((aux != NULL) && (_aux.flags & GNRC_SOCK_RECV_AUX_FLAG_TIMESTAMP)) {
|
||||||
/* check if network interface did provide a timestamp; this depends on
|
aux->flags &= ~SOCK_AUX_GET_TIMESTAMP;
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
*data = pkt->data;
|
*data = pkt->data;
|
||||||
|
|||||||
@ -7,7 +7,7 @@ ifeq (1, $(AUX_LOCAL))
|
|||||||
USEMODULE += sock_aux_local
|
USEMODULE += sock_aux_local
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq (1, $(AUX_LOCAL))
|
ifeq (1, $(AUX_TIMESTAMP))
|
||||||
USEMODULE += sock_aux_timestamp
|
USEMODULE += sock_aux_timestamp
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@ ifeq (1, $(AUX_LOCAL))
|
|||||||
USEMODULE += sock_aux_local
|
USEMODULE += sock_aux_local
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq (1, $(AUX_LOCAL))
|
ifeq (1, $(AUX_TIMESTAMP))
|
||||||
USEMODULE += sock_aux_timestamp
|
USEMODULE += sock_aux_timestamp
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user