From 8e717ddb602f01f656369106ec0398efbe9ca4a4 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Wed, 22 Feb 2012 14:37:56 +0100 Subject: [PATCH] Pass index into listen_socket[] to handle_incoming_vpn_data(). --- src/net.c | 2 +- src/net_packet.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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)) -- 2.20.1