Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/nsiproxy.sys/tcp.c | 7 +++++-- dlls/nsiproxy.sys/udp.c | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/dlls/nsiproxy.sys/tcp.c b/dlls/nsiproxy.sys/tcp.c index 8e2d7e749a79..0dbee8418b94 100644 --- a/dlls/nsiproxy.sys/tcp.c +++ b/dlls/nsiproxy.sys/tcp.c @@ -534,6 +534,7 @@ static NTSTATUS tcp_conns_enumerate_all( UINT filter, struct nsi_tcp_conn_key *k FILE *fp; char buf[512], *ptr; int inode; + UINT laddr, raddr;
if (!(fp = fopen( "/proc/net/tcp", "r" ))) return ERROR_NOT_SUPPORTED;
@@ -547,15 +548,17 @@ static NTSTATUS tcp_conns_enumerate_all( UINT filter, struct nsi_tcp_conn_key *k while ((ptr = fgets( buf, sizeof(buf), fp ))) { if (sscanf( ptr, "%*x: %x:%hx %x:%hx %x %*s %*s %*s %*s %*s %d", - &key.local.Ipv4.sin_addr.WS_s_addr, &key.local.Ipv4.sin_port, - &key.remote.Ipv4.sin_addr.WS_s_addr, &key.remote.Ipv4.sin_port, + &laddr, &key.local.Ipv4.sin_port, + &raddr, &key.remote.Ipv4.sin_port, &dyn.state, &inode ) != 6) continue; dyn.state = tcp_state_to_mib_state( dyn.state ); if (filter && filter != dyn.state ) continue;
key.local.Ipv4.sin_family = key.remote.Ipv4.sin_family = WS_AF_INET; + key.local.Ipv4.sin_addr.WS_s_addr = laddr; key.local.Ipv4.sin_port = htons( key.local.Ipv4.sin_port ); + key.remote.Ipv4.sin_addr.WS_s_addr = raddr; key.remote.Ipv4.sin_port = htons( key.remote.Ipv4.sin_port );
if (num < *count) diff --git a/dlls/nsiproxy.sys/udp.c b/dlls/nsiproxy.sys/udp.c index 0ba2f835e44d..b5896b07b401 100644 --- a/dlls/nsiproxy.sys/udp.c +++ b/dlls/nsiproxy.sys/udp.c @@ -214,6 +214,7 @@ static NTSTATUS udp_endpoint_enumerate_all( void *key_data, UINT key_size, void struct ipv6_addr_scope *addr_scopes = NULL; unsigned int addr_scopes_size = 0, pid_map_size = 0; struct pid_map *pid_map = NULL; + UINT addr;
TRACE( "%p %d %p %d %p %d %p %d %p\n", key_data, key_size, rw_data, rw_size, dynamic_data, dynamic_size, static_data, static_size, count ); @@ -235,10 +236,11 @@ static NTSTATUS udp_endpoint_enumerate_all( void *key_data, UINT key_size, void while ((ptr = fgets( buf, sizeof(buf), fp ))) { if (sscanf( ptr, "%*u: %x:%hx %*s %*s %*s %*s %*s %*s %*s %d", - &key.local.Ipv4.sin_addr.WS_s_addr, &key.local.Ipv4.sin_port, &inode ) != 3) + &addr, &key.local.Ipv4.sin_port, &inode ) != 3) continue;
key.local.Ipv4.sin_family = WS_AF_INET; + key.local.Ipv4.sin_addr.WS_s_addr = addr; key.local.Ipv4.sin_port = htons( key.local.Ipv4.sin_port );
stat.pid = find_owning_pid( pid_map, pid_map_size, inode );