summaryrefslogtreecommitdiff
path: root/src/openvpn/mroute.h
diff options
context:
space:
mode:
authorBernhard Schmidt <berni@debian.org>2020-09-01 16:52:17 +0200
committerBernhard Schmidt <berni@debian.org>2020-09-01 16:52:17 +0200
commit9fc3b98112217f2d92a67977dbde0987cc7a1803 (patch)
tree29fcc8654ee65d9dd89ade797bea2f3d9dfd9cfd /src/openvpn/mroute.h
parenta8758c0e03eed188dcb9da0e4fd781a67c25bf1e (diff)
parent69b02b1f7fd609d84ace13ab04697158de2418a9 (diff)
Merge branch 'debian/experimental-2.5'
Diffstat (limited to 'src/openvpn/mroute.h')
-rw-r--r--src/openvpn/mroute.h34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/openvpn/mroute.h b/src/openvpn/mroute.h
index 1063a18..c94b132 100644
--- a/src/openvpn/mroute.h
+++ b/src/openvpn/mroute.h
@@ -24,8 +24,6 @@
#ifndef MROUTE_H
#define MROUTE_H
-#if P2MP_SERVER
-
#include "buffer.h"
#include "list.h"
#include "route.h"
@@ -82,7 +80,10 @@ struct mroute_addr {
* valid if MR_WITH_NETBITS is set */
union {
uint8_t raw_addr[MR_MAX_ADDR_LEN]; /* actual address */
- uint8_t eth_addr[OPENVPN_ETH_ALEN];
+ struct {
+ uint8_t addr[OPENVPN_ETH_ALEN];
+ uint16_t vid;
+ } ether;
struct {
in_addr_t addr; /* _network order_ IPv4 address */
in_port_t port; /* _network order_ TCP/UDP port */
@@ -100,7 +101,7 @@ struct mroute_addr {
/* Wrappers to support compilers that do not grok anonymous unions */
mroute_union
#define raw_addr mroute_union.raw_addr
-#define eth_addr mroute_union.eth_addr
+#define ether mroute_union.ether
#define v4 mroute_union.v4
#define v6 mroute_union.v6
#define v4mappedv6 mroute_union.v4mappedv6
@@ -170,6 +171,17 @@ void mroute_helper_add_iroute46(struct mroute_helper *mh, int netbits);
void mroute_helper_del_iroute46(struct mroute_helper *mh, int netbits);
+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,
+ struct mroute_addr *esrc,
+ struct mroute_addr *edest,
+ uint16_t vid,
+ const struct buffer *buf);
+
/*
* Given a raw packet in buf, return the src and dest
* addresses of the packet.
@@ -179,19 +191,10 @@ mroute_extract_addr_from_packet(struct mroute_addr *src,
struct mroute_addr *dest,
struct mroute_addr *esrc,
struct mroute_addr *edest,
+ uint16_t vid,
const struct buffer *buf,
int tunnel_type)
{
- 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,
- struct mroute_addr *esrc,
- struct mroute_addr *edest,
- const struct buffer *buf);
-
unsigned int ret = 0;
verify_align_4(buf);
if (tunnel_type == DEV_TYPE_TUN)
@@ -200,7 +203,7 @@ mroute_extract_addr_from_packet(struct mroute_addr *src,
}
else if (tunnel_type == DEV_TYPE_TAP)
{
- ret = mroute_extract_addr_ether(src, dest, esrc, edest, buf);
+ ret = mroute_extract_addr_ether(src, dest, esrc, edest, vid, buf);
}
return ret;
}
@@ -265,5 +268,4 @@ mroute_addr_reset(struct mroute_addr *ma)
ma->type = MR_ADDR_NONE;
}
-#endif /* P2MP_SERVER */
#endif /* MROUTE_H */