From patchwork Mon Oct 26 20:57:44 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: 1388104 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=fbnBEdkg; 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 4CKnH90c16z9sSn for ; Tue, 27 Oct 2020 07:58:13 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5446885FE6; Mon, 26 Oct 2020 20:58:11 +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 uxVLbZwpXQHb; Mon, 26 Oct 2020 20:58:09 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0407B8623F; Mon, 26 Oct 2020 20:58:07 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id B0393C1DD6; Mon, 26 Oct 2020 20:58:07 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 69BBFC1D7C for ; Mon, 26 Oct 2020 20:58:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 5253A8723A for ; Mon, 26 Oct 2020 20:58:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id d2Fdbua8k33b for ; Mon, 26 Oct 2020 20:58:01 +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 [216.205.24.124]) by hemlock.osuosl.org (Postfix) with ESMTPS id 6A1958724B for ; Mon, 26 Oct 2020 20:58:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603745879; 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=fbnBEdkgN8bssYOKfXOr0lCaS9c6OJEnKWMRUcCQwrzFqjWYkGpp1fcPcxpYTVwDBgM9HW 2lF3C2isck8jeAvWRHsFo3QpQ3L1g5Ppznvgjjis7yYffCp124ckRHK3yb1wCMRjCKj/gX FbyExY2hB8K8cO39McsHH5vNb7T9730= 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-39-UGE3plpxMI24tGzlgCqVnw-1; Mon, 26 Oct 2020 16:57:56 -0400 X-MC-Unique: UGE3plpxMI24tGzlgCqVnw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7422D809DCA; Mon, 26 Oct 2020 20:57:54 +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 E403855762; Mon, 26 Oct 2020 20:57:53 +0000 (UTC) From: Fabrizio D'Angelo To: dev@openvswitch.org Date: Mon, 26 Oct 2020 16:57:44 -0400 Message-Id: <20201026205745.56604-6-fdangelo@redhat.com> In-Reply-To: <20201026205745.56604-1-fdangelo@redhat.com> References: <20201026205745.56604-1-fdangelo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 5/6] lldpd: 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 --- 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;