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

Roman Mamedov rm at romanrm.net
Sun Feb 19 18:31:18 UTC 2023


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?

> +	else if (strcmp(value, "unspec") == 0)
> +		*family = AF_UNSPEC;
> +	else
> +		return false;
> +
> +	return true;
> +}


-- 
With respect,
Roman


More information about the WireGuard mailing list