Operating System - HP-UX
1748019 Members
4589 Online
108757 Solutions
New Discussion

How to convert generic sockaddress to protocol specific address

 
Masthan
Advisor

How to convert generic sockaddress to protocol specific address

Hi All,

On HP-Ux ia64 machine, when I type cast a variable from "struct sockaddr" type to "struct sockaddr_in" type I am getting the following warn message at the time of compilation.

"conversion from "struct sockaddr *" to a more strictly aligned type "sockaddr_in *" may cause misaligned" ,

I know why i am getting this warn message. Please let me know if you have any idea to fix this warn message.

Is there any other way to convert generic sockaddr to protocol specific address?

or

Is there any IOCTL which fetches the protocol specific IP address from a generic sockaddr?

Your help is appreciated.

Regards
Masthan
1 REPLY 1
Dennis Handly
Acclaimed Contributor

Re: How to convert generic sockaddress to protocol specific address

>let me know if you have any idea to fix this warn message.

You can add a (void*) cast to suppress the warning.