zpl-c / enet

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

enet_address_get_host_ip does not return valid ipv4 #14

Closed RootKiller closed 1 year ago

RootKiller commented 4 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 4 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.