]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix is_ipv6 in case of tap interface.
authorDmitrij Tejblum <dt@yandex.ru>
Sat, 8 Feb 2014 15:33:49 +0000 (19:33 +0400)
committerGert Doering <gert@greenie.muc.de>
Tue, 29 Apr 2014 20:35:50 +0000 (22:35 +0200)
While checking a packet on a TAP interface, is_ipv_X() in proto.c
insist that the ethertype must be OPENVPN_ETH_P_IPV4, even if
the protocol is IPv6. So the protocol never match, and, thus,
mssfix doesn't work for IPv6 on TAP interface. Fix that.

Signed-off-by: Dmitrij Tejblum <dt@yandex.ru>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1391873629-14388-1-git-send-email-dt@yandex.ru>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8259
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/proto.c

index b437f1ad97af08d16e54ccdc7150805a103a31c3..7b58e6ab1705c93309376c8a34b45c4a0ccb5d8b 100644 (file)
@@ -60,7 +60,7 @@ is_ipv_X ( int tunnel_type, struct buffer *buf, int ip_ver )
          + sizeof (struct openvpn_iphdr)))
        return false;
       eh = (const struct openvpn_ethhdr *) BPTR (buf);
-      if (ntohs (eh->proto) != OPENVPN_ETH_P_IPV4)
+      if (ntohs (eh->proto) != (ip_ver == 6 ? OPENVPN_ETH_P_IPV6 : OPENVPN_ETH_P_IPV4))
        return false;
       offset = sizeof (struct openvpn_ethhdr);
     }