X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fnet_packet.c;h=81d0572f9c4a1e43947a8472343fbb008ce40e60;hp=1efc60dd76b4455660b79ea3ee8d24e228380c14;hb=ba8e9c0eb5674d060226a43fef5b8504226d27b3;hpb=85a841258c1a19282b48c6b8663128568c16d9ab diff --git a/src/net_packet.c b/src/net_packet.c index 1efc60dd..81d0572f 100644 --- a/src/net_packet.c +++ b/src/net_packet.c @@ -394,6 +394,9 @@ static void receive_udppacket(node_t *n, vpn_packet_t *inpkt) { void receive_tcppacket(connection_t *c, const char *buffer, int len) { vpn_packet_t outpkt; + if(len > sizeof outpkt.data) + return; + outpkt.len = len; if(c->options & OPTION_TCPONLY) outpkt.priority = 0; @@ -647,7 +650,7 @@ void broadcast_packet(const node_t *from, vpn_packet_t *packet) { for(node = node_udp_tree->head; node; node = node->next) { n = node->data; - if(n->status.reachable && ((n->via == myself && n->nexthop == n) || n->via == n)) + if(n->status.reachable && n != myself && ((n->via == myself && n->nexthop == n) || n->via == n)) send_packet(n, packet); } break;