Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lldp/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,13 @@ void rxProcessFrame(struct port *port, struct lldp_agent *agent)

err = np->ops->lldp_mod_rchange(port, agent, tlv);

if (!err)
if (!err) {
/* Module claimed the TLV; do not pass a possibly freed
* pointer to later modules in the list.
*/
tlv_stored = true;
else if (err == TLV_ERR) {
break;
} else if (err == TLV_ERR) {
frame_error++;
free_unpkd_tlv(tlv);
goto out;
Expand Down
3 changes: 2 additions & 1 deletion lldp_mand_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,8 @@ int get_tlvs(struct cmd *cmd, char *rbuf, int rlen)
}

if (tlvid == cmd->tlvid) {
memcpy(tlvs+moff, tlvs+off, sizeof(u16)+len);
/* overlapping src/dst when matching TLVs are compacted forward */
memmove(tlvs+moff, tlvs+off, sizeof(u16)+len);
moff += sizeof(u16)+len;
}

Expand Down