X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=connect.c;h=56771249e234bc14bd5234a68b5565f08688eb14;hb=9ae0d10319434efe95ac6939f4f2c1c3edf1c48b;hp=74e457859faaf0fe69edc048070641bb69031c9a;hpb=5727fe03911189df164a90d06ac1f3c6a134af81;p=thirdparty%2Fiw.git diff --git a/connect.c b/connect.c index 74e4578..5677124 100644 --- a/connect.c +++ b/connect.c @@ -9,7 +9,7 @@ #include "nl80211.h" #include "iw.h" -static int iw_conn(struct nl80211_state *state, struct nl_cb *cb, +static int iw_conn(struct nl80211_state *state, struct nl_msg *msg, int argc, char **argv, enum id_input id) { @@ -59,7 +59,6 @@ static int iw_conn(struct nl80211_state *state, struct nl_cb *cb, } static int disconnect(struct nl80211_state *state, - struct nl_cb *cb, struct nl_msg *msg, int argc, char **argv, enum id_input id) @@ -70,7 +69,7 @@ TOPLEVEL(disconnect, NULL, NL80211_CMD_DISCONNECT, 0, CIB_NETDEV, disconnect, "Disconnect from the current network."); -static int iw_connect(struct nl80211_state *state, struct nl_cb *cb, +static int iw_connect(struct nl80211_state *state, struct nl_msg *msg, int argc, char **argv, enum id_input id) { @@ -94,15 +93,15 @@ static int iw_connect(struct nl80211_state *state, struct nl_cb *cb, argv++; } + err = __prepare_listen_events(state); + if (err) + return err; + conn_argc = 3 + argc; conn_argv = calloc(conn_argc, sizeof(*conn_argv)); if (!conn_argv) return -ENOMEM; - err = __prepare_listen_events(state); - if (err) - return err; - conn_argv[0] = dev; conn_argv[1] = "connect"; conn_argv[2] = "establish"; @@ -146,7 +145,7 @@ TOPLEVEL(connect, "[-w] [] [] [key 0:abcde d:1:616263 "With -w, wait for the connect to finish or fail."); HIDDEN(connect, establish, "", NL80211_CMD_CONNECT, 0, CIB_NETDEV, iw_conn); -static int iw_auth(struct nl80211_state *state, struct nl_cb *cb, +static int iw_auth(struct nl80211_state *state, struct nl_msg *msg, int argc, char **argv, enum id_input id) {