mirror of
https://github.com/openvswitch/ovs
synced 2025-09-04 00:05:15 +00:00
lib: Fix error reporting in parse_sockaddr_components() for bad port.
Bad port number error is ignored in parse_sockaddr_components(), if port number is invalid, it ouputs a error log and set port to 0. Signed-off-by: Huang Lei <lhuang8@ebay.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
@@ -359,6 +359,7 @@ parse_sockaddr_components(struct sockaddr_storage *ss,
|
|||||||
if (port_s && port_s[0]) {
|
if (port_s && port_s[0]) {
|
||||||
if (!str_to_int(port_s, 10, &port) || port < 0 || port > 65535) {
|
if (!str_to_int(port_s, 10, &port) || port < 0 || port > 65535) {
|
||||||
VLOG_ERR("%s: bad port number \"%s\"", s, port_s);
|
VLOG_ERR("%s: bad port number \"%s\"", s, port_s);
|
||||||
|
goto exit;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
port = default_port;
|
port = default_port;
|
||||||
|
Reference in New Issue
Block a user