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

2018-09-08 Thread Aaron Jones
On 08/09/18 14:18, Julian Orth wrote: > Even with clang's -Weverything I don't get a warning when I compile the > following: > > #include > > int f(unsigned int i); > > int f(unsigned int i) > { > return i <= UINT32_MAX; > } Interesting... I don't either (gcc 8, clang 8). Perhaps I've been

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

2018-09-08 Thread Julian Orth
On 9/8/18 4:09 PM, Aaron Jones wrote: 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);

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

2018-09-08 Thread Aaron Jones
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 <=

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

2018-09-08 Thread Aaron Jones
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 <=

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

2018-09-08 Thread Julian Orth
The command is wg set [...] transit-net [...] For example: wg set wg0 transit-net 1 wg set wg0 transit-net /proc/1/ns/net --- src/tools/config.c | 32 src/tools/containers.h | 6 +- src/tools/ipc.c| 4 src/tools/man/wg.8 | 9 +++