From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH iproute2] ip fou: Pass family attribute as u8 Date: Sun, 7 Jan 2018 12:28:48 -0800 Message-ID: <20180107122848.3f2121c1@xeon-e3> References: <20180107142813.s6k6h2s6u75bdut5@moc6.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: Filip Moc Return-path: Received: from mail-pg0-f65.google.com ([74.125.83.65]:37422 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754542AbeAGU2v (ORCPT ); Sun, 7 Jan 2018 15:28:51 -0500 Received: by mail-pg0-f65.google.com with SMTP id o13so4193723pgp.4 for ; Sun, 07 Jan 2018 12:28:50 -0800 (PST) In-Reply-To: <20180107142813.s6k6h2s6u75bdut5@moc6.cz> Sender: netdev-owner@vger.kernel.org List-ID: On Sun, 7 Jan 2018 15:28:13 +0100 Filip Moc wrote: > 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); How is this binary compatiable with older versions.