Pass index into listen_socket[] to handle_incoming_vpn_data().

This commit is contained in:
Guus Sliepen 2012-02-22 14:37:56 +01:00
parent 65e8e06c6d
commit 8e717ddb60
2 changed files with 2 additions and 2 deletions

View file

@ -343,7 +343,7 @@ static void check_network_activity(fd_set * readset, fd_set * writeset) {
for(i = 0; i < listen_sockets; i++) {
if(FD_ISSET(listen_socket[i].udp, readset))
handle_incoming_vpn_data(listen_socket[i].udp);
handle_incoming_vpn_data(i);
if(FD_ISSET(listen_socket[i].tcp, readset))
handle_new_meta_connection(listen_socket[i].tcp);

View file

@ -610,7 +610,7 @@ void handle_incoming_vpn_data(int sock) {
socklen_t fromlen = sizeof(from);
node_t *n;
pkt.len = recvfrom(sock, (char *) &pkt.seqno, MAXSIZE, 0, &from.sa, &fromlen);
pkt.len = recvfrom(listen_socket[sock].udp, (char *) &pkt.seqno, MAXSIZE, 0, &from.sa, &fromlen);
if(pkt.len < 0) {
if(!sockwouldblock(sockerrno))