From: Felix Fietkau Date: Tue, 5 Dec 2023 11:46:24 +0000 (+0100) Subject: socket: call rx debug callback once per packet instead of per batch X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=785e11aee7ddf1ce302e7c91d6207ec777ea13c6;p=project%2Flibnl-tiny.git socket: call rx debug callback once per packet instead of per batch When receiving a batch, split up calls Signed-off-by: Felix Fietkau --- diff --git a/nl.c b/nl.c index fee0529..b0f43e2 100644 --- a/nl.c +++ b/nl.c @@ -472,9 +472,6 @@ retry: } } - if (sk->s_debug_rx_cb) - sk->s_debug_rx_cb(sk->s_debug_rx_priv, *buf, n); - free(msg.msg_control); return n; @@ -536,6 +533,9 @@ continue_reading: goto out; } + if (sk->s_debug_rx_cb) + sk->s_debug_rx_cb(sk->s_debug_rx_priv, hdr, hdr->nlmsg_len); + nlmsg_set_proto(msg, sk->s_proto); nlmsg_set_src(msg, &nla); if (creds)