alobbs / macchanger

GNU MAC Changer
http://www.gnu.org/software/macchanger
GNU General Public License v3.0
577 stars 112 forks source link

On the second pass does not change the MAC address #58

Open zloi-user opened 4 years ago

zloi-user commented 4 years ago

gcc (8.3.0, 9.2.0) with the parameter "-02" ignores code "read(fd, & seed, sizeof (seed))"

x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -DLISTDIR="\"/lib/macchanger\"" -O2 -march=native -s -pipe -c -o main.o main.c main.c: In function ‘random_seed’: main.c:101:3: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result] 101 | read (fd, &seed, sizeof(seed)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

On the second pass, it does not change the MAC address, i.e. "random ()% 255" returns the same value

if you compile with the -O0 option, the problem goes away

sorry for my english, google translator used