{
struct lldpd_aa_isid_vlan_maps_tlv *lm = xzalloc(sizeof *lm);
- if (hardware->h_ifname) {
- VLOG_INFO("\t\t hardware->h_ifname=%s", hardware->h_ifname);
- }
+ VLOG_INFO("\t\t hardware->h_ifname=%s", hardware->h_ifname);
lm->isid_vlan_data.isid = m->isid;
lm->isid_vlan_data.vlan = m->vlan;
}
hmap_remove(&lldp->mappings_by_aux, &m->hmap_node_aux);
- free(m);
/* Remove from all the lldp instances */
LIST_FOR_EACH (hw, h_entries, &lldp->lldpd->g_hardware) {
- if (hw->h_ifname) {
- VLOG_INFO("\t\t hardware->h_ifname=%s", hw->h_ifname);
- }
-
+ VLOG_INFO("\t\t hardware->h_ifname=%s", hw->h_ifname);
aa_mapping_unregister_mapping(lldp, hw, m);
}
+ free(m);
/* Remove from the all_mappings */
HMAP_FOR_EACH (m, hmap_node_isid, all_mappings) {
* fields in 'wc' that were used to make the determination.
*/
bool
-lldp_should_process_flow(const struct flow *flow)
+lldp_should_process_flow(struct lldp *lldp, const struct flow *flow)
{
- return (flow->dl_type == htons(ETH_TYPE_LLDP));
+ return (flow->dl_type == htons(ETH_TYPE_LLDP) && lldp->enabled);
}
ret = timer_expired(&cfg->tx_timer);
ovs_mutex_unlock(&mutex);
+ /* LLDP must be enabled */
+ ret &= cfg->enabled;
+
return ret;
}
{
long long int retval;
- if (!lldp) {
+ if (!lldp || !lldp->enabled) {
return LLONG_MAX;
}
/* Configures the LLDP stack.
*/
bool
-lldp_configure(struct lldp *lldp) OVS_EXCLUDED(mutex)
+lldp_configure(struct lldp *lldp, const struct smap *cfg) OVS_EXCLUDED(mutex)
{
if (lldp) {
+ if (cfg && smap_get_bool(cfg, "enable", false)) {
+ lldp->enabled = true;
+ } else {
+ lldp->enabled = false;
+ }
+
ovs_mutex_lock(&mutex);
timer_set_expired(&lldp->tx_timer);
timer_set_duration(&lldp->tx_timer, LLDP_DEFAULT_TRANSMIT_INTERVAL_MS);