diff --git a/src/route-utils.c b/src/route-utils.c index 61bc9cd..7f73a41 100644 --- a/src/route-utils.c +++ b/src/route-utils.c @@ -134,6 +134,10 @@ void parse_nexthop(struct rtnl_route *route, char *subopts, if (ret == -1) fatal(EINVAL, "Unknown nexthop token \"%s\"", arg); + if (arg == NULL) + fatal(EINVAL, "Missing argument to option \"%s\"\n", + tokens[ret]); + switch (ret) { case NH_DEV: ival = rtnl_link_name2i(link_cache, arg);