Re: ifconfig magic number

2017-03-21 Thread Mike Belopuhov
On 21 March 2017 at 06:21, Stefan Sperling  wrote:
> Replace a magic number with the corresponding macro.
>

Sure. OK mikeb



ifconfig magic number

2017-03-20 Thread Stefan Sperling
Replace a magic number with the corresponding macro.

Index: ifconfig.c
===
RCS file: /cvs/src/sbin/ifconfig/ifconfig.c,v
retrieving revision 1.339
diff -u -p -r1.339 ifconfig.c
--- ifconfig.c  12 Mar 2017 03:18:57 -  1.339
+++ ifconfig.c  21 Mar 2017 05:12:26 -
@@ -1637,7 +1637,7 @@ setifnwkey(const char *val, int d)
nwkey.i_defkid = 1;
if (d == -1) {
/* disable WEP encryption */
-   nwkey.i_wepon = 0;
+   nwkey.i_wepon = IEEE80211_NWKEY_OPEN;
i = 0;
} else if (strcasecmp("persist", val) == 0) {
/* use all values from persistent memory */
@@ -2120,7 +2120,7 @@ ieee80211_status(void)
}
}
 
-   if (inwkey == 0 && nwkey.i_wepon > 0) {
+   if (inwkey == 0 && nwkey.i_wepon > IEEE80211_NWKEY_OPEN) {
fputs(" nwkey ", stdout);
/* try to retrieve WEP keys */
for (i = 0; i < IEEE80211_WEP_NKID; i++) {