projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Committed by Lubom�r Bulej.
[tinc]
/
src
/
net.c
diff --git
a/src/net.c
b/src/net.c
index
fdedf55
..
246d62c
100644
(file)
--- a/
src/net.c
+++ b/
src/net.c
@@
-117,7
+117,7
@@
cp
do_decrypt((real_packet_t*)packet, &vp, cl->key);
add_mac_addresses(&vp);
do_decrypt((real_packet_t*)packet, &vp, cl->key);
add_mac_addresses(&vp);
- if((lenin = write
_n(tap_fd, &vp, vp.len + 2
)) < 0)
+ if((lenin = write
(tap_fd, &vp, vp.len + sizeof(vp.len)
)) < 0)
syslog(LOG_ERR, "Can't write to tap device: %m");
else
total_tap_out += lenin;
syslog(LOG_ERR, "Can't write to tap device: %m");
else
total_tap_out += lenin;
@@
-921,9
+921,10
@@
cp
*/
int handle_incoming_meta_data(conn_list_t *cl)
{
*/
int handle_incoming_meta_data(conn_list_t *cl)
{
- int x, l = sizeof(x)
, lenin
;
+ int x, l = sizeof(x);
unsigned char tmp[1600];
int request;
unsigned char tmp[1600];
int request;
+ int lenin = 0;
cp
if(getsockopt(cl->meta_socket, SOL_SOCKET, SO_ERROR, &x, &l) < 0)
{
cp
if(getsockopt(cl->meta_socket, SOL_SOCKET, SO_ERROR, &x, &l) < 0)
{
@@
-936,7
+937,7
@@
cp
return -1;
}
return -1;
}
- if(
(lenin = read(cl->meta_socket, &tmp, sizeof(tmp))
) <= 0)
+ if(
read(cl->meta_socket, &tmp, 1
) <= 0)
{
syslog(LOG_ERR, "Receive failed: %m");
return -1;
{
syslog(LOG_ERR, "Receive failed: %m");
return -1;
@@
-950,7
+951,7
@@
cp
if(request_handlers[request] == NULL)
syslog(LOG_ERR, "Unknown request %d.", request);
else
if(request_handlers[request] == NULL)
syslog(LOG_ERR, "Unknown request %d.", request);
else
- if(request_handlers[request](cl
, tmp, lenin
) < 0)
+ if(request_handlers[request](cl) < 0)
return -1;
cp
return 0;
return -1;
cp
return 0;
@@
-970,7
+971,7
@@
cp
if(p->status.remove)
continue;
if(p->status.remove)
continue;
- if(p->status.
active
)
+ if(p->status.
dataopen
)
if(FD_ISSET(p->socket, f))
{
/*
if(FD_ISSET(p->socket, f))
{
/*
@@
-1056,7
+1057,7
@@
cp
}
/*
}
/*
- this is where it al happens...
+ this is where it al
l
happens...
*/
void main_loop(void)
{
*/
void main_loop(void)
{