]> git.ipfire.org Git - thirdparty/iw.git/blobdiff - reg.c
iw: scan: fix buffer over-read in print_wifi_wps
[thirdparty/iw.git] / reg.c
diff --git a/reg.c b/reg.c
index 1dca13a35d50294f2c0c57eea13d48ed780332cb..db1b12906519fd2450d7054dd598c70a0cc21b8c 100644 (file)
--- a/reg.c
+++ b/reg.c
@@ -209,6 +209,7 @@ static int print_reg_handler(struct nl_msg *msg, void *arg)
                PARSE_FLAG(NL80211_RRF_NO_HT40PLUS, "NO-HT40PLUS");
                PARSE_FLAG(NL80211_RRF_NO_80MHZ, "NO-80MHZ");
                PARSE_FLAG(NL80211_RRF_NO_160MHZ, "NO-160MHZ");
+               PARSE_FLAG(NL80211_RRF_NO_HE, "NO-HE");
 
                /* Kernels that support NO_IR always turn on both flags */
                if ((flags & NL80211_RRF_NO_IR) && (flags & __NL80211_RRF_NO_IBSS)) {
@@ -243,15 +244,15 @@ static int handle_reg_get(struct nl80211_state *state,
        char *dump_args[] = { "reg", "dump" };
        int err;
 
-       err = handle_cmd(state, CIB_NONE, 2, dump_args);
-       /* dump might fail since it's not supported on older kernels */
-       if (err == -EOPNOTSUPP) {
-               register_handler(print_reg_handler,
-                         NULL);
+       err = handle_cmd(state, II_NONE, 2, dump_args);
+       /*
+        * dump might fail since it's not supported on older kernels,
+        * in that case the handler is still registered already
+        */
+       if (err == -EOPNOTSUPP)
                return 0;
-       }
 
-       return err;
+       return err ?: HANDLER_RET_DONE;
 }
 COMMAND(reg, get, NULL, NL80211_CMD_GET_REG, 0, CIB_NONE, handle_reg_get,
        "Print out the kernel's current regulatory domain information.");
@@ -259,3 +260,13 @@ COMMAND(reg, get, NULL, NL80211_CMD_GET_REG, 0, CIB_PHY, handle_reg_get,
        "Print out the devices' current regulatory domain information.");
 HIDDEN(reg, dump, NULL, NL80211_CMD_GET_REG, NLM_F_DUMP, CIB_NONE,
        handle_reg_dump);
+
+static int handle_reg_reload(struct nl80211_state *state,
+                            struct nl_msg *msg,
+                            int argc, char **argv,
+                            enum id_input id)
+{
+       return 0;
+}
+COMMAND(reg, reload, NULL, NL80211_CMD_RELOAD_REGDB, 0, CIB_NONE,
+       handle_reg_reload, "Reload the kernel's regulatory database.");