Skip to content

Commit f1e699a

Browse files
committed
Fix a bug in ipv4 mode
1 parent 8eb3f0d commit f1e699a

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

src/command.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,16 @@ int command_handler()
146146
}
147147
info_printf("%s gdb client registered.\n", ip_buf);
148148

149-
client_addr_size = sizeof(client_addr6);
150-
151-
CHECK(sendto(command_socket, buf, recv_len, 0, (struct sockaddr *)&client_addr6, client_addr_size) != -1);
149+
if (arg_opt_6)
150+
{
151+
client_addr_size = sizeof(client_addr6);
152+
CHECK(sendto(command_socket, buf, recv_len, 0, (struct sockaddr *)&client_addr6, client_addr_size) != -1);
153+
}
154+
else
155+
{
156+
client_addr_size = sizeof(client_addr4);
157+
CHECK(sendto(command_socket, buf, recv_len, 0, (struct sockaddr *)&client_addr4, client_addr_size) != -1);
158+
}
152159

153160
break;
154161
case COMMAND_GDBSERVER_ATTACH:

src/debug-server.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#define COMMAND_PORT 9545
66
#define GDBSERVER_PORT 9549
77

8-
#define VERSION "1.4.0"
8+
#define VERSION "1.4.1"
99

1010
#define COMMAND_GDB_REGISTER 0x01
1111
#define COMMAND_GDBSERVER_ATTACH 0x02

0 commit comments

Comments
 (0)