References: <20180605185352.GR57262@...1296...> <20180605195935.GU57262@...1296...> <9a878b99-12ef-47b4-fc85-a16ecc196363@...2181...> <665fcdae-dad7-b6c8-14ee-512ff7992963@...2181...> <20180607165705.GP57262@...1296...> From: Antonio Quartulli Message-ID: Date: Fri, 8 Jun 2018 11:58:07 +0800 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9kzUmPVM757zb9Npifyq8kHqGcxyhVFv8" Subject: Re: [Openvpn-devel] [PATCH 1/5] tun: ensure interface can be configured with IPv6 only List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Selva Nair Cc: Gert Doering , openvpn-devel This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9kzUmPVM757zb9Npifyq8kHqGcxyhVFv8 Content-Type: multipart/mixed; boundary="90rzYKHuontParX1g6BOJ2BW5liVkwqNl"; protected-headers="v1" From: Antonio Quartulli To: Selva Nair Cc: Gert Doering , openvpn-devel Message-ID: Subject: Re: [Openvpn-devel] [PATCH 1/5] tun: ensure interface can be configured with IPv6 only References: <20180605185352.GR57262@...1296...> <20180605195935.GU57262@...1296...> <9a878b99-12ef-47b4-fc85-a16ecc196363@...2181...> <665fcdae-dad7-b6c8-14ee-512ff7992963@...2181...> <20180607165705.GP57262@...1296...> In-Reply-To: --90rzYKHuontParX1g6BOJ2BW5liVkwqNl Content-Language: en-US Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi, On 08/06/18 09:00, Selva Nair wrote: > It works now though not thoroghly tested. >=20 > I just noticed this change: >=20 > diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c > index 8509d48..d183aea 100644 > --- a/src/openvpn/tun.c > +++ b/src/openvpn/tun.c > @@ -5718,7 +5718,10 @@ open_tun(const char *dev, const char *dev_type, > const char *dev_node, struct tun > msg(M_FATAL, "ERROR: --dev tun also requires --ifconfig"); > } >=20 > - if (tt->topology =3D=3D TOP_SUBNET) > + /* send 0/0/0 to the TAP driver even if we have no IPv4 configur= ed > to > + * ensure it is somehow initialized. > + */ > + if (!tt->did_ifconfig_setup || tt->topology =3D=3D TOP_SUBNET) > { >=20 > This should work, but why change the logic? I would leave the conditionals > as in the original: >=20 > if (tt->topology =3D=3D TOP_SUBNET) etc.. >=20 > i.e call the CONFIG_TUN ioctl if topology is subnet else call > CONFIG_POINT_TO_POINT (eg., net30) irrsepective of v4 address is available > or not. This separate handling of net30 and subnet in the orginal is due > to historic reasons[*]. That is already messy and confusing so why add to > it with another cryptic condition? >=20 > Just saying... feel free to ignore. Well, topology is relevant only for IPv4, therefore when no --ifconfig is passed topology is basically ignored. For this reason I thought it would make sense to make the codeflow in this function explicit instead of relying of the topology value we actually have. Does it make sense? >=20 > Selva >=20 > [*] Topology subnet uses ip, nework and netmask, while net30 passes in the > second IP of the /30 in network as "netmask". The two ioctls interprets > their parameters differently such that in the end only valid ARP packets > get a response from the driver ! Is ARP still to be considered when no IPv4 is configured? --=20 Antonio Quartulli --90rzYKHuontParX1g6BOJ2BW5liVkwqNl-- --9kzUmPVM757zb9Npifyq8kHqGcxyhVFv8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEERdCuyFSHc3WdqS4EB6U8WA7yzXQFAlsZ/s8ACgkQB6U8WA7y zXRgkQ/+NiVIetv7Xubxxybv0jcTndMMfvzAU4OxqRwerPmlojv0/VpiJZUDb6B+ gO44Jv1uIPD7dXQ1Ns0dx9718wCU+6ByaDZ5v3FckqXdUqRAqtarlIzZQlqBkOeM +f58k4Sq2QW7HUKPLp0JFExTjAxwhtlHmFBa7KyOfbdoJ3PW8jlKT/wzoIDE58AF s2NctVZU57EYY1QouVwLMDirvGnEFxU2XOkKDJOw/aLjd/qFAkmu9BPst/raXXFv 7AacWHB9TDNtAkZEMqM+Xn/uN3siI6GRMR6ia9ojDL9oVbkLkrEHFhjQXKT0RuMW lkdKasMPwPLivtrOUudZXISkoD348dIXBahP+64HSDqUnCEwBl8lQtNf6Wi6LTJQ 9aG8y0JuXviLWssZg515u5R22ZQRHCfAF+pAjQVKBe3+dDMLTx1GdLA6bkV65fX4 +/kK7XExYLaRqlMZRGr2X9psA0UBL9213rdbGvf86ds7hXRMLxJAV3tSC7sbbX6z rya6IpVR66TCMOkfpk/YvXtjURoPrBz6NW3IemJ5+rBBHXl1UFNkolHVHOb+nsfW TN1eNllUCyezB+rGav4UG/zaF1vL6+9voN814wNY3RAKNOEmWqdR4xmBecWkfeBZ R/LDiBDF6jI+e4UAP8SHxPc2kXI8Tk84YZQ25XNcnLbfBUWkilw= =N8YR -----END PGP SIGNATURE----- --9kzUmPVM757zb9Npifyq8kHqGcxyhVFv8--