Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 699744 - net-analyzer/macchanger on the second pass does not change the MAC address
Summary: net-analyzer/macchanger on the second pass does not change the MAC address
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2019-11-10 15:10 UTC by Victor
Modified: 2019-12-03 20:43 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Victor 2019-11-10 15:10:09 UTC
$ sudo macchanger -r enp4s0
Current MAC:   56:a0:9a:7b:ec:5d (unknown)
Permanent MAC: 90:2b:34:a8:2a:14 (GIGA-BYTE TECHNOLOGY CO.,LTD.)
New MAC:       56:a0:9a:7b:ec:5d (unknown)
It's the same MAC!!


Subsequent macchanger runs do not change the MAC address


$ sudo macchanger -r enp4s0
Current MAC:   56:a0:9a:7b:ec:5d (unknown)
Permanent MAC: 90:2b:34:a8:2a:14 (GIGA-BYTE TECHNOLOGY CO.,LTD.)
New MAC:       56:a0:9a:7b:ec:5d (unknown)
It's the same MAC!!
$ sudo macchanger -r enp4s0
Current MAC:   56:a0:9a:7b:ec:5d (unknown)
Permanent MAC: 90:2b:34:a8:2a:14 (GIGA-BYTE TECHNOLOGY CO.,LTD.)
New MAC:       56:a0:9a:7b:ec:5d (unknown)
It's the same MAC!!



if you compile net-analyzer/macchanger with the -O0 option, the problem goes away


There is a precedence for "-O2"

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));
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Reproducible: Always
Comment 1 Jonas Stein gentoo-dev 2019-11-12 20:02:33 UTC
is it linked to
https://github.com/alobbs/macchanger/issues/57 ?

Please paste your emerge info here.
Comment 2 Victor 2019-11-12 20:40:00 UTC
(In reply to Jonas Stein from comment #1)
> is it linked to
> https://github.com/alobbs/macchanger/issues/57 ?
> 
> Please paste your emerge info here.

new issue
https://github.com/alobbs/macchanger/issues/58
Comment 3 Larry the Git Cow gentoo-dev 2019-12-03 10:08:31 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=63fd00c44388c3e96b0c8c03cf34af0cacb92eb7

commit 63fd00c44388c3e96b0c8c03cf34af0cacb92eb7
Author:     Jeroen Roovers <jer@gentoo.org>
AuthorDate: 2019-12-03 09:50:36 +0000
Commit:     Jeroen Roovers <jer@gentoo.org>
CommitDate: 2019-12-03 10:08:28 +0000

    net-analyzer/macchanger: Version 1.7.0_p5_p4
    
    Package-Manager: Portage-2.3.80, Repoman-2.3.19
    Bug: https://bugs.gentoo.org/699744
    Signed-off-by: Jeroen Roovers <jer@gentoo.org>

 net-analyzer/macchanger/Manifest                   |  1 +
 .../macchanger/macchanger-1.7.0_p5_p4.ebuild       | 44 ++++++++++++++++++++++
 2 files changed, 45 insertions(+)
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2019-12-03 10:14:48 UTC
Please test.
Comment 5 Victor 2019-12-03 10:54:26 UTC
the error remained

CFLAGS="-O2 -march=native -s -pipe" emerge net-analyzer/macchanger


main.c:101:3: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
  101 |   read (fd, &seed, sizeof(seed));
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



$ macchanger -r enp4s0
Current MAC:   90:2b:34:a8:2a:14 (GIGA-BYTE TECHNOLOGY CO.,LTD.)
Permanent MAC: 90:2b:34:a8:2a:14 (GIGA-BYTE TECHNOLOGY CO.,LTD.)
New MAC:       56:a0:9a:7b:ec:5d (unknown)

$ macchanger -r enp4s0
Current MAC:   56:a0:9a:7b:ec:5d (unknown)
Permanent MAC: 90:2b:34:a8:2a:14 (GIGA-BYTE TECHNOLOGY CO.,LTD.)
New MAC:       56:a0:9a:7b:ec:5d (unknown)
It's the same MAC!!

$ macchanger -r enp4s0
Current MAC:   56:a0:9a:7b:ec:5d (unknown)
Permanent MAC: 90:2b:34:a8:2a:14 (GIGA-BYTE TECHNOLOGY CO.,LTD.)
New MAC:       56:a0:9a:7b:ec:5d (unknown)
It's the same MAC!!




if you compile net-analyzer/macchanger with the -O0 option, the problem goes away

CFLAGS="-O0 -march=native -s -pipe" emerge net-analyzer/macchanger -av


$ macchanger -r enp4s0
Current MAC:   56:a0:9a:7b:ec:5d (unknown)
Permanent MAC: 90:2b:34:a8:2a:14 (GIGA-BYTE TECHNOLOGY CO.,LTD.)
New MAC:       c2:26:4a:53:41:7f (unknown)

$ macchanger -r enp4s0
Current MAC:   c2:26:4a:53:41:7f (unknown)
Permanent MAC: 90:2b:34:a8:2a:14 (GIGA-BYTE TECHNOLOGY CO.,LTD.)
New MAC:       f6:44:fe:ac:dd:fc (unknown)

$ macchanger -r enp4s0
Current MAC:   f6:44:fe:ac:dd:fc (unknown)
Permanent MAC: 90:2b:34:a8:2a:14 (GIGA-BYTE TECHNOLOGY CO.,LTD.)
New MAC:       56:a7:57:19:15:20 (unknown)
Comment 6 Victor 2019-12-03 20:43:12 UTC
in version 1.7.0_p5_p4 everything works well