On 04/05/14 20:45, Kenneth Westerback wrote: > On 5 April 2014 16:00, Nick Holland <[email protected]> wrote: >> When setting up wireless for someone, tripped across this one: >> >> # ifconfig ral0 nwkey 0x4646464646 <- note: 10 hex digits >> # ifconfig ral0 >> ral0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 >> lladdr 00:18:39:15:60:82 >> priority: 4 >> groups: wlan >> media: IEEE802.11 autoselect (OFDM36) >> status: no network >> ieee80211: nwid Benny nwkey FFFFF 100dBm <- Fail >> inet6 fe80::218:39ff:fe15:6082%ral0 prefixlen 64 scopeid 0x5 > > This is not a fail! 0x46 is 'F', hence printable. All chars are > printable, so they are printed as ascii string.
oh, that's freaking embarassing. >> >> # ifconfig ral0 nwkey 0x46464646 <- 8 hex digits >> # ifconfig ral0 >> ral0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 >> lladdr 00:18:39:15:60:82 >> priority: 4 >> groups: wlan >> media: IEEE802.11 autoselect (OFDM36 mode 11g) >> status: active >> ieee80211: nwid Benny nwkey 0x4646464600 100dBm <- ok, >> inet6 fe80::218:39ff:fe15:6082%ral0 prefixlen 64 scopeid 0x5 >> > > 0x00 is *not* printable, so the key is printed as a hex string. > >> # ifconfig ral0 nwkey 0x4646464611 <- 10 hex digits, but different >> # ifconfig ral0 >> ral0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 >> lladdr 00:18:39:15:60:82 >> priority: 4 >> groups: wlan >> media: IEEE802.11 autoselect (OFDM36) >> status: no network >> ieee80211: nwid Benny nwkey 0x4646464611 100dBm <- good! >> inet6 fe80::218:39ff:fe15:6082%ral0 prefixlen 64 scopeid 0x5 >> > > 0x11 is not printable so the key is printed in hex. > >> # ifconfig ral0 nwkey 0x4646464622 >> # ifconfig ral0 >> ral0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 >> lladdr 00:18:39:15:60:82 >> priority: 4 >> groups: wlan >> media: IEEE802.11 autoselect (autoselect mode 11b) >> status: no network >> ieee80211: nwid Benny nwkey FFFF" 100dBm <- fail >> inet6 fe80::218:39ff:fe15:6082%ral0 prefixlen 64 scopeid 0x5 >> > > Not a fail! 'F' and '"' are both printable, so key in printed as an > ascii string. Admittedly a tad confusing, but a few hours perusing > ifconfig.c and in particular its print_string() and all is copacetic. > Except you may suffer transient blindness of course. > >> ??? >> And now for the next mind blower: >> >> # ifconfig ral0 nwkey 0x1146464622 >> # ifconfig ral0 >> ral0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 >> lladdr 00:18:39:15:60:82 >> priority: 4 >> groups: wlan >> media: IEEE802.11 autoselect (OFDM36 mode 11g) >> status: no network >> ieee80211: nwid Benny nwkey 0x1146464622 100dBm <- works! ??? >> inet6 fe80::218:39ff:fe15:6082%ral0 prefixlen 64 scopeid 0x5 >> >> I'm not able to figure out the pattern. > > 0x11 is not printable so the key is printed in hex. > > Pattern is pretty clear! :-) > > .... Ken > Oh, that's embarassingly easy. "NEVERMIND"... Nick.
