[RESEND PATCH v3] wg: Support restricting address family of DNS resolved Endpoint

Michael Tokarev mjt at tls.msk.ru
Sun Feb 19 20:18:47 UTC 2023


19.02.2023 21:31, Roman Mamedov пишет:
> On Sun, 19 Feb 2023 19:04:28 +0100
> Daniel Gröber <dxld at darkboxed.org> wrote:
> 
>> +static inline bool parse_address_family(int *family, const char *value)
>> +{
>> +	if (strcmp(value, "inet") == 0)
>> +		*family = AF_INET;
>> +	else if (strcmp(value, "inet6") == 0)
>> +		*family = AF_INET6;
> 
> Wouldn't the first condition match "inet6" as well, not ever checking the
> second condition?

No.  It is not memcmp.

/mjt


More information about the WireGuard mailing list