From patchwork Sun Jan 7 14:28:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Filip Moc X-Patchwork-Id: 856552 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zF1DR3hHzz9s7h for ; Mon, 8 Jan 2018 01:36:07 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753846AbeAGOgA (ORCPT ); Sun, 7 Jan 2018 09:36:00 -0500 Received: from hosting.moc6.cz ([92.62.239.229]:37982 "EHLO moc6.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752986AbeAGOf7 (ORCPT ); Sun, 7 Jan 2018 09:35:59 -0500 X-Greylist: delayed 464 seconds by postgrey-1.27 at vger.kernel.org; Sun, 07 Jan 2018 09:35:59 EST Received: by moc6.cz (Postfix, from userid 1025) id B51322320021; Sun, 7 Jan 2018 15:28:13 +0100 (CET) Date: Sun, 7 Jan 2018 15:28:13 +0100 From: Filip Moc To: netdev@vger.kernel.org Subject: [PATCH iproute2] ip fou: Pass family attribute as u8 Message-ID: <20180107142813.s6k6h2s6u75bdut5@moc6.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This fixes fou on big-endian systems. Signed-off-by: Filip Moc --- ip/ipfou.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ip/ipfou.c b/ip/ipfou.c index febc2c8c..1f392ade 100644 --- a/ip/ipfou.c +++ b/ip/ipfou.c @@ -52,7 +52,7 @@ static int fou_parse_opt(int argc, char **argv, struct nlmsghdr *n, __u8 ipproto, type; bool gue_set = false; int ipproto_set = 0; - unsigned short family = AF_INET; + __u8 family = AF_INET; while (argc > 0) { if (!matches(*argv, "port")) { @@ -103,7 +103,7 @@ static int fou_parse_opt(int argc, char **argv, struct nlmsghdr *n, addattr16(n, 1024, FOU_ATTR_PORT, port); addattr8(n, 1024, FOU_ATTR_TYPE, type); - addattr16(n, 1024, FOU_ATTR_AF, family); + addattr8(n, 1024, FOU_ATTR_AF, family); if (ipproto_set) addattr8(n, 1024, FOU_ATTR_IPPROTO, ipproto);