{
int ret;
- if (sk->s_debug_tx_cb)
- sk->s_debug_tx_cb(sk->s_debug_tx_priv, buf, size);
-
ret = sendto(sk->s_fd, buf, size, 0, (struct sockaddr *)
&sk->s_peer, sizeof(sk->s_peer));
if (ret < 0)
if (nl_cb_call(cb, NL_CB_MSG_OUT, msg) != NL_OK)
return 0;
- if (sk->s_debug_tx_cb)
- sk->s_debug_tx_cb(sk->s_debug_tx_priv, iov.iov_base, iov.iov_len);
+ if (sk->s_debug_tx_cb) {
+ nlmsg_set_proto(msg, sk->s_proto);
+ sk->s_debug_tx_cb(sk->s_debug_tx_priv, msg);
+ }
ret = sendmsg(sk->s_fd, hdr, 0);
if (ret < 0)
}
}
- if (sk->s_debug_rx_cb)
- sk->s_debug_rx_cb(sk->s_debug_rx_priv, *buf, n);
-
free(msg.msg_control);
return n;
if (creds)
nlmsg_set_creds(msg, creds);
+ if (sk->s_debug_rx_cb)
+ sk->s_debug_rx_cb(sk->s_debug_rx_priv, msg);
+
/* Raw callback is the first, it gives the most control
* to the user and he can do his very own parsing. */
if (cb->cb_set[NL_CB_MSG_IN])