libnl supports callbacks for send and recv. This patch enables callbacks
for sent messages and uses the debug callback for the --debug option, as
the recv callbacks do.
Signed-off-by: Sean Robinson <seankrobinson@gmail.com>
{
const struct cmd *cmd, *match = NULL, *sectcmd;
struct nl_cb *cb;
+ struct nl_cb *s_cb;
struct nl_msg *msg;
int devidx = 0;
int err, o_argc;
}
cb = nl_cb_alloc(iw_debug ? NL_CB_DEBUG : NL_CB_DEFAULT);
- if (!cb) {
+ s_cb = nl_cb_alloc(iw_debug ? NL_CB_DEBUG : NL_CB_DEFAULT);
+ if (!cb || !s_cb) {
fprintf(stderr, "failed to allocate netlink callbacks\n");
err = 2;
goto out_free_msg;
if (err)
goto out;
+ nl_socket_set_cb(state->nl_sock, s_cb);
+
err = nl_send_auto_complete(state->nl_sock, msg);
if (err < 0)
goto out;