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

Aaron Jones aaronmdjones at gmail.com
Sat Sep 8 16:09:49 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) {

This condition will always be true on a 32-bit system (for a valid
integer). I'd prefer strtoull() and `unsigned long long' but given
that a valid file descriptor won't ever go that high... eh. shrug. But
you'll still get a compiler diagnostic for it.


-------------- 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/d2cf615c/attachment.asc>


More information about the WireGuard mailing list