From patchwork Tue Oct 27 22:30:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio D'Angelo X-Patchwork-Id: 1388998 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=iOfd41rm; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CLRHp0JJvz9sV0 for ; Wed, 28 Oct 2020 09:31:02 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6B5B0864EE; Tue, 27 Oct 2020 22:31:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id poRMbiH_kG_i; Tue, 27 Oct 2020 22:30:59 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 648CF863F2; Tue, 27 Oct 2020 22:30:59 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 37E20C0859; Tue, 27 Oct 2020 22:30:59 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0FEE0C0893 for ; Tue, 27 Oct 2020 22:30:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id E339D204FA for ; Tue, 27 Oct 2020 22:30:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uGYwFu1N41Tp for ; Tue, 27 Oct 2020 22:30:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by silver.osuosl.org (Postfix) with ESMTPS id 283EA204FF for ; Tue, 27 Oct 2020 22:30:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603837852; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hb3OSx20ROsmCQMawLgdvttLnvXP+2fDffJ4VBqRtJo=; b=iOfd41rmkl0yS20TPQgs7EN7hyp86NyDghXKq79tgKg4Do0jiqmv0XS/48Beebd3OPYy0f Rg9jdo9b0/I7f3tW+uJX428/dguW9SBKMktM7Ijz5pket3zX3I95T81SeC2CPl0KQ4MRJx gP/gFDuGInchpsllJYjuw0SlrXUOFZM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-268-eqQUeTHNN0OrlCnC3TCyeg-1; Tue, 27 Oct 2020 18:30:48 -0400 X-MC-Unique: eqQUeTHNN0OrlCnC3TCyeg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B74DA100746F; Tue, 27 Oct 2020 22:30:47 +0000 (UTC) Received: from ibm-p8-kvm-05-fsp.mgmt.pnr.lab.eng.rdu2.redhat.com (ovpn-118-108.rdu2.redhat.com [10.10.118.108]) by smtp.corp.redhat.com (Postfix) with ESMTP id E9E5B60C07; Tue, 27 Oct 2020 22:30:46 +0000 (UTC) From: Fabrizio D'Angelo To: dev@openvswitch.org Date: Tue, 27 Oct 2020 18:30:02 -0400 Message-Id: <20201027223003.166768-6-fdangelo@redhat.com> In-Reply-To: <20201027223003.166768-1-fdangelo@redhat.com> References: <20201027223003.166768-1-fdangelo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=fdangelo@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: Jonas Rudloff , Ilya Maximets Subject: [ovs-dev] [PATCH v2 5/6] lldp: correctly increase discarded count X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" From: Vincent Bernat 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 Signed-off-by: Fabrizio D'Angelo Acked-by: Aaron Conole --- lib/lldp/lldpd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/lldp/lldpd.c b/lib/lldp/lldpd.c index 19e9305266..34738535db 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;