Subject: Re: [iproute2-next] tipc: support interface name when activating UDP bearer

From: Stephen Hemminger <[email-masked]>
Date: Thu, 11 Oct 2018 08:04:35 -0700

On Thu, 11 Oct 2018 09:07:08 +0700
Hoang Le <[email-masked]> wrote:

This looks fine.

> +static int cmd_bearer_validate_and_get_addr(const char *name, char *straddr)
> +{
> +	struct ifreq ifc;
> +	struct sockaddr_in *ip4addr;
> +	struct sockaddr_in6 *ip6addr;
> +	int fd = 0;
> +
> +	if (!name || !straddr)
> +		return 0;
> +
> +	fd = socket(PF_INET, SOCK_DGRAM, 0);

Will goahead and apply but minor nits.

The initialization of fd to zero is unnecessary.
This function is return 0, -1, or -EINVAL but only caller only cares about
zero or non-zero.