[PATCH 6/7] tools: allow setting of transit net

Aaron Jones aaronmdjones at gmail.com
Sat Sep 8 16:04:51 CEST 2018


On 08/09/18 12:18, Julian Orth wrote:
> +static bool parse_transit_net(struct wgdevice *device, const char *arg)
> +{
> +	/* U32 arg -> PID */
> +	if (isdigit(*arg)) {
> +		char *end;
> +		unsigned long pid = strtoul(arg, &end, 10);
> +		if (!*end && pid <= UINT32_MAX) {
> +			device->transit_net_pid = pid;
> +			device->flags |= WGDEVICE_HAS_TRANSIT_NET_PID;
> +			return true;
> +		}
> +	}
> +
> +	/* Otherwise -> file path */
> +	device->transit_net_fd = open(arg, O_RDONLY);
> +	if (device->transit_net_fd >= 0) {
> +		device->flags |= WGDEVICE_HAS_TRANSIT_NET_FD;
> +		return true;
> +	}
> +
> +	perror("fopen");
> +	return false;
> +}

Wrong function name given to perror(3).


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 899 bytes
Desc: OpenPGP digital signature
URL: <http://lists.zx2c4.com/pipermail/wireguard/attachments/20180908/e33bda67/attachment.asc>


More information about the WireGuard mailing list