summaryrefslogtreecommitdiffhomepage
path: root/system-linux.c
diff options
context:
space:
mode:
Diffstat (limited to 'system-linux.c')
-rw-r--r--system-linux.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/system-linux.c b/system-linux.c
index d01d7e3..58210a6 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -1435,8 +1435,11 @@ int system_add_ip_tunnel(const char *name, struct blob_attr *attr)
str = blobmsg_data(cur);
unsigned int ttl = 0;
- if ((cur = tb[TUNNEL_ATTR_TTL]) && (ttl = blobmsg_get_u32(cur)) > 255)
- return -EINVAL;
+ if ((cur = tb[TUNNEL_ATTR_TTL])) {
+ ttl = blobmsg_get_u32(cur);
+ if (ttl > 255)
+ return -EINVAL;
+ }
unsigned int link = 0;
if ((cur = tb[TUNNEL_ATTR_LINK])) {