summaryrefslogtreecommitdiff
path: root/src/resolve
diff options
context:
space:
mode:
authorSusant Sahani <ssahani@users.noreply.github.com>2016-12-06 16:51:45 +0530
committerLennart Poettering <lennart@poettering.net>2016-12-06 12:21:45 +0100
commit10452f7c93c3a492c1f8fdc4a49b65ddc40b27a2 (patch)
tree4f9bff7fdf68acc0a0c7cc9c9b884f433cc945e2 /src/resolve
parent5efdbf11d1ef7da72d3de58abecd84edefbaf98a (diff)
core: introduce parse_ip_port (#4825)
1. Listed in TODO. 2. Tree wide replace safe_atou16 with parse_ip_port incase it's used for ports.
Diffstat (limited to 'src/resolve')
-rw-r--r--src/resolve/resolve-tool.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/resolve/resolve-tool.c b/src/resolve/resolve-tool.c
index 9d4d04220c..07d9582ccb 100644
--- a/src/resolve/resolve-tool.c
+++ b/src/resolve/resolve-tool.c
@@ -881,8 +881,8 @@ static int resolve_tlsa(sd_bus *bus, const char *address) {
port = strrchr(address, ':');
if (port) {
- r = safe_atou16(port + 1, &port_num);
- if (r < 0 || port_num == 0)
+ r = parse_ip_port(port + 1, &port_num);
+ if (r < 0)
return log_error_errno(r, "Invalid port \"%s\".", port + 1);
address = strndupa(address, port - address);