Re: [Openvpn-devel] [PATCH 1/2] Fix check if iface name is set

2019-08-13 Thread David Sommerseth
On 13/08/2019 11:03, Antonio Quartulli wrote: > Hi Arne, > > On 12/08/2019 15:45, Arne Schwabe wrote: >> Clang/Android complained >> >> warning: address of array 'rgi6->iface' will always evaluate to 'true' >> [-Wpointer-bool-conversion] >> if (rgi6->iface) >> >> iface is a char[16];

Re: [Openvpn-devel] [PATCH 1/2] Fix check if iface name is set

2019-08-13 Thread Steffan Karger
Hi, On 13-08-19 23:31, Antonio Quartulli wrote: > On 13/08/2019 23:26, David Sommerseth wrote: >> wouldn't it be better to >> do 'if (rgi6->iface[0])' instead? Since the buffer should be NULL terminated >> and has to be NULL terminted for strlen() to function anyhow. But the >> compiled code

Re: [Openvpn-devel] [PATCH 1/2] Fix check if iface name is set

2019-08-13 Thread Antonio Quartulli
Hi, On 13/08/2019 23:26, David Sommerseth wrote: > wouldn't it be better to > do 'if (rgi6->iface[0])' instead? Since the buffer should be NULL terminated > and has to be NULL terminted for strlen() to function anyhow. But the > compiled code would be a bit more efficient (even though, this

Re: [Openvpn-devel] [PATCH 1/2] Fix check if iface name is set

2019-08-13 Thread David Sommerseth
On 13/08/2019 23:46, Steffan Karger wrote: > Hi, > > On 13-08-19 23:31, Antonio Quartulli wrote: >> On 13/08/2019 23:26, David Sommerseth wrote: >>> wouldn't it be better to >>> do 'if (rgi6->iface[0])' instead? Since the buffer should be NULL >>> terminated >>> and has to be NULL terminted for

Re: [Openvpn-devel] [PATCH 1/2] Fix check if iface name is set

2019-08-13 Thread Antonio Quartulli
Hi Arne, On 12/08/2019 15:45, Arne Schwabe wrote: > Clang/Android complained > > warning: address of array 'rgi6->iface' will always evaluate to 'true' > [-Wpointer-bool-conversion] > if (rgi6->iface) > > iface is a char[16]; So its pointer is always true. > > we do a CLEAR(rgi6)

Re: [Openvpn-devel] [PATCH 2/2] Adjust Android code after sitnl patch merge

2019-08-13 Thread Antonio Quartulli
Hi Arne, On 12/08/2019 15:45, Arne Schwabe wrote: > It turns out that the only part of Android that still shares routing > code with Linux is the get_default_ipv6 method. > > Instead of fixing a method that makes little sense on Android anyway, > have a method that returns a fake ipv6 gateway