Interfaces - add description to ifconfig output, closes https://github.com/opnsense/core/issues/5331

Since -accept_rtadv is always executed, we can combine setting a description to prevent another call to ifconfig, we already need quite some calls which can slowdown configuration.
(FreeBSD 13 seems to be faster, but limiting calls in this case seems like a fair trade)
This commit is contained in:
Ad Schellevis 2021-11-02 19:06:06 +01:00
parent ecb34928fb
commit abba23fda5

View File

@ -2442,8 +2442,10 @@ function interface_configure($verbose = false, $interface = 'wan', $reload = fal
break;
}
/* disable accepting router advertisements unless specifically requested */
mwexecf('/sbin/ifconfig %s inet6 -accept_rtadv', array($realif));
/* o disable accepting router advertisements unless specifically requested
o set interface description */
$interface_descr = !empty($wancfg['descr']) ? $wancfg['descr'] : strtoupper($interface);
mwexecf('/sbin/ifconfig %s inet6 -accept_rtadv description %s', [$realif, $interface_descr]);
if (isset($wancfg['ipaddrv6'])) {
switch ($wancfg['ipaddrv6']) {