search for: listen_socket

Displaying 9 results from an estimated 9 matches for "listen_socket".

2015 Dec 10
2
[PATCH] Receive multiple packets at a time
...- 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 *hostname; - sockaddr_t from; - socklen_t fromlen = sizeof(from); node_t *n; - pkt.len = recvfrom(listen_socket[sock].udp, (char *) &pkt.seqno, MAXSIZE, 0, &from.sa, &fromlen); - - if(pkt.len < 0) { - if(!sockwouldblock(sockerrno)) - logger(LOG_ERR, "Receiving packet failed: %s", sockstrerror(sockerrno)); - return; - } - - sockaddrunmap(&from); /* Some braindead IPv6 impleme...
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
2015 Dec 02
5
[PATCH] Receive multiple packets at a time
...src/net_packet.c.original 2015-10-02 16:26:36.828841493 +0200 +++ src/net_packet.c 2015-10-02 17:15:05.892051503 +0200 @@ -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...
2015 Dec 10
0
[PATCH] Receive multiple packets at a time
...= &pkt[i].seqno; iov[i].iov_len = MAXSIZE; msg[i].msg_hdr.msg_iov = &iov[i]; msg[i].msg_hdr.msg_iovlen = 1; msg[i].msg_hdr.msg_control = NULL; msg[i].msg_hdr.msg_controllen = 0; } num = recvmmsg(listen_socket[sock].udp, msg, MAX_MSG, MSG_DONTWAIT, NULL); if(num < 0) { if(!sockwouldblock(sockerrno)) logger(LOG_ERR, "Receiving packet failed: %s", sockstrerror(sockerrno)); return; } for(i = 0; i < num;...
2005 Feb 26
1
[Fwd: [Xen-changelog] Move xcs to unix domain sockets.]
Just forwarding this changelog from yesterday. xcs now uses Unix domain sockets in unstable. This was a hot thread a couple months back with strong opinions on both sides and no clear resolution on the list, so I thought some people might like to know the developers'' resolution. This should be good news for those seeking tighter dom0''s, particularly those who
2015 Dec 02
0
[PATCH] Receive multiple packets at a time
..._packet.c 2015-10-02 17:15:05.892051503 +0200 > @@ -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_RECVMM...
2010 Sep 20
0
No subject
...,8 @@ =20 /* Add flags (not encrypted) */ =20 - inpkt->len +=3D sizeof(inpkt->flags); + inpkt->len +=3D sizeof(inpkt->flag_bits); + inpkt->flag_bits =3D htonl(inpkt->flag_bits); =20 /* Determine which socket we have to use */ =20 @@ -506,7 +519,7 @@ } #endif =20 - if(sendto(listen_socket[sock].udp, (char *) &inpkt->seqno, inpkt->len, = 0, &(n->address.sa), SALEN(n->address.sa)) < 0 && = !sockwouldblock(sockerrno)) { + if(sendto(listen_socket[sock].udp, (char *) &inpkt->flags, inpkt->len, = 0, &(n->address.sa), SALEN(n->address.sa))...
2011 Jan 03
1
Tinc improvements
...tpkt.flags)); outpkt.len = len; if(c->options & OPTION_TCPONLY) @@ -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_tre...
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