socket-util: add more careful parsers for AF_VSOCK cid/port
Let's handle the magic CIDs, and filter out invalid ports.
This commit is contained in:
@@ -374,6 +374,9 @@ int socket_get_mtu(int fd, int af, size_t *ret);
|
||||
|
||||
int connect_unix_path(int fd, int dir_fd, const char *path);
|
||||
|
||||
int vsock_parse_port(const char *s, unsigned *ret);
|
||||
int vsock_parse_cid(const char *s, unsigned *ret);
|
||||
|
||||
/* Parses AF_UNIX and AF_VSOCK addresses. AF_INET[6] require some netlink calls, so it cannot be in
|
||||
* src/basic/ and is done from 'socket_local_address from src/shared/. Return -EPROTO in case of
|
||||
* protocol mismatch. */
|
||||
|
||||
Reference in New Issue
Block a user