Update the address of the Free Software Foundation in all copyright headers.
[tinc] / src / net_packet.c
index 5e503f5..426fa49 100644 (file)
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-    $Id$
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
 #include "system.h"
@@ -71,7 +69,7 @@ void send_mtu_probe(node_t *n)
        n->mtuevent = NULL;
 
        if(!n->status.reachable) {
-               ifdebug(TRAFFIC) logger(LOG_INFO, _("Trying to send MTU probe to unreachable node %s (%s)"), n->name, n->hostname);
+               logger(LOG_DEBUG, _("Trying to send MTU probe to unreachable node %s (%s)"), n->name, n->hostname);
                return;
        }
 
@@ -87,7 +85,7 @@ void send_mtu_probe(node_t *n)
                        return;
                }
 
-               len = n->minmtu + 1 + random() % (n->maxmtu - n->minmtu);
+               len = n->minmtu + 1 + rand() % (n->maxmtu - n->minmtu);
                if(len < 64)
                        len = 64;
                
@@ -355,9 +353,9 @@ static void send_udppacket(node_t *n, vpn_packet_t *origpkt)
                return;
        }
 
-       if(n->options & OPTION_PMTU_DISCOVERY && !n->minmtu && (inpkt->data[12] | inpkt->data[13])) {
+       if(n->options & OPTION_PMTU_DISCOVERY && inpkt->len > n->minmtu && (inpkt->data[12] | inpkt->data[13])) {
                ifdebug(TRAFFIC) logger(LOG_INFO,
-                               _("No minimum MTU established yet for %s (%s), forwarding via TCP"),
+                               _("Packet for %s (%s) larger than minimum MTU, forwarding via TCP"),
                                n->name, n->hostname);
 
                send_tcppacket(n->nexthop->connection, origpkt);