From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <mhall@mhcomputing.net>
Received: from mail.mhcomputing.net (master.mhcomputing.net [74.208.228.170])
 by dpdk.org (Postfix) with ESMTP id A58FC93B0
 for <dev@dpdk.org>; Fri, 13 Nov 2015 07:48:01 +0100 (CET)
Received: from sdn-sensor.attlocal.net
 (99-34-229-174.lightspeed.sntcca.sbcglobal.net [99.34.229.174])
 by mail.mhcomputing.net (Postfix) with ESMTPSA id C2517D8;
 Fri, 13 Nov 2015 01:48:00 -0500 (EST)
From: Matthew Hall <mhall@mhcomputing.net>
To: dev@dpdk.org
Date: Fri, 13 Nov 2015 06:47:38 +0000
Message-Id: <1447397258-27233-7-git-send-email-mhall@mhcomputing.net>
X-Mailer: git-send-email 1.9.1
In-Reply-To: <1447397258-27233-1-git-send-email-mhall@mhcomputing.net>
References: <1447397258-27233-1-git-send-email-mhall@mhcomputing.net>
Subject: [dpdk-dev] [PATCH 6/6] eal_log.c: limit syslog level to
	RTE_SYSLOG_LEVEL_MAX
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Nov 2015 06:48:01 -0000

Signed-off-by: Matthew Hall <mhall@mhcomputing.net>
---
 lib/librte_eal/linuxapp/eal/eal_log.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/librte_eal/linuxapp/eal/eal_log.c b/lib/librte_eal/linuxapp/eal/eal_log.c
index 0b133c3..dbeff75 100644
--- a/lib/librte_eal/linuxapp/eal/eal_log.c
+++ b/lib/librte_eal/linuxapp/eal/eal_log.c
@@ -73,6 +73,7 @@ console_log_write(__attribute__((unused)) void *c, const char *buf, size_t size)
 
 	/* Syslog error levels are from 0 to 7, so subtract 1 to convert */
 	loglevel = rte_log_cur_msg_loglevel() - 1;
+	loglevel = loglevel > RTE_SYSLOG_LEVEL_MAX ? RTE_SYSLOG_LEVEL_MAX : loglevel;
 	memcpy(copybuf, buf, size);
 	copybuf[size] = '\0';
 
-- 
1.9.1