Displaying 8 results from an estimated 8 matches for "handle_incoming_vpn_data".
2015 Dec 10
2
[PATCH] Receive multiple packets at a time
Hello,
Guus Sliepen, on Wed 02 Dec 2015 13:53:37 +0100, wrote:
> That's great! It would be good though to split
> handle_incoming_vpn_data() into a function that does the actual
> recvfrom/mmsg() and one that processes each individual packet, to reduce
> the level of indentation and make the functions a bit more readable.
> Then I'll merge it :)
Here it is.
Samuel
-------------- next part --------------
diff --git a/con...
2015 Dec 02
5
[PATCH] Receive multiple packets at a time
Hello,
Linux has a recvmmsg() system call which allows to achieve several
recvfrom() at a time. The patch below makes tinc use it (patch against
1.1-pre11). Basically the patch turns the handle_incoming_vpn_data
variables into arrays (of size 1 when recvmmsg is not available, and
thus compiled the same as before), and makes the code index into the
arrays. You may want to use interdiff -w /dev/null patch to better see
what changes the patch makes.
With this patch, I saw the non-ciphered bandwidth achieved...
2015 Dec 10
3
[PATCH] Receive multiple packets at a time
10.12.2015 09:20, Michael Tokarev wrote:
> 10.12.2015 03:35, Samuel Thibault wrote:
> []
>
> I suggest reducing ifdeffery in handle_incoming_vpn_data(), especially
> the error checking code.
>
> The function isn't that large now, it might be much better to have
> two different implementations. Like this (untested, patch attached):
>
> void handle_incoming_vpn_data(int sock) {
>
> #ifdef HAVE_RECVMMSG
> #define...
2015 Dec 02
0
[PATCH] Receive multiple packets at a time
On Wed, Dec 02, 2015 at 12:58:26PM +0100, Samuel Thibault wrote:
> Linux has a recvmmsg() system call which allows to achieve several
> recvfrom() at a time. The patch below makes tinc use it (patch against
> 1.1-pre11). Basically the patch turns the handle_incoming_vpn_data
> variables into arrays (of size 1 when recvmmsg is not available, and
> thus compiled the same as before), and makes the code index into the
> arrays. You may want to use interdiff -w /dev/null patch to better see
> what changes the patch makes.
>
> With this patch, I saw the no...
2015 Dec 10
0
[PATCH] Receive multiple packets at a time
10.12.2015 03:35, Samuel Thibault wrote:
[]
I suggest reducing ifdeffery in handle_incoming_vpn_data(), especially
the error checking code.
The function isn't that large now, it might be much better to have
two different implementations. Like this (untested, patch attached):
void handle_incoming_vpn_data(int sock) {
#ifdef HAVE_RECVMMSG
#define MAX_MSG 256
vpn_packet_t pkt[MAX_MS...
2009 May 26
1
BindToAddress: TCP connections originate from random source address.
...he connection is
established, payload shows up like this:
12:11:17.930350 IP6 2001:780:0:1e::1.655 > 2001:780:106::1.655: UDP, length 108
This time the source address is the expected address, but the other
instance has already learned another IP-address from the TCP connection.
The function `handle_incoming_vpn_data' then fails to look up the host
entry belonging to this IP address and I get the error printed in
line?559:
Received UDP packet from unknown source 2001:780:0:1e::1
I propose to check the `BindToAddress' configuration in
`do_outgoing_connection' and, if set, bind TCP sockets to that...
2015 Dec 02
0
[PATCH] Receive multiple packets at a time
...ec 2, 2015 at 12:58 PM, Samuel Thibault
<samuel.thibault at ens-lyon.org> wrote:
> Hello,
>
> Linux has a recvmmsg() system call which allows to achieve several
> recvfrom() at a time. The patch below makes tinc use it (patch against
> 1.1-pre11). Basically the patch turns the handle_incoming_vpn_data
> variables into arrays (of size 1 when recvmmsg is not available, and
> thus compiled the same as before), and makes the code index into the
> arrays. You may want to use interdiff -w /dev/null patch to better see
> what changes the patch makes.
>
> With this patch, I saw the non...
2011 Jan 03
1
Tinc improvements
...inue;
+ // last_hard_try = now;
+ continue;
}
- if(!n)
- n = e->to;
+ // if(!n)
+ // n = e->to;
- if(!try_mac(e->to, pkt))
+ if (!try_mac(e->to, pkt)) {
continue;
-
- n = e->to;
- break;
+ }
+ return e->to;
}
- return n;
+ return NULL;
}
void handle_incoming_vpn_data(int sock) {
@@ -606,7 +615,7 @@
socklen_t fromlen = sizeof(from);
node_t *n;
- pkt.len = recvfrom(sock, (char *) &pkt.seqno, MAXSIZE, 0, &from.sa, &fromlen);
+ pkt.len = recvfrom(sock, (char *) &pkt.flags, MAXSIZE, 0, &from.sa, &fromlen);
if(pkt.len < 0) {
if...