in the interface statistics widget.
At the moment, if all the selected interfaces are down, the widget will just display no columns. That will make users wonder what happened.
(cherry picked from commit b22fceb2d7)
If an interface is down, the widget would write the interface description in a column heading but then omit the stats items. So later columns (to the right) would have the headings and stats items out of line.
This also fixes the performance problem that get_interface_info($ifdescr) was being called for every row of stats data for every interface. i.e. it was called 7 times for each interface when 1 time is enough.
(cherry picked from commit d87a9a1c97)
Since fdcde31b4a added German to the top of the get_locale_list() array, if you start with a default system and go to System->General Setup (make some changes to other fields if you like) and press Save, you end up in German because that is what gets selected in the dropdown when the config does not yet have a language in it.
The code assumed that the language of the default system is the language at the top of the list, which is no longer true.
Some length numbers here do not match the strings they are comparing with. That looks very odd.
Note that:
```
substr($ent, 0, 5) == "text"
```
will return true when $ent is "text". So actually this "works". But it returns false if $ent is "text1" "texta" etc.
So it depends what the intention was.
If it was intended to match just "text" then I could be just:
```
$ent == "text"
```
If it was intended to match "text" "text1" "texta" etc, then it needs to be fixed like I suggest here.
(cherry picked from commit 856514f595)
Only write if changed or missing.
Vast majority of reboots will not have a change so don't hit the file system with a needless write. RAM disk enabled systems will always write due to missing the file on boot up.
Use a single file for vendor MAC retention (vendor_mac).
a) Writes only one file during boot up rather than a file for each interface.
b) More efficient than numerous tiny files.
c) Friendlier to write cycle sensitive media in a RAM disk disabled system.
Relocate the vendor MAC retention file to /var/db directory.
a) It's more at home here with other network interface stuff.
b) Friendlier to write cycle sensitive media in a RAM disk enabled system.
Only use the vendor MAC retention file for restoring the vendor MAC when not booting.
a) During boot up the current MAC that is obtained from the system is the vendor MAC.
b) Using this eliminates the inefficient need to open the vendor MAC retention file for every interface during system boot up.
Rename 'spoof_mac' var to generic 'mac_addr'.
a) It may be the vendor MAC or a spoofed MAC.
b) Update the comment re: not reapplying an already applied MAC.