lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 10 Feb 2014 17:39:00 -0800
From:	Joe Perches <joe@...ches.com>
To:	Calvin Owens <jcalvinowens@...il.com>
Cc:	Johannes Berg <johannes@...solutions.net>,
	"David S. Miller" <davem@...emloft.net>,
	"John W. Linville" <linville@...driver.com>,
	linux-wireless@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] ieee80211: Print human-readable disassoc/deauth
 reason codes

On Mon, 2014-02-10 at 19:25 -0600, Calvin Owens wrote:
> Create a function to return a descriptive string for each reason code,
> and print that instead of the numeric value in the kernel log. These
> codes are easily found on popular search engines, but one is generally
> not able to access the internet when dealing with wireless connectivity
> issues.
> 
> Changes since v1: Refactored array of strings into switch statement,
> print numeric code in addition to string.

trivia:

> +const char *ieee80211_get_reason_code_string(u16 reason_code)
> +{
> +	enum ieee80211_reasoncode r = reason_code;

what good does this temporary do?

> +	switch(r) {

space after switch please.

> +	case WLAN_REASON_UNSPECIFIED: return "UNSPECIFIED";
> +	case WLAN_REASON_PREV_AUTH_NOT_VALID: return "PREV_AUTH_NOT_VALID";
> +	case WLAN_REASON_DEAUTH_LEAVING: return "DEAUTH_LEAVING";

This seems a bit too wall of text to me.

Maybe a simplifying macro like:

#define case_WLAN(type)				\
	case WLAN_REASON_##type: return #type

and use:
	switch (reason_code) {
	case_WLAN(UNSPECIFIED);
	case_WLAN(PREV_AUTH_NOT_VALID);

etc...


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ