zpl-c / enet

⚡️ ENet reliable UDP networking library
https://blog.zpl.pw
MIT License
688 stars 59 forks source link

enet_address_get_host_ip does not return valid ipv4 #14

Closed RootKiller closed 2 years ago

RootKiller commented 5 years ago

Hi!

When calling enet_address_get_host_ip on ipv4 peer it returns the following string ::ffff:127.0.0.1

nxrighthere commented 5 years ago

This is because IPv4-mapped IPv6 addresses are used, it can be solved this way or by probing a string for ::ffff: characters and shrinking it by first 7 bytes.