I am able to implement a web server using dual stack. However, I have an
MDNS implementation using two UDP sockets, for v4 and v6. My specification
requires me to join and send messages to v4 as well as v6. However, when I
try doing a `sendto` to the IPv4 group (inet_addr("") ), using a
v6 socket, say fd is 'sock6',

to.sin_family = AF_INET;
to.sin_port = port;
to.sin_addr.s_addr = inet_addr("");

len = sendto(sock6, (char *)m->header, size, 0, (struct sockaddr
*)&to, sizeof(struct sockaddr_in));

the following check fails

' if ((to != NULL) && !SOCK_ADDR_TYPE_MATCH(to, sock))'

also if I try to append ::ffff: in the beginning of the address(changing
family accordingly), the joingroup call fails.

As of now I use the same above sockaddr_in `to`  to join v4 group via
setsockopt ADD_MEMBERSHIP. I wanted to know if it is possible to implement
the mdns without using the low level calls as in the lwip's example
mdns(i.e. using socket apis).

On Thu, Oct 6, 2016 at 6:03 PM, Aditya Prakash <aditya.prakash...@gmail.com>

> Hi,
> Two years back I made a web server based on LwIP that uses two sockets,
> one for IPv4 and one for IPv6.
> However recently I have seen that there have been a quite a lot of changes
> regarding dual stack, I am not sure to what extent it is implemented. I was
> wondering whether these changes would allow me to get to use a single
> socket for both IPv4 and IPv6.
> ---------
> Thanks & Regards,
> Aditya Prakash

Thanks & Regards,
Aditya Prakash
lwip-users mailing list

Reply via email to