On Mon, 2023-01-02 at 12:12 +0100, Raphaël Mélotte wrote: > > + /* key index */ > + if (argc) { > + nla_put_u8(msg, NL80211_ATTR_KEY_IDX, strtoul(argv[0], &end, 10)); This is odd now - if you have &end you should check that strtoul() actually consumed all the input etc.? Otherwise might as well just use atoi(), but I'd prefer with the checks. > + argv++; > + argc--; > + } > + > + /* mac */ > + if (argc) { > + if (mac_addr_a2n(mac, argv[0]) == 0) { > + NLA_PUT(msg, NL80211_ATTR_MAC, 6, mac); > + argv++; > + argc--; > + nla_put_u32(msg, NL80211_ATTR_KEY_TYPE, NL80211_KEYTYPE_PAIRWISE); maybe add that before the argv/argc (and maybe break line in there) - first I got concerned if argv/argc was used in that nla_put_u32(). johannes