From mboxrd@z Thu Jan 1 00:00:00 1970 From: Serhey Popovych Subject: Re: [PATCH iproute2-next 4/6] iptunnel/ip6tunnel: Code cleanups Date: Wed, 7 Feb 2018 08:15:48 +0200 Message-ID: <967284d7-2aa1-a499-4d3f-0468d5e88de4@gmail.com> References: <1517577055-23788-1-git-send-email-serhe.popovych@gmail.com> <1517577055-23788-5-git-send-email-serhe.popovych@gmail.com> <652a40b7-6828-bb7b-ec08-0fa31ec17f06@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ld7BUmdAf83rxfPhx1yRuIJWKstCkABtV" To: David Ahern , netdev@vger.kernel.org Return-path: Received: from mail-wm0-f54.google.com ([74.125.82.54]:54280 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750729AbeBGGQF (ORCPT ); Wed, 7 Feb 2018 01:16:05 -0500 Received: by mail-wm0-f54.google.com with SMTP id i186so890064wmi.4 for ; Tue, 06 Feb 2018 22:16:04 -0800 (PST) In-Reply-To: <652a40b7-6828-bb7b-ec08-0fa31ec17f06@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ld7BUmdAf83rxfPhx1yRuIJWKstCkABtV Content-Type: multipart/mixed; boundary="5QMCk8Xj3AtyiM63gufu1b6rJ1KW1Tpw7"; protected-headers="v1" From: Serhey Popovych To: David Ahern , netdev@vger.kernel.org Message-ID: <967284d7-2aa1-a499-4d3f-0468d5e88de4@gmail.com> Subject: Re: [PATCH iproute2-next 4/6] iptunnel/ip6tunnel: Code cleanups References: <1517577055-23788-1-git-send-email-serhe.popovych@gmail.com> <1517577055-23788-5-git-send-email-serhe.popovych@gmail.com> <652a40b7-6828-bb7b-ec08-0fa31ec17f06@gmail.com> In-Reply-To: <652a40b7-6828-bb7b-ec08-0fa31ec17f06@gmail.com> --5QMCk8Xj3AtyiM63gufu1b6rJ1KW1Tpw7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable David Ahern wrote: > On 2/2/18 6:10 AM, Serhey Popovych wrote: >> @@ -414,15 +428,18 @@ static int do_tunnels_list(struct ip_tunnel_parm= *p) >> fprintf(stderr, "Failed to get type of \"%s\"\n", name); >> continue; >> } >> - if (type !=3D ARPHRD_TUNNEL && type !=3D ARPHRD_IPGRE && type !=3D = ARPHRD_SIT) >> + switch (type) { >> + case ARPHRD_TUNNEL: >> + case ARPHRD_IPGRE: >> + case ARPHRD_SIT: >> + break; >> + default: >> continue; >> + } >> + memset(p1, 0, sizeof(p1)); >=20 > Shouldn't that be &p1 for the first arg? I get a compile failure: Yes, definitely, sorry for that. Will fix in v2. >=20 > ip > CC iptunnel.o > CC ip6tunnel.o > iptunnel.c: In function =E2=80=98do_tunnels_list=E2=80=99: > iptunnel.c:439:10: error: incompatible type for argument 1 of =E2=80=98= memset=E2=80=99 > memset(p1, 0, sizeof(p1)); > ^~ > In file included from iptunnel.c:15:0: > /usr/include/string.h:62:14: note: expected =E2=80=98void *=E2=80=99 bu= t argument is of > type =E2=80=98struct ip_tunnel_parm=E2=80=99 > extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull= > ((1)); > ^~~~~~ > ../config.mk:48: recipe for target 'iptunnel.o' failed >=20 >> if (tnl_get_ioctl(name, &p1)) >> continue; >> - if ((p->link && p1.link !=3D p->link) || >> - (p->name[0] && strcmp(p1.name, p->name)) || >> - (p->iph.daddr && p1.iph.daddr !=3D p->iph.daddr) || >> - (p->iph.saddr && p1.iph.saddr !=3D p->iph.saddr) || >> - (p->i_key && p1.i_key !=3D p->i_key)) >> + if (!ip_tunnel_parm_match(p, &p1)) >> continue; >> print_tunnel(&p1); >> if (show_stats) { --5QMCk8Xj3AtyiM63gufu1b6rJ1KW1Tpw7-- --ld7BUmdAf83rxfPhx1yRuIJWKstCkABtV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQEcBAEBAgAGBQJaepmeAAoJEBTawMmQ61bBd4wH/jmaCfLV6X150D0xAxUlzPHN thTWbAXF5YNLYc3NBhyRp+9GpcFPM38ljALqTD3Vst+9gK4UWAujVraTz/STGP9n u1ufPH16fk1PuaKDZzh+1tqLfV8FzGWp0/Y3cNtKEkXuwYhXVeAN79GXLBB2BtOM f3aZ7pXj1xfUL6RHUSWxHoUW6iBVj5XQ3weitbVgZLpGnwH9exUQsFrNbINw4lL6 N3Y+k3sCuOuPQEG0fug0AqCG+hBASxYrtdaWOsYPvaqmAnhThcRY/mKwsfU0itSG dkBjLhHBbqsbIdOp+kyDm38ipNYk3RZfREOZJ8WUyFm63hHZkxr2IbIxQ9huuhA= =NEsM -----END PGP SIGNATURE----- --ld7BUmdAf83rxfPhx1yRuIJWKstCkABtV--