A code scan tool (coverity) has found some issues in the current libnet native code. Mostly it is about correct usage of pointers to SOCKETADDRESS / struct sockaddr.
Basically the issue is that if struct sockaddr* is passed to a function and later on it is treated as struct sockaddr_in6, the latter structure is wider. So we should correctly pass pointers to SOCKETADDRESS which is a union of both, sockaddr_in and sockaddr_in6.
Besides that, changes make the code a bit nicer to read as several casts can be spared.
Basically the issue is that if struct sockaddr* is passed to a function and later on it is treated as struct sockaddr_in6, the latter structure is wider. So we should correctly pass pointers to SOCKETADDRESS which is a union of both, sockaddr_in and sockaddr_in6.
Besides that, changes make the code a bit nicer to read as several casts can be spared.