Modify

Opened 6 years ago

Closed 5 years ago

Last modified 4 years ago

#11166 closed defect (fixed)

Typo in 05_set_ether_mac_rdc

Reported by: yahoo@… Owned by: florian
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: Cc:

Description

Hi,

It looks like there's a typo in https://dev.openwrt.org/browser/trunk/target/linux/rdc/base-files/lib/preinit/05_set_ether_mac_rdc

I think line 22 which currently says:
[ "$mac1" = "FF:FF:FF:FF:FF:FF" -o "$mac0" = "0:0:0:0:0:0" ] && unset mac1

should instead say:
[ "$mac1" = "FF:FF:FF:FF:FF:FF" -o "$mac1" = "0:0:0:0:0:0" ] && unset mac1

Attachments (0)

Change History (9)

comment:1 Changed 6 years ago by anonymous

bump.
Any progress here?

comment:2 Changed 6 years ago by jow

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in r31030

comment:3 Changed 6 years ago by anonymous

Line 20 is clear and has mac0 and mac0 and mac0.

Line 22 seems to be a duplicate clause for mac1, but mixes mac0 and mac1 in a strange way in the conditions part.

Is that ... -o "$mac0" ... really intentional there?

20	                [ "$mac0" = "FF:FF:FF:FF:FF:FF" -o "$mac0" = "0:0:0:0:0:0" ] && unset mac0
21	                mac1=$(hexdump -n 6 -e '6/1 ":%X"' -s 24589 $config | cut -c2-)
22	                [ "$mac1" = "FF:FF:FF:FF:FF:FF" -o "$mac0" = "0:0:0:0:0:0" ] && unset mac1}}}

comment:4 Changed 6 years ago by yahoo@…

  • Resolution fixed deleted
  • Status changed from closed to reopened

Exactly. I guess I wasn't clear enough in my original bug report :-/

To paraphrase, the code currently says:
If $mac0 is all-0xFF, or $mac0 is all-0x00, then don't initialise eth0
If $mac1 is all-0xFF, or $mac0 is all-0x00, then don't initialise eth1

i.e. if $mac0 is all-0x00, then neither eth0 or eth1 will get initialised, regardless of the value of mac1. And if $mac0 isn't all-0x00, but $mac1 is all-0x00, eth1 _will_ still get initialised.

Which is why I think the code should be saying:
If $mac0 is all-0xFF, or $mac0 is all-0x00, then don't initialise eth0
If $mac1 is all-0xFF, or $mac1 is all-0x00, then don't initialise eth1

comment:5 Changed 5 years ago by anonymous

The typo is still there.
Hopefully the devs could make this simple fix in the current major review of tickets.

comment:6 Changed 5 years ago by florian

  • Owner changed from developers to florian
  • Status changed from reopened to accepted

I still wonder why this is even useful considering that the driver itself already generates a random ethernet address if needed to?

comment:7 Changed 5 years ago by anonymous

Shouldn't this be fixed for the forthcoming AA release? Eventhough the need for the whole script is questionable, the clear bug in the current code should be fixed.

comment:8 Changed 5 years ago by florian

  • Resolution set to fixed
  • Status changed from accepted to closed

Fixed with r33618

comment:9 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.