* Change:
+ Ability to add/remove/replace custom TLV from lldpcli.
+ LLDP-MED capabilities are displayed differently in lldpcli.
+ + Limit the maximum depth (5) when trying to apply a VLAN.
* Fix:
+ LLDP-MED POE TLV are now displayed in lldpcli.
+ Ignore lower link when it is in another namespace.
*
* @param vlan The VLAN interface (used to get VLAN ID).
* @param upper The upper interface we are currently examining.
+ * @param depth Depth of the stack (avoid infinite recursion)
*
* Initially, upper == vlan. This function will be called recursively.
*/
iface_append_vlan_to_lower(struct lldpd *cfg,
struct interfaces_device_list *interfaces,
struct interfaces_device *vlan,
- struct interfaces_device *upper)
+ struct interfaces_device *upper,
+ int depth)
{
+ if (depth > 5) {
+ log_debug("interfaces",
+ "maximum depth reached when applying VLAN %s (loop?)",
+ vlan->name);
+ return;
+ }
+ depth++;
struct interfaces_device *lower;
log_debug("interfaces",
"looking to apply VLAN %s to physical interface behind %s",
vlan->name, upper->name);
iface_append_vlan_to_lower(cfg,
interfaces, vlan,
- upper->lower);
+ upper->lower,
+ depth);
return;
}
log_debug("interfaces", "VLAN %s on lower interface %s",
vlan->name, upper->name);
iface_append_vlan_to_lower(cfg,
- interfaces, vlan, lower);
+ interfaces, vlan, lower, depth);
}
}
log_debug("interfaces", "search physical interface for VLAN interface %s",
iface->name);
iface_append_vlan_to_lower(cfg, interfaces,
- iface, iface);
+ iface, iface, 0);
}
}
#endif