search for: sockaddr_t

Displaying 14 results from an estimated 14 matches for "sockaddr_t".

Did you mean: sockaddr_vm
2015 Dec 10
2
[PATCH] Receive multiple packets at a time
...rdup strerror strsignal strtol system unsetenv usleep vsyslog writev], [], [], [#include "src/have.h"] ) diff --git a/src/net_packet.c b/src/net_packet.c index e67857c..174db34 100644 --- a/src/net_packet.c +++ b/src/net_packet.c @@ -695,31 +695,26 @@ static node_t *try_harder(const sockaddr_t *from, const vpn_packet_t *pkt) { return n; } -void handle_incoming_vpn_data(int sock) { - vpn_packet_t pkt; +#ifdef HAVE_RECVMMSG +#define MAX_MSG 256 +#else +#define MAX_MSG 1 +#endif + +static void handle_incoming_vpn_packet(int sock, vpn_packet_t *pkt, sockaddr_t *from) { char *hostnam...
2018 Jan 22
3
tinc 1.1: freeaddrinfo(NULL) crash on windows
On Windows, freeaddrinfo(NULL) will result in a segv. In get_recent_address(), there is the following block of code: if(cache->aip) { sockaddr_t *sa = (sockaddr_t *)cache->aip->ai_addr; cache->aip = cache->aip->ai_next; if(!cache->aip) { freeaddrinfo(cache->aip); cache->aip = NULL; } return sa; }...
2015 Dec 02
5
[PATCH] Receive multiple packets at a time
...-1057,92 +1057,137 @@ return n; } +#ifdef HAVE_RECVMMSG +#define MAX_MSG 256 +#else +#define MAX_MSG 1 +#endif + void handle_incoming_vpn_data(void *data, int flags) { listen_socket_t *ls = data; - vpn_packet_t pkt; + vpn_packet_t pkt[MAX_MSG]; char *hostname; node_id_t nullid = {}; - sockaddr_t addr = {}; - socklen_t addrlen = sizeof addr; + sockaddr_t addr[MAX_MSG] = {}; +#ifdef HAVE_RECVMMSG + struct mmsghdr msg[MAX_MSG]; + struct iovec iov[MAX_MSG]; +#else + socklen_t addrlen = sizeof addr[0]; +#endif node_t *from, *to; bool direct = false; + int num = 1, i; - pkt.offset = 0; - i...
2015 Dec 10
0
[PATCH] Receive multiple packets at a time
...ly 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_MSG]; sockaddr_t from[MAX_MSG]; struct mmsghdr msg[MAX_MSG]; struct iovec iov[MAX_MSG]; int num = 1, i; for(i = 0; i < MAX_MSG; i++) { msg[i].msg_hdr.msg_name = &from[i].sa; msg[i].msg_hdr.msg_namelen = sizeof(from[i]);...
2018 Jan 22
0
tinc 1.1: freeaddrinfo(NULL) crash on windows
On Mon, Jan 22, 2018 at 09:51:33AM -0700, Todd C. Miller wrote: > On Windows, freeaddrinfo(NULL) will result in a segv. In > get_recent_address(), there is the following block of code: > > if(cache->aip) { > sockaddr_t *sa = (sockaddr_t *)cache->aip->ai_addr; > cache->aip = cache->aip->ai_next; > > if(!cache->aip) { > freeaddrinfo(cache->aip); > cache->aip = NULL; > } > &g...
2018 Feb 16
2
tinc 1.1: freeaddrinfo(NULL) crash on windows
...esults in an attempt to connect to an AF_UNSPEC socket with no address, which of course fails. A potential fix, modeled on the "recently seen addresses not in our cache" part of get_recent_address() is: https://github.com/gsliepen/tinc/pull/177 Another approach would be to pass the sockaddr_t to get_recent_address() and fill it in there. I can write a diff for that if you'd like. I also noticed a problem with the recently seen but uncached code which was hidden by a cast as well as a buffer overflow (read, not write). The PR includes fixes for these two as well. - todd
2015 Dec 02
0
[PATCH] Receive multiple packets at a time
...lse > +#define MAX_MSG 1 > +#endif > + > void handle_incoming_vpn_data(void *data, int flags) { > listen_socket_t *ls = data; > - vpn_packet_t pkt; > + vpn_packet_t pkt[MAX_MSG]; > char *hostname; > node_id_t nullid = {}; > - sockaddr_t addr = {}; > - socklen_t addrlen = sizeof addr; > + sockaddr_t addr[MAX_MSG] = {}; > +#ifdef HAVE_RECVMMSG > + struct mmsghdr msg[MAX_MSG]; > + struct iovec iov[MAX_MSG]; > +#else > + socklen_t addrlen = sizeof addr[0]; > +#endif > no...
2018 Feb 17
0
tinc 1.1: freeaddrinfo(NULL) crash on windows
...ng freed memory is always a bug. > A potential fix, modeled on the "recently seen addresses not in our > cache" part of get_recent_address() is: > > https://github.com/gsliepen/tinc/pull/177 Thanks again for providing a patch! > Another approach would be to pass the sockaddr_t to get_recent_address() > and fill it in there. I can write a diff for that if you'd like. The fix in the pull request looks fine, I don't think another approach is better. I'll have to invest some time in improving the test suite, and using code coverage checking to ensure the te...
2015 May 16
1
tinc 1.1 "Got ADD_EDGE ... which does not match existing entry"
On Sat, 16 May 2015, Guus Sliepen wrote: > On Sat, May 16, 2015 at 12:09:52AM +0200, Sven-Haegar Koch wrote: > > > This change is not so good: > > > > Connection with aaa_vpnhub1 (1.2.3.4 port 443) activated > > Error while translating addresses: ai_family not supported > > > > (And then the tinc process exists) > > Hm, I couldn't reproduce
2001 Aug 07
1
(fwd from mbp@samba.org) CVS update: rsync
On 6 Aug 2001, Albert Chin-A-Young <china@thewrittenword.com> wrote: > On Mon, Aug 06, 2001 at 10:30:50PM +1000, Martin Pool wrote: > > Albert, I'd be interested to hear your comments on these, if you have > > time. > > AC_CHECK_TYPE([socklen_t], [int]) is not robust enough. I had a feeling it was too simple to be correct.. :) > Are you familiar with an ftp
2015 Dec 10
3
[PATCH] Receive multiple packets at a time
...'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_MSG]; > sockaddr_t from[MAX_MSG]; > struct mmsghdr msg[MAX_MSG]; > struct iovec iov[MAX_MSG]; > int num = 1, i; > > for(i = 0; i < MAX_MSG; i++) > { > msg[i].msg_hdr.msg_name = &from[i].sa; > msg[i].msg_hdr.msg_nam...
2011 Jan 03
1
Tinc improvements
...-475,6 +481,10 @@ inpkt->len += n->outmaclength; } + /* Add flags (not encrypted) */ + + inpkt->len += sizeof(inpkt->flags); + /* Determine which socket we have to use */ for(sock = 0; sock < listen_sockets; sock++) @@ -574,29 +584,28 @@ static node_t *try_harder(const sockaddr_t *from, const vpn_packet_t *pkt) { avl_node_t *node; edge_t *e; - node_t *n = NULL; static time_t last_hard_try = 0; - for(node = edge_weight_tree->head; node; node = node->next) { + for (node = edge_weight_tree->head; node; node = node->next) { e = node->data; - if(sock...
2010 Nov 13
3
[PATCH 1/4] Experimental IFF_ONE_QUEUE support for Linux
--- doc/tinc.conf.5.in | 3 +++ src/linux/device.c | 7 +++++++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/doc/tinc.conf.5.in b/doc/tinc.conf.5.in index 2bfd5fe..01f7f81 100644 --- a/doc/tinc.conf.5.in +++ b/doc/tinc.conf.5.in @@ -255,6 +255,9 @@ a lookup if your DNS server is not responding. This does not affect resolving hostnames to IP addresses from the host
2007 Jul 21
2
tincctl patches
(Second try to send this. I wonder if the first one gotten eaten by a spam filter; I'll link to patches instead of attaching them.) Here are the tincctl patches I've been working on. They apply to http://www.tinc-vpn.org/svn/tinc/branches/1.1@1545. I intend to commit them once the crypto stuff's fixed. Since they're basically done, I'm emailing them now for review and in case