This commit is contained in:
def 2018-12-17 20:49:25 +01:00
parent 87887b7291
commit bfa25bac4a
2 changed files with 5 additions and 4 deletions

View file

@ -1538,7 +1538,7 @@ void net_init_mmsgs(MMSGS* m)
m->msgs[i].msg_hdr.msg_iov = &(m->iovecs[i]);
m->msgs[i].msg_hdr.msg_iovlen = 1;
m->msgs[i].msg_hdr.msg_name = &(m->sockaddrs[i]);
m->msgs[i].msg_hdr.msg_namelen = sizeof(struct sockaddr);
m->msgs[i].msg_hdr.msg_namelen = sizeof(m->sockaddrs[i]);
}
#endif
}
@ -1570,7 +1570,7 @@ int net_udp_recv(NETSOCKET sock, NETADDR *addr, void *data, int maxsize, MMSGS*
if(m->pos < m->size)
{
sockaddr_to_netaddr(&(m->sockaddrs[m->pos]), addr);
sockaddr_to_netaddr((struct sockaddr *)&(m->sockaddrs[m->pos]), addr);
// TODO: network_stats
//network_stats.recv_bytes += bytes;
//network_stats.recv_packets++;

View file

@ -24,6 +24,7 @@
#ifdef CONF_PLATFORM_LINUX
#include <sys/socket.h>
#include <netinet/in.h>
#endif
#ifdef __cplusplus
@ -765,8 +766,8 @@ typedef struct
int size;
struct mmsghdr msgs[VLEN];
struct iovec iovecs[VLEN];
char bufs[VLEN][PACKETSIZE+1];
struct sockaddr sockaddrs[VLEN];
char bufs[VLEN][PACKETSIZE];
struct sockaddr_in sockaddrs[VLEN];
#else
int dummy;
#endif