Rahul Gundecha-2 wrote > Hi Mohsin, > > I have http server working simultaneously on both IPv4 and IPv6 sockets. > Here are my suggestions in your code: > 1. Why you are using same "iStatus" for both socket descriptors? > 2. Same question for "sin". For IPv4, you need to use struct sockaddr_in, > whereas for IPv6 struct sockaddr_in6 variable, so two different variables. > 3. iStatus = socket( AF_INET, SOCK_STREAM, 0 ); => 0 should be replaced by > IPPROTO_TCP which is 6
Thank you Rahul for your suggestions. I've already tried changing socket descriptor variables as well as sock struct variables for IPv4 and IPv6 as you suggested above, but none works. Actually, I first bind IPv4 ANY address and then IPv6 ANY address to same port=80 in two different tasks. So in this case, IPv4 is atleast sending SYN+ACK for first TCP SYN request from PC and then RST,ACK whereas IPv6 immediately sends RST,ACK for every TCP req. If I reverse the sequence of bind. i.e. IPv6 ANY address first and then IPv4 ANY address, then IPv6 is able to send SYN+ACK reply to first TCP SYN request whereas IPv4 immediately sends RST,ACK for every SYN req. Hence, I think there happens some conflict in binding of two diff protocols to same port so that whichever is binded first is able to send atleast one SYN+ACK instead of directly RST. Regards, Mohsin -- View this message in context: http://lwip.100.n7.nabble.com/How-to-have-two-different-sockets-for-IPv4-and-IPv6-tp24291p24320.html Sent from the lwip-users mailing list archive at Nabble.com. _______________________________________________ lwip-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/lwip-users
