LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   error: ‘struct in6_addr’ has no member named ‘in6_u’ (https://www.linuxquestions.org/questions/programming-9/error-%91struct-in6_addr%92-has-no-member-named-%91in6_u%92-687702/)

deb1513 12-02-2008 06:40 AM

error: ‘struct in6_addr’ has no member named ‘in6_u’
 
Hi,

while compiling my program in Fedora version- 9 i am getting the following compilation error.

error: ‘struct in6_addr’ has no member named ‘in6_u’

The same program is running in other Fedora versions like Fedora 8 and Fedora 6.

Can any one tell me what is solution for this. I have the snap shot of my prog,

struct sockaddr_in6* sin6 = (struct sockaddr_in6*)&curr->addr;

sin6->sin6_family = AF_INET6;
memcpy (&sin6->sin6_addr.in6_u.u6_addr8,
addr, sizeof(sin6->sin6_addr.in6_u.u6_addr8));


After compilation getting error,

error: ‘struct in6_addr’ has no member named ‘in6_u’

dmail 12-02-2008 06:56 AM

Quote:

The <netinet/in.h> header shall define the in6_addr structure that contains at least the following member:

uint8_t s6_addr[16]

http://www.opengroup.org/onlinepubs/...inet/in.h.html
Code:

memcpy(&sin6->sin6_addr, addr, sizeof(in6_addr));


All times are GMT -5. The time now is 04:55 AM.