Fix memcheck errors like "Syscall param sendmsg(msg.msg_control) points to uninitialised byte(s)"

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2024-07-27 11:13:49 +02:00
parent 550c368ade
commit fd37817ec8

View File

@@ -35,7 +35,7 @@ int send_from(int fd, int nowild, char *packet, size_t len,
union mysockaddr *to, union all_addr *source,
unsigned int iface)
{
struct msghdr msg;
struct msghdr msg = { 0 };
struct iovec iov[1];
union {
struct cmsghdr align; /* this ensures alignment */
@@ -45,7 +45,7 @@ int send_from(int fd, int nowild, char *packet, size_t len,
char control[CMSG_SPACE(sizeof(struct in_addr))];
#endif
char control6[CMSG_SPACE(sizeof(struct in6_pktinfo))];
} control_u;
} control_u = { 0 };
iov[0].iov_base = packet;
iov[0].iov_len = len;