diff mbox series

[ovs-dev,v3,5/6] lldp: correctly increase discarded count

Message ID 20201112172533.271352-6-fdangelo@redhat.com
State Changes Requested
Headers show
Series Incorporate fixes from lldpd upstream | expand

Commit Message

Fabrizio D'Angelo Nov. 12, 2020, 5:25 p.m. UTC
From: Vincent Bernat <vincent@bernat.im>

Upstream commit:
	commit 32f0deeebc9172c3f5f4a4d02aab32e6904947f6
	Date: Sat, 18 Feb 2017 20:11:47 +0100

	lldpd: correctly increase discarded count

	When a frame cannot be decoded but has been guessed, increase the
	discarded count.

	Fix https://github.com/vincentbernat/lldpd/issues/223

Co-authored-by: Fabrizio D'Angelo <fdangelo@redhat.com>
Signed-off-by: Fabrizio D'Angelo <fdangelo@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
---
 lib/lldp/lldpd.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

0-day Robot Nov. 12, 2020, 6:14 p.m. UTC | #1
Bleep bloop.  Greetings Fabrizio D'Angelo, I am a robot and I have tried out your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
ERROR: Author Vincent Bernat <vincent@bernat.im> needs to sign off.
Lines checked: 46, Warnings: 0, Errors: 1


Please check this out.  If you feel there has been an error, please email aconole@redhat.com

Thanks,
0-day Robot
diff mbox series

Patch

diff --git a/lib/lldp/lldpd.c b/lib/lldp/lldpd.c
index 19e930526..34738535d 100644
--- a/lib/lldp/lldpd.c
+++ b/lib/lldp/lldpd.c
@@ -244,6 +244,7 @@  lldpd_decode(struct lldpd *cfg, char *frame, int s,
 
     if (s < sizeof(struct eth_header) + 4) {
         /* Too short, just discard it */
+        hw->h_rx_discarded_cnt++;
         return;
     }
 
@@ -284,6 +285,7 @@  lldpd_decode(struct lldpd *cfg, char *frame, int s,
                 VLOG_DBG("function for %s protocol did not "
                          "decode this frame",
                          cfg->g_protocols[i].name);
+                hw->h_rx_discarded_cnt++;
                 return;
             }
             chassis->c_protocol = port->p_protocol = cfg->g_protocols[i].mode;