Skip to content

Commit 8c7db42

Browse files
Li-Weiweidpgeorge
authored andcommitted
stm32/modnwwiznet5k: Get the IP address of an established socket.
When wiznet5k_socket_accept is called, if a socket is established, get the IP address of the socket.
1 parent ff93fd4 commit 8c7db42

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

ports/stm32/modnwwiznet5k.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,7 @@ STATIC int wiznet5k_socket_accept(mod_network_socket_obj_t *socket, mod_network_
173173
int sr = getSn_SR((uint8_t)socket->u_param.fileno);
174174
if (sr == SOCK_ESTABLISHED) {
175175
socket2->u_param = socket->u_param;
176-
// TODO need to populate this with the correct values
177-
ip[0] = 0;
178-
ip[1] = 0;
179-
ip[2] = 0;
180-
ip[3] = 0;
176+
getSn_DIPR((uint8_t)socket2->u_param.fileno, ip);
181177
*port = getSn_PORT(socket2->u_param.fileno);
182178

183179
// WIZnet turns the listening socket into the client socket, so we

0 commit comments

Comments
 (0)