From: "flichtenheld (Code Review)" Date: Mon, 27 Oct 2025 13:08:14 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <4e245c6f4056f31fc902970d1b7807b6b951adee-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="ngyEBY0AIfM="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: mroute: Remove unused mask argument of mroute_get_in* List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --ngyEBY0AIfM= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1309?usp=3Demail to review the following change. Change subject: mroute: Remove unused mask argument of mroute_get_in* ...................................................................... mroute: Remove unused mask argument of mroute_get_in* These are obsolete since the removal of pf feature. Avoids spurious conversion warnings. Change-Id: I501bf780957a9c685eed5994a15de09c28efc3f0 Signed-off-by: Frank Lichtenheld --- M src/openvpn/mroute.c 1 file changed, 9 insertions(+), 18 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/09/1309/1 diff --git a/src/openvpn/mroute.c b/src/openvpn/mroute.c index 88ea647..b50d48f 100644 --- a/src/openvpn/mroute.c +++ b/src/openvpn/mroute.c @@ -103,17 +103,12 @@ return true; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - static inline void -mroute_get_in_addr_t(struct mroute_addr *ma, const in_addr_t src, unsigned= int mask) +mroute_get_in_addr_t(struct mroute_addr *ma, const in_addr_t src) { if (ma) { - ma->type =3D MR_ADDR_IPV4 | mask; + ma->type =3D MR_ADDR_IPV4; ma->netbits =3D 0; ma->len =3D 4; ma->v4.addr =3D src; @@ -121,11 +116,11 @@ } static inline void -mroute_get_in6_addr(struct mroute_addr *ma, const struct in6_addr src, uns= igned int mask) +mroute_get_in6_addr(struct mroute_addr *ma, const struct in6_addr src) { if (ma) { - ma->type =3D MR_ADDR_IPV6 | mask; + ma->type =3D MR_ADDR_IPV6; ma->netbits =3D 0; ma->len =3D 16; ma->v6.addr =3D src; @@ -161,8 +156,8 @@ { const struct openvpn_iphdr *ip =3D (const struct openv= pn_iphdr *)BPTR(buf); - mroute_get_in_addr_t(src, ip->saddr, 0); - mroute_get_in_addr_t(dest, ip->daddr, 0); + mroute_get_in_addr_t(src, ip->saddr); + mroute_get_in_addr_t(dest, ip->daddr); /* multicast packet? */ if (mroute_is_mcast(ip->daddr)) @@ -192,8 +187,8 @@ gc_free(&gc); #endif - mroute_get_in6_addr(src, ipv6->saddr, 0); - mroute_get_in6_addr(dest, ipv6->daddr, 0); + mroute_get_in6_addr(src, ipv6->saddr); + mroute_get_in6_addr(dest, ipv6->daddr); if (mroute_is_mcast_ipv6(ipv6->daddr)) { @@ -342,7 +337,7 @@ } else { - ma->v6.addr.s6_addr[byte--] &=3D (IPV4_NETMASK_HOST << bit= s_to_clear); + ma->v6.addr.s6_addr[byte--] &=3D (0xFF << bits_to_clear); bits_to_clear =3D 0; } } @@ -552,10 +547,6 @@ } } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - void mroute_helper_free(struct mroute_helper *mh) { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1309?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newchange Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I501bf780957a9c685eed5994a15de09c28efc3f0 Gerrit-Change-Number: 1309 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --ngyEBY0AIfM= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: plaisthos.

flichtenheld would like plaisthos to review this change.

V= iew Change

mroute: Remove unused mask argument of mrou=
te_get_in*

These are obsolete since the removal of pf feature.
Av= oids spurious conversion warnings.

Change-Id: I501bf780957a9c685eed5= 994a15de09c28efc3f0
Signed-off-by: Frank Lichtenheld <frank@...2723...= .>
---
M src/openvpn/mroute.c
1 file changed, 9 insertions(+), = 18 deletions(-)

git pull ssh://gerrit.openvpn.ne=
t:29418/openvpn refs/changes/09/1309/1
diff --git a/src/openvpn/mro=
ute.c b/src/openvpn/mroute.c
index 88ea647..b50d48f 100644<= /span>
--- a/src/openvpn/mroute.c
+++ b/src/openvp= n/mroute.c
@@ -103,17 +103,12 @@
retur= n true;
}

-#if defined(__GNUC__) || defined(__clang__)-#pragma GCC diagnostic push
-#pragma GCC diagnostic i= gnored "-Wconversion"
-#endif
-
static inline void
-mroute_get_in_addr_t(struct mroute_addr *ma, const in_addr_t src,= unsigned int mask)
+= mroute_get_in_addr_t(struct mroute_addr *ma, const in_addr_t src) {
if (ma)
{
- ma->type =3D MR_ADDR_IPV= 4 | mask;

+ ma= ->type =3D MR_ADDR_IPV4;
ma->netbits =3D 0;<= /span>
ma->len =3D 4;
ma->= v4.addr =3D src;
@@ -121,11 +116,11 @@
}

static inline void
-mroute_get_in6_addr(struct mroute_addr *ma,= const struct in6_addr src, unsigned int mask)
+mroute_get_in6_addr(struct mroute_addr *ma, cons= t struct in6_addr src)
{
if (ma)
{
- = ma->type =3D MR_ADDR_IPV6 | mask;
+ ma->type =3D MR_ADDR_IPV6;
ma->netbits =3D 0;

ma->len =3D 16;=
ma->v6.addr =3D src;
@@ -161,8= +156,8 @@
{
= const struct openvpn_iphdr *ip =3D (const struct openvpn_iphdr *)BP= TR(buf);

- mroute_get_in_addr_t(src, ip->saddr, 0);=
- mroute_g= et_in_addr_t(dest, ip->daddr, 0);
+ mroute_get_in_addr_t(src, ip->saddr= );
+ = mroute_get_in_addr_t(dest, ip->daddr);

/* multicast packet? */

= if (mroute_is_mcast(ip->daddr))
@@ -192,8 +18= 7,8 @@
gc_free(&gc);
#endif


- mroute_get_in6_addr(src, ipv6->saddr, 0);
- mrout= e_get_in6_addr(dest, ipv6->daddr, 0);
+ mroute_get_in6_addr(src, ipv6->= saddr);
+ = mroute_get_in6_addr(dest, ipv6->daddr);
=
if (mroute_is_mcast_ipv6(ipv6->daddr))
{
@@ -342,7 +337,7 @@
}
else
{

- = ma->v6.addr.s6_addr[byte--] &=3D (IPV4_NETMASK_HOST <= ;< bits_to_clear);
+ ma->v6.addr.s6_addr[byte--] &=3D (0xFF << bi= ts_to_clear);
bits_to_clear =3D 0;<= br> }
}
@@ -552,= 10 +547,6 @@
}
}

-#if defined(__GNUC__) ||= defined(__clang__)
-#p= ragma GCC diagnostic pop
-
<= span> void

mroute_helper_free(struct mroute_helper *mh)
{

To view, visit change 1309= . To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I501bf780957a9c685eed5994a15= de09c28efc3f0
Gerrit-Change-Number: 1309
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
= --ngyEBY0AIfM=--