diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-05-21 23:41:25 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-05-21 23:41:25 +0200 |
commit | c0120d992ce5ab004d9be5ff6ca15e5fe17f9884 (patch) | |
tree | 77293c20ec123d0e3f56ad21a2e08d2b0775106a /src/load-fragment.c | |
parent | 88ce42f6944774788f610598fccdc6bab4283497 (diff) |
socket: fix parsing of bind_ipv6_only
Diffstat (limited to 'src/load-fragment.c')
-rw-r--r-- | src/load-fragment.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/load-fragment.c b/src/load-fragment.c index 5e0637de65..3ebea4316f 100644 --- a/src/load-fragment.c +++ b/src/load-fragment.c @@ -252,8 +252,8 @@ static int config_parse_socket_bind( void *data, void *userdata) { - int r; Socket *s; + SocketAddressBindIPv6Only b; assert(filename); assert(lvalue); @@ -262,12 +262,17 @@ static int config_parse_socket_bind( s = (Socket*) data; - if ((r = parse_boolean(rvalue)) < 0) { - log_error("[%s:%u] Failed to parse bind IPv6 only value: %s", filename, line, rvalue); - return r; - } + if ((b = socket_address_bind_ipv6_only_from_string(rvalue)) < 0) { + int r; - s->bind_ipv6_only = r ? SOCKET_ADDRESS_IPV6_ONLY : SOCKET_ADDRESS_BOTH; + if ((r = parse_boolean(rvalue)) < 0) { + log_error("[%s:%u] Failed to parse bind IPv6 only value: %s", filename, line, rvalue); + return -EBADMSG; + } + + s->bind_ipv6_only = r ? SOCKET_ADDRESS_IPV6_ONLY : SOCKET_ADDRESS_BOTH; + } else + s->bind_ipv6_only = b; return 0; } |