mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-31 04:53:01 +02:00
confd: allow interface description as ifAlias
This patch adds support for setting the free form description string as the interface alias. This can be read from /sys/class/net/*/ifalias, or using the 'ip link show' command. The ifalias is reported by SNMP and LLDP by default, and now also in the operational datastore. Linux supports 250 characters in ifalias, but the IF-MIB is restricted to 64 characters, so we add a local deviation to limit the type. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -645,6 +645,9 @@ def add_ip_link(ifname, iface_in, iface_out):
|
||||
if 'ifindex' in iface_in:
|
||||
iface_out['if-index'] = iface_in['ifindex']
|
||||
|
||||
if 'ifalias' in iface_in:
|
||||
iface_out['description'] = iface_in['ifalias']
|
||||
|
||||
if 'address' in iface_in:
|
||||
iface_out['phys-address'] = iface_in['address']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user