Skip to content

Commit

Permalink
lldp: don't send vlan when without_vlans is set
Browse files Browse the repository at this point in the history
Fixes: 8e9dbbf "lldp: don't send VLANs when there are too many of them

On interface with a lot of vlans, we still have "Too big packet"
notification on version 1.0.14

It looks like retry does exactly the same packet than first try
  • Loading branch information
ffourcot authored and vincentbernat committed Jul 6, 2022
1 parent a3e1f7f commit 1f5bc03
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/daemon/protocols/lldp.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,17 +249,19 @@ static int _lldp_send(struct lldpd *global,
}
}
/* VLANs */
TAILQ_FOREACH(vlan, &port->p_vlans, v_entries) {
vlans++;
if (!(
POKE_START_LLDP_TLV(LLDP_TLV_ORG) &&
POKE_BYTES(dot1, sizeof(dot1)) &&
POKE_UINT8(LLDP_TLV_DOT1_VLANNAME) &&
POKE_UINT16(vlan->v_vid) &&
POKE_UINT8(strlen(vlan->v_name)) &&
POKE_BYTES(vlan->v_name, strlen(vlan->v_name)) &&
POKE_END_LLDP_TLV))
goto toobig;
if (!without_vlans) {
TAILQ_FOREACH(vlan, &port->p_vlans, v_entries) {
vlans++;
if (!(
POKE_START_LLDP_TLV(LLDP_TLV_ORG) &&
POKE_BYTES(dot1, sizeof(dot1)) &&
POKE_UINT8(LLDP_TLV_DOT1_VLANNAME) &&
POKE_UINT16(vlan->v_vid) &&
POKE_UINT8(strlen(vlan->v_name)) &&
POKE_BYTES(vlan->v_name, strlen(vlan->v_name)) &&
POKE_END_LLDP_TLV))
goto toobig;
}
}
/* Protocol Identities */
TAILQ_FOREACH(pi, &port->p_pids, p_entries) {
Expand Down

0 comments on commit 1f5bc03

Please sign in to comment.