+typedef union +{ + struct in_addr ipv4; + struct in6_addr ipv6; +} alfred_addr;
Just out of curiousity (and I suspect the answer is probably "no"). For multicast there is no API to write protocol agnostic socket code, right?
(like these agnostic sockaddr_storage / getaddrinfo() / inet_pton() thingies which you would use for unicast)
To be honest I didn't know about sockaddr_storage - I haven't done much of any IPv6 socket programming.
Looking at what I changed, it would all be changed in a very similar fashion using sockaddr_storage instead of a new alfred_addr - just could have left out the typedef union. I would have had to cast things inside the other routines rather than just accessing the union member. I don't know if there is a preference one way or the other, but they seem to be doing exactly the same thing in my mind.