diff --git a/doc/macchanger.texi b/doc/macchanger.texi index b48d151..77595aa 100644 --- a/doc/macchanger.texi +++ b/doc/macchanger.texi @@ -154,8 +154,8 @@ print only vendor that matches the string. @cindex @code{-b} @itemx --bia @cindex @code{--bia} -Pretend to be a burned-in-address. If not used, the MAC will have the -locally-administered bit set. +When setting fully random MAC pretend to be a burned-in-address. If not used, +the MAC will have the locally-administered bit set. @item -m @cindex @code{-m} diff --git a/macchanger.1 b/macchanger.1 index 525d44f..442b2c5 100644 --- a/macchanger.1 +++ b/macchanger.1 @@ -67,7 +67,8 @@ Reset MAC address to its original, permanent hardware value. Print known vendors (with keyword in the vendor's description string). .TP .B \-b, \-\-bia -Pretend to be a burned-in-address. If not used, the MAC will have the locally-administered bit set. +When setting fully random MAC pretend to be a burned-in-address. If not used, +the MAC will have the locally-administered bit set. .TP .B \-m, \-\-mac XX:XX:XX:XX:XX:XX, \-\-mac=XX:XX:XX:XX:XX:XX Set the MAC XX:XX:XX:XX:XX:XX. diff --git a/src/main.c b/src/main.c index d6c757d..1117cb4 100644 --- a/src/main.c +++ b/src/main.c @@ -217,13 +217,18 @@ main (int argc, char *argv[]) /* Seed a random number generator */ random_seed(); - /* Read the MAC */ + /* Read the MAC */ if ((net = mc_net_info_new(device_name)) == NULL) { exit (EXIT_ERROR); } mac = mc_net_info_get_mac(net); mac_permanent = mc_net_info_get_permanent_mac(net); + /* --bia can only be used with --random */ + if (set_bia && !random) { + fprintf (stderr, "[WARNING] Ignoring --bia option that can only be used with --random\n"); + } + /* Print the current MAC info */ print_mac ("Current MAC: ", mac); print_mac ("Permanent MAC: ", mac_permanent); @@ -240,14 +245,14 @@ main (int argc, char *argv[]) } else if (random) { mc_mac_random (mac_faked, 6, set_bia); } else if (ending) { - mc_mac_random (mac_faked, 3, set_bia); + mc_mac_random (mac_faked, 3, 1); } else if (another_same) { val = mc_maclist_is_wireless (mac); mc_maclist_set_random_vendor (mac_faked, val); - mc_mac_random (mac_faked, 3, set_bia); + mc_mac_random (mac_faked, 3, 1); } else if (another_any) { mc_maclist_set_random_vendor(mac_faked, mac_is_anykind); - mc_mac_random (mac_faked, 3, set_bia); + mc_mac_random (mac_faked, 3, 1); } else if (permanent) { mac_faked = mc_mac_dup (mac_permanent); } else {