From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by dpdk.org (Postfix) with ESMTP id 1D2997E6A for ; Wed, 17 Dec 2014 13:55:35 +0100 (CET) Received: by mail-wi0-f177.google.com with SMTP id l15so15954729wiw.16 for ; Wed, 17 Dec 2014 04:55:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BkU4WLm5EuK2Gyi1DH2XIKIQdlGZMWil5qSTmQpDO9k=; b=jBz9KONV3zRU2PcWYrpP0uw1NFj9PRxsR7w935K2jtaUK0K4th4Sn25j29w8jCnFee cqpWBC52WU1xxD3kWQrcJPro+JxkSylMifOFMnGgRO825r76ACeLtctZbG7bbX+KHeq7 +5+4cc098AW78VORvqT45IXqPmkwFo+jd/egpWjRv6bw4kJbhr67kIV/KQazrnerHiPZ 4laRJ2EaHwJtKcMoTo37kUJmFpvdb96FpyBQgGAz2rMHrdUx9MHjJAzV+4jG3NNerrx4 ITpu+aIIVKfjLQkWJBmyfxZ3qOcdl2E0deFKv9jhbxRqCJnPibjf42VgSYEndkKTFP4r 9VXA== X-Gm-Message-State: ALoCoQmppZ0LZ0/qHTr3ucSNx+TmT/1FlZKw+4eMGR3XBtoQ4ulwHbBedS8ShCuSh+d1PfB9Damf X-Received: by 10.180.77.7 with SMTP id o7mr13978948wiw.81.1418820934868; Wed, 17 Dec 2014 04:55:34 -0800 (PST) Received: from glumotte.dev.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by mx.google.com with ESMTPSA id gs10sm6948929wib.12.2014.12.17.04.55.33 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 17 Dec 2014 04:55:34 -0800 (PST) From: Olivier Matz To: dev@dpdk.org Date: Wed, 17 Dec 2014 13:55:23 +0100 Message-Id: <1418820925-20318-4-git-send-email-olivier.matz@6wind.com> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1418820925-20318-1-git-send-email-olivier.matz@6wind.com> References: <1418820925-20318-1-git-send-email-olivier.matz@6wind.com> Subject: [dpdk-dev] [PATCH 3/5] examples/netmap: fix overflow in ioctl operation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 12:55:35 -0000 Compiling the netmap example with clang-3.5 triggered the following warning: compat_netmap.c:783:11: error: overflow converting case value to switch condition type (3225184658 to 18446744072639768978) [-Werror,-Wswitch] case NIOCREGIF: ^ Indeed, an ioctl value should be an unsigned 32 bits, not an int. Signed-off-by: Olivier Matz --- examples/netmap_compat/lib/compat_netmap.c | 2 +- examples/netmap_compat/lib/compat_netmap.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/netmap_compat/lib/compat_netmap.c b/examples/netmap_compat/lib/compat_netmap.c index 6a4737a..1d86ef0 100644 --- a/examples/netmap_compat/lib/compat_netmap.c +++ b/examples/netmap_compat/lib/compat_netmap.c @@ -765,7 +765,7 @@ rte_netmap_close(__rte_unused int fd) return (rc); } -int rte_netmap_ioctl(int fd, int op, void *param) +int rte_netmap_ioctl(int fd, uint32_t op, void *param) { int ret; diff --git a/examples/netmap_compat/lib/compat_netmap.h b/examples/netmap_compat/lib/compat_netmap.h index f8a7812..3dc7a2f 100644 --- a/examples/netmap_compat/lib/compat_netmap.h +++ b/examples/netmap_compat/lib/compat_netmap.h @@ -71,7 +71,7 @@ int rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf); int rte_netmap_close(int fd); -int rte_netmap_ioctl(int fd, int op, void *param); +int rte_netmap_ioctl(int fd, uint32_t op, void *param); int rte_netmap_open(const char *pathname, int flags); int rte_netmap_poll(struct pollfd *fds, nfds_t nfds, int timeout); void *rte_netmap_mmap(void *addr, size_t length, int prot, int flags, int fd, -- 2.1.3