mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:45:07 -05:00
util: move and improve sockaddr-specific functions
Move the functions to socket.c and improve them to require and check the sockaddr length.
This commit is contained in:
4
socket.h
4
socket.h
@@ -124,4 +124,8 @@ extern int SCK_RemoveSocket(int sock_fd);
|
||||
/* Close the socket */
|
||||
extern void SCK_CloseSocket(int sock_fd);
|
||||
|
||||
/* Convert between IPSockAddr and sockaddr_in/in6 */
|
||||
extern void SCK_SockaddrToIPSockAddr(struct sockaddr *sa, int sa_length, IPSockAddr *ip_sa);
|
||||
extern int SCK_IPSockAddrToSockaddr(IPSockAddr *ip_sa, struct sockaddr *sa, int sa_length);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user