From fdc3c3d7c1fd503785ebbd9a531f55ca1e4493b6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 27 Aug 2024 18:30:51 +0530 Subject: [PATCH] kitten @: Fix a regression connecting to TCP sockets using plain IP addresses rather than hostnames Fixes #7794 --- docs/changelog.rst | 2 ++ tools/cmd/at/socket_io.go | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 233eb97dae6..5a0834f3fe9 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -85,6 +85,8 @@ Detailed list of changes - Remote control: When listening on a UNIX domain socket only allow connections from processes having the same user id (:pull:`7777`) +- kitten @: Fix a regression connecting to TCP sockets using plain IP addresses rather than hostnames (:iss:`7794`) + 0.36.1 [2024-08-24] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tools/cmd/at/socket_io.go b/tools/cmd/at/socket_io.go index c729f801844..ff74d4940e8 100644 --- a/tools/cmd/at/socket_io.go +++ b/tools/cmd/at/socket_io.go @@ -174,8 +174,10 @@ func do_socket_io(io_data *rc_io_data) (serialized_response []byte, err error) { } defer f.Close() } else { - conn, err = net.Dial(global_options.to_network, global_options.to_address) + network := utils.IfElse(global_options.to_network == "ip", "tcp", global_options.to_network) + conn, err = net.Dial(network, global_options.to_address) if err != nil { + err = fmt.Errorf("Failed to connect to %s %s with error: %w", network, global_options.to_address, err) return } }