Hello all of u .. well i was trying to compile the iscsi module over ma system whn i was faced with this error .. the code segment is as under
So some1 plzz suggest me wat shd i do to get rid of this **** ....
Code:
int
cnv_inet_to_string(struct sockaddr *ip_address, char *ip_string,
char *port_string)
{
__u8 *ptr;
__u32 k;
int i, c;
if (ip_address == NULL) {
i = -EINVAL;
} else if (ip_address->sa_family == AF_INET)
{
[B]ptr = (__u8 *)&((struct sockaddr_in *)ip_address)->sin_addr.s_addr;[/B] //Dereferencing Pointer to incompete type
for (i = 0; i < 3; i++) {
ip_string += sprintf(ip_string, "%u.", *ptr++);
}
sprintf(ip_string, "%u", *ptr);
sprintf(port_string, "%u",
ntohs(((struct sockaddr_in *)ip_address)->sin_port));
i = AF_INET;
} else if (ip_address->sa_family == AF_INET6) {
ptr = (__u8 *)((struct sockaddr_in6 *)ip_address)
->sin6_addr.s6_addr;
c = '[';
for (i = 0; i < 8; i++ ) {
k = *ptr++ << 8;
k += *ptr++;
ip_string += sprintf(ip_string, "%c%x", c, k);
c = ':';
}
sprintf(ip_string, "]");
sprintf(port_string, "%u",
ntohs(((struct sockaddr_in6 *)ip_address)->sin6_port));
i = AF_INET6;
} else {
strcpy(ip_string, "Unknown protocol family");
i = -EPFNOSUPPORT;
}
return i;
}
Comment