summaryrefslogtreecommitdiffstats
path: root/src/openvpn/proto.c
diff options
context:
space:
mode:
authorDmitrij Tejblum <dt@yandex.ru>2014-02-08 19:33:49 +0400
committerGert Doering <gert@greenie.muc.de>2014-04-29 22:35:50 +0200
commitdb037c20086587a609ef33127c15de080270f2cb (patch)
tree7518bb78a4b1ea589c2d5b7b42bd7237144af95b /src/openvpn/proto.c
parentea31bc680fc83946b2cc8d0c93544a1ab2a01d63 (diff)
downloadopenvpn-db037c20086587a609ef33127c15de080270f2cb.tar.gz
openvpn-db037c20086587a609ef33127c15de080270f2cb.tar.xz
openvpn-db037c20086587a609ef33127c15de080270f2cb.zip
Fix is_ipv6 in case of tap interface.
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>
Diffstat (limited to 'src/openvpn/proto.c')
-rw-r--r--src/openvpn/proto.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/openvpn/proto.c b/src/openvpn/proto.c
index b437f1a..7b58e6a 100644
--- a/src/openvpn/proto.c
+++ b/src/openvpn/proto.c
@@ -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);
}