Skip to content

Commit a289664

Browse files
committed
Fix error for getting ipv4 address
Signed-off-by: carlosb1 <[email protected]>
1 parent 41a83b0 commit a289664

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sys/socket/addr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ impl SockaddrIn {
10071007
/// Returns the IP address associated with this socket address, in native
10081008
/// endian.
10091009
pub fn ip(&self) -> net::Ipv4Addr {
1010-
net::Ipv4Addr::from(addr.0.sin_addr.s_addr.to_ne_bytes())
1010+
net::Ipv4Addr::from(self.0.sin_addr.s_addr.to_ne_bytes())
10111011
}
10121012

10131013
/// Creates a new socket address from IPv4 octets and a port number.

0 commit comments

Comments
 (0)