]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Only warn about non-tackled IPv6 packets once
authorDavid Sommerseth <davids@redhat.com>
Tue, 13 Dec 2011 17:08:24 +0000 (18:08 +0100)
committerDavid Sommerseth <davids@redhat.com>
Tue, 13 Dec 2011 20:16:25 +0000 (21:16 +0100)
When using OpenVPN 2.2 on clients and server with Windows based
clients, it will try to push IPv6 packets through the tunnel.  This
causes the server log to be filled up with log entries like this:

 Wed Jun 29 22:12:51 2011 username/1.2.3.4:56990 Need IPv6 code in mroute_extract_addr_from_packet

This patch modifies this message to state that IPv6 packets are not
tackled in tun mode, and prints it only once.

Trac: 147
Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
mroute.c

index 3debd80f2c02b6f3f23886cee217382cc2afe895..1b3488f37c544e6a64ed4c766353c5d1fd34a501 100644 (file)
--- a/mroute.c
+++ b/mroute.c
@@ -131,6 +131,8 @@ mroute_extract_addr_ipv4 (struct mroute_addr *src,
                          const struct buffer *buf)
 {
   unsigned int ret = 0;
+  static bool ipv6warned = false;
+
   if (BLEN (buf) >= 1)
     {
       switch (OPENVPN_IPH_GET_VER (*BPTR(buf)))
@@ -156,7 +158,10 @@ mroute_extract_addr_ipv4 (struct mroute_addr *src,
          break;
        case 6:
          {
-           msg (M_WARN, "Need IPv6 code in mroute_extract_addr_from_packet"); 
+            if( !ipv6warned ) {
+              msg (M_WARN, "IPv6 in tun mode is not supported in OpenVPN 2.2");
+              ipv6warned = true;
+            }
            break;
          }
        }