Skip to contentSkip to conversation

Fix is_ipv6 in case of tap interface.

PATCH In review Dmitrij Tejblum 2 participants 3 messages Feb 8, 2014 – Apr 29, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 src/openvpn/proto.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpn/proto.c +1 -1
index b437f1a..7b58e6a 100644
@@ -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);
     }
Signature · 1 line
1.8.3.4 (Apple Git-47)
#1 lore raw

Hi,

Quoted 4 lines · Dmitrij Tejblum

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.

Yeah. Thanks, it certainly looks like an oversight on my side when implementing mssfix for IPv6 (I don't use TAP and our test framework for TAP isn't doing anything yet that would be affected by mssfix).

Will test & integrate.

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#2 lore raw
In reply to Dmitrij Tejblum

ACK. Sorry for the long delay.

Tested against reference tap server with "--mssfix 1000", verified with tcpdump without/with the patch and IPv4 and IPv6 TCP SYNs.

Your patch has been applied to the master and release/2.3 branches.

commit db037c20086587a609ef33127c15de080270f2cb (master) commit 7227af1131a5d7ae2ea4d8d1cd3cba3001440326 (release/2.3)

Author: Dmitrij Tejblum
Date:   Sat Feb 8 19:33:49 2014 +0400
     Fix is_ipv6 in case of tap interface.

     Signed-off-by: Dmitrij Tejblum <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: http://article.gmane.org/gmane.network.openvpn.devel/8259
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering