Skip to contentSkip to conversation

rename mroute_extract_addr_ipv4 to mroute_extract_addr_ip

PATCH In review Antonio Quartulli 2 participants 2 messages Jul 24, 2017 – Aug 17, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rename mroute_extract_addr_ipv4 to mroute_extract_addr_ip

mroute_extract_addr_ipv4() is able to extract an IPv4 as well as an IPv6. Remove the "v4" suffix from its name to make this behaviour more explicit.

---
 src/openvpn/mroute.c | 7 +++----
 src/openvpn/mroute.h | 8 ++++----
 2 files changed, 7 insertions(+), 8 deletions(-)
src/openvpn/mroute.c +3 -4
index 7b46a6a2..74ee360c 100644
@@ -159,9 +159,8 @@ mroute_extract_addr_arp(struct mroute_addr *src,
 #endif /* ifdef ENABLE_PF */
 
 unsigned int
-mroute_extract_addr_ipv4(struct mroute_addr *src,
-                         struct mroute_addr *dest,
-                         const struct buffer *buf)
+mroute_extract_addr_ip(struct mroute_addr *src, struct mroute_addr *dest,
+                       const struct buffer *buf)
 {
     unsigned int ret = 0;
     if (BLEN(buf) >= 1)
@@ -267,7 +266,7 @@ mroute_extract_addr_ether(struct mroute_addr *src,
                 switch (ntohs(eth->proto))
                 {
                     case OPENVPN_ETH_P_IPV4:
-                        ret |= (mroute_extract_addr_ipv4(esrc, edest, &b) << MROUTE_SEC_SHIFT);
+                        ret |= (mroute_extract_addr_ip(esrc, edest, &b) << MROUTE_SEC_SHIFT);
                         break;
 
                     case OPENVPN_ETH_P_ARP:
src/openvpn/mroute.h +4 -4
index e57a9506..35361fbd 100644
@@ -181,9 +181,9 @@ mroute_extract_addr_from_packet(struct mroute_addr *src,
                                 const struct buffer *buf,
                                 int tunnel_type)
 {
-    unsigned int mroute_extract_addr_ipv4(struct mroute_addr *src,
-                                          struct mroute_addr *dest,
-                                          const struct buffer *buf);
+    unsigned int mroute_extract_addr_ip(struct mroute_addr *src,
+                                     struct mroute_addr *dest,
+                                     const struct buffer *buf);
 
     unsigned int mroute_extract_addr_ether(struct mroute_addr *src,
                                            struct mroute_addr *dest,
@@ -195,7 +195,7 @@ mroute_extract_addr_from_packet(struct mroute_addr *src,
     verify_align_4(buf);
     if (tunnel_type == DEV_TYPE_TUN)
     {
-        ret = mroute_extract_addr_ipv4(src, dest, buf);
+        ret = mroute_extract_addr_ip(src, dest, buf);
     }
     else if (tunnel_type == DEV_TYPE_TAP)
     {
Signature · 1 line
2.13.3
#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

ACK. Simple and easy change.

Your patch has been applied to the following branches

commit 3b38c43b8d7aa22b3df12029ff43e0414891e48c (master) commit 78b329180bc1f1365b421907c6ad370c448db406 (release/2.4)

Author: Antonio Quartulli
Date:   Mon Jul 24 22:35:59 2017 +0800
     rename mroute_extract_addr_ipv4 to mroute_extract_addr_ip

     Signed-off-by: Antonio Quartulli <[email protected]...>
     Acked-by: David Sommerseth <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg15129.html
     Signed-off-by: David Sommerseth <[email protected]...>

- --
kind regards,

David Sommerseth

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAEBCgAGBQJZla1kAAoJEIbPlEyWcf3yZvIP/273G4Lp7RkcG5SNZW9dEgfC CffqIJb9shJstX+XKaFiGFjgYLbxmlc2YlNSLK8FKjRr9hvGZfqyw2NaDX2ojVBU 6pRmt4S+1wCoimGMjWBw8iH7n6cDAGsdmojPnfWJzi94MV9XPsJ2E9k870hpayH7 Jnm4hgc8W/FXJbM2vedhyMpDS5QwBxUikSptphKodAZdFXZm/fKt3JCLBi6ZnKOA pMHb/ZRduuySur0Z550Af4LymWmJabKLy/FpO5VZRcCN7VZ3Vz9PDiHVeuVrUO0z 9dp2NH4ZZ421/WOAHH2l7dCIFpccNg375iY7a2xXRsgexACJXZ03yUC+c81+NjDc taaQXKJX9tDIQtVGg03rJdAyTAYBbwyEk7MICk+Oqz6oER3wXIlVyONrPhwnaXlg DS3/EBVcQl9uExRBo7kW38SgZrmy6jvIkoJb35QTBJGhdgw2zrE78NAo+p8wLTxC cWs9PY6DUB+rSLDe1bN0xPwlh+Xv72BiZQ3OT8A51lh3qXNRK981wz/cTVY7U1Oh jLJ5Oex924uws2nxb3w9eKvhklFb6GttOF3rPO9OTAX/tI1f7GX/5QjdOumcaewG HKnfI3zJ6Yq5QIZdjg5kVil1v9lYpHspL6httDKR6gni957vKJ0YGyH4o7L0BLA2 MfYl6+SOHfSKOEuXeNBX
=zrkJ
-----END PGP SIGNATURE-----