Skip to content

Commit 0008b5a

Browse files
committed
network: nexthop: unset gateway when an empty string is assigned
1 parent 68337e5 commit 0008b5a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/network/networkd-nexthop.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,14 @@ int config_parse_nexthop_gateway(
519519
if (r < 0)
520520
return log_oom();
521521

522+
if (isempty(rvalue)) {
523+
n->family = AF_UNSPEC;
524+
n->gw = IN_ADDR_NULL;
525+
526+
TAKE_PTR(n);
527+
return 0;
528+
}
529+
522530
r = in_addr_from_string_auto(rvalue, &n->family, &n->gw);
523531
if (r < 0) {
524532
log_syntax(unit, LOG_WARNING, filename, line, r,

0 commit comments

Comments
 (0)