Summary: | net-misc/netifrc: Interface returning multiple MAC addresses errors out | ||
---|---|---|---|
Product: | Gentoo Hosted Projects | Reporter: | son |
Component: | netifrc | Assignee: | netifrc Team <netifrc> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | kfm |
Priority: | Normal | Keywords: | PATCH |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
netifrc-use-sysfs-to-obtain-the-mac-address.patch
netifrc-use-sysfs-to-obtain-the-mac-address-r1.patch |
Description
son
2021-01-23 22:02:04 UTC
(In reply to gentoo from comment #0) > Tracked down to the setting of mac in _get_mac_address() in net/iproute2.sh. Please try the impending patch. Created attachment 684285 [details, diff]
netifrc-use-sysfs-to-obtain-the-mac-address.patch
Created attachment 684291 [details, diff]
netifrc-use-sysfs-to-obtain-the-mac-address-r1.patch
No behavioural change from the previously attached patch. The only difference is that it employs a more terse method of transliterating the hex characters to upper case, looking slightly neater overall.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=6632c348cce8be19c7a960cabb2f6f41ec4c6d51 commit 6632c348cce8be19c7a960cabb2f6f41ec4c6d51 Author: Kerin Millar <kfm@plushkava.net> AuthorDate: 2021-01-24 02:49:43 +0000 Commit: Lars Wendler <polynomial-c@gentoo.org> CommitDate: 2021-01-24 10:21:20 +0000 Use sysfs to obtain the MAC address in net/iproute2.sh Dispense with the hideous ip-link(8) parser. Instead, collect the MAC address by reading from the relevant sysfs file. While at it, tidy up the remainder of the function so that the control flow is easier to ascertain at a glance. Note that the address will be rendered in upper case, just as it was before. Signed-off-by: Kerin Millar <kfm@plushkava.net> Closes: https://bugs.gentoo.org/766758 Signed-off-by: Lars Wendler <polynomial-c@gentoo.org> net/iproute2.sh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) I realise that very few Linux users will be using the ifconfig.sh module at this point but, still, I wonder whether the ifconfig parser is also affected. OP, if it is not too much trouble, please attach the output of "ifconfig enp37s0" so that it can be determined whether anything needs to be done for that particular module. Thanks. Thanks for the fix, it works for me. My ifconfig output is: $ ifconfig enp37s0 enp37s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.0.0.13 netmask 255.0.0.0 broadcast 10.255.255.255 inet6 fe80::ddbb:b3aa:f3c7:21dc prefixlen 64 scopeid 0x20<link> ether 00:1b:21:bc:0a:87 txqueuelen 1000 (Ethernet) RX packets 265464326 bytes 224348828808 (208.9 GiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 203344434 bytes 214929531141 (200.1 GiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 So it only prints a single "ether" address. Good. Thanks. |