[Openvpn-devel,v1] tun: drop unused is_ip_packet_valid()

Message ID 20261123141837.2675-1-gert@greenie.muc.de
State New
Headers
Series [Openvpn-devel,v1] tun: drop unused is_ip_packet_valid() |

Commit Message

Gert Doering Nov. 23, 2026, 2:18 p.m. UTC
  From: Razvan Cojocaru <razvanc@mailbox.org>

Its last caller went away with Wintun support in ad7a6945
("win: remove Wintun support").

Change-Id: Ibab5e329d386651ba0dd0e2f4f9bc61c357cdebb
Signed-off-by: Razvan Cojocaru <razvanc@mailbox.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2329
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2329
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <gert@greenie.muc.de>
  

Comments

Gert Doering Nov. 23, 2026, 5:46 p.m. UTC | #1
Something easy before dinner... :-) - obviously correct, BB confirms.

Your patch has been applied to the master branch.

commit 8aa208ae714a19708e3c7264409f0cf51bf0f3b3
Author: Razvan Cojocaru
Date:   Mon Nov 23 15:18:31 2026 +0100

     tun: drop unused is_ip_packet_valid()

     Signed-off-by: Razvan Cojocaru <razvanc@mailbox.org>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2329
     Message-Id: <20261123141837.2675-1-gert@greenie.muc.de>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg41829.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering
  

Patch

diff --git a/src/openvpn/tun.h b/src/openvpn/tun.h
index 61fe943..d8680c6 100644
--- a/src/openvpn/tun.h
+++ b/src/openvpn/tun.h
@@ -502,33 +502,6 @@ 
 int tun_write_win32(struct tuntap *tt, const struct buffer *buf);
 
 static inline bool
-is_ip_packet_valid(const struct buffer *buf)
-{
-    const struct openvpn_iphdr *ih = (const struct openvpn_iphdr *)CBPTR(buf);
-
-    if (OPENVPN_IPH_GET_VER(ih->version_len) == 4)
-    {
-        if (BLENZ(buf) < sizeof(struct openvpn_iphdr))
-        {
-            return false;
-        }
-    }
-    else if (OPENVPN_IPH_GET_VER(ih->version_len) == 6)
-    {
-        if (BLENZ(buf) < sizeof(struct openvpn_ipv6hdr))
-        {
-            return false;
-        }
-    }
-    else
-    {
-        return false;
-    }
-
-    return true;
-}
-
-static inline bool
 tuntap_is_dco_win(const struct tuntap *tt)
 {
     return tt && tt->backend_driver == DRIVER_DCO;