Skip to content

Commit 2ae1823

Browse files
flichtenheldcron2
authored andcommitted
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 <[email protected]> Acked-by: Gert Doering <[email protected]> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1309 Message-Id: <[email protected]> URL: https://www.mail-archive.com/[email protected]/msg33939.html Signed-off-by: Gert Doering <[email protected]>
1 parent 5bc0eae commit 2ae1823

File tree

1 file changed

+9
-18
lines changed

1 file changed

+9
-18
lines changed

src/openvpn/mroute.c

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -103,29 +103,24 @@ mroute_learnable_address(const struct mroute_addr *addr, struct gc_arena *gc)
103103
return true;
104104
}
105105

106-
#if defined(__GNUC__) || defined(__clang__)
107-
#pragma GCC diagnostic push
108-
#pragma GCC diagnostic ignored "-Wconversion"
109-
#endif
110-
111106
static inline void
112-
mroute_get_in_addr_t(struct mroute_addr *ma, const in_addr_t src, unsigned int mask)
107+
mroute_get_in_addr_t(struct mroute_addr *ma, const in_addr_t src)
113108
{
114109
if (ma)
115110
{
116-
ma->type = MR_ADDR_IPV4 | mask;
111+
ma->type = MR_ADDR_IPV4;
117112
ma->netbits = 0;
118113
ma->len = 4;
119114
ma->v4.addr = src;
120115
}
121116
}
122117

123118
static inline void
124-
mroute_get_in6_addr(struct mroute_addr *ma, const struct in6_addr src, unsigned int mask)
119+
mroute_get_in6_addr(struct mroute_addr *ma, const struct in6_addr src)
125120
{
126121
if (ma)
127122
{
128-
ma->type = MR_ADDR_IPV6 | mask;
123+
ma->type = MR_ADDR_IPV6;
129124
ma->netbits = 0;
130125
ma->len = 16;
131126
ma->v6.addr = src;
@@ -161,8 +156,8 @@ mroute_extract_addr_ip(struct mroute_addr *src, struct mroute_addr *dest, const
161156
{
162157
const struct openvpn_iphdr *ip = (const struct openvpn_iphdr *)BPTR(buf);
163158

164-
mroute_get_in_addr_t(src, ip->saddr, 0);
165-
mroute_get_in_addr_t(dest, ip->daddr, 0);
159+
mroute_get_in_addr_t(src, ip->saddr);
160+
mroute_get_in_addr_t(dest, ip->daddr);
166161

167162
/* multicast packet? */
168163
if (mroute_is_mcast(ip->daddr))
@@ -192,8 +187,8 @@ mroute_extract_addr_ip(struct mroute_addr *src, struct mroute_addr *dest, const
192187
gc_free(&gc);
193188
#endif
194189

195-
mroute_get_in6_addr(src, ipv6->saddr, 0);
196-
mroute_get_in6_addr(dest, ipv6->daddr, 0);
190+
mroute_get_in6_addr(src, ipv6->saddr);
191+
mroute_get_in6_addr(dest, ipv6->daddr);
197192

198193
if (mroute_is_mcast_ipv6(ipv6->daddr))
199194
{
@@ -342,7 +337,7 @@ mroute_addr_mask_host_bits(struct mroute_addr *ma)
342337
}
343338
else
344339
{
345-
ma->v6.addr.s6_addr[byte--] &= (IPV4_NETMASK_HOST << bits_to_clear);
340+
ma->v6.addr.s6_addr[byte--] &= (0xFF << bits_to_clear);
346341
bits_to_clear = 0;
347342
}
348343
}
@@ -552,10 +547,6 @@ mroute_helper_del_iroute46(struct mroute_helper *mh, int netbits)
552547
}
553548
}
554549

555-
#if defined(__GNUC__) || defined(__clang__)
556-
#pragma GCC diagnostic pop
557-
#endif
558-
559550
void
560551
mroute_helper_free(struct mroute_helper *mh)
561552
{

0 commit comments

Comments
 (0)