From: Guus Sliepen Date: Wed, 22 Feb 2012 13:37:56 +0000 (+0100) Subject: Pass index into listen_socket[] to handle_incoming_vpn_data(). X-Git-Tag: release-1.0.17~10 X-Git-Url: https://git.tinc-vpn.org/git/browse?a=commitdiff_plain;h=8e717ddb602f01f656369106ec0398efbe9ca4a4;p=tinc Pass index into listen_socket[] to handle_incoming_vpn_data(). --- diff --git a/src/net.c b/src/net.c index fc9ec574..759dbe7b 100644 --- a/src/net.c +++ b/src/net.c @@ -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); diff --git a/src/net_packet.c b/src/net_packet.c index 360f318e..46fc875b 100644 --- a/src/net_packet.c +++ b/src/net_packet.c @@ -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))