ginetaddress: fix addr/string conversions on windows
authorDan Winship <danw@gnome.org>
Sun, 2 Jun 2013 21:32:21 +0000 (18:32 -0300)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 9 Jun 2013 22:16:48 +0000 (18:16 -0400)
commitc2ad7d1aa549deff6e0ab34e6981a8f794df729c
tree6e00debe84e95fb57277034da10be7b58555f2d0
parentffddb55ab3ef781822adfad1f64b32a2f1ef09a9
ginetaddress: fix addr/string conversions on windows

When parsing an address, we need to re-set "len" between IPv4 and
IPv6, since WSAStringToAddress() might set it to sizeof(struct sin_addr)
when trying to parse the string as IPv4, even if it fails. Also, we
need to make sure to not pass strings to WSAStringToAddress() that it
will accept but that we don't want it to.

When stringifying an address, we need to clear the sockaddr before
filling it in, so we don't accidentally end up with an unwanted
scope_id or the like.

https://bugzilla.gnome.org/show_bug.cgi?id=701401
gio/ginetaddress.c