aboutsummaryrefslogtreecommitdiff
path: root/mroute.c
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-10-15 08:44:02 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-10-15 08:44:02 +0000
commit8bc93d7ffbc127e0b095c7274a68eb0c175f93ae (patch)
treebe0d71b15492041caeb3deb1ac923123a44ea96e /mroute.c
parentMerged --capath patch (Thomas Noel). (diff)
downloadopenvpn-8bc93d7ffbc127e0b095c7274a68eb0c175f93ae.tar.xz
svn merge -r 618:619 $SO/patches/openvpn-2-0_rc16-mh/openvpn
Merged --multihome patch + aggregated sockflags. Pre-2.1_beta3 git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@622 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'mroute.c')
-rw-r--r--mroute.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/mroute.c b/mroute.c
index 0a7bcf6..a7d1215 100644
--- a/mroute.c
+++ b/mroute.c
@@ -168,28 +168,29 @@ mroute_extract_addr_from_packet (struct mroute_addr *src,
}
/*
- * Translate a struct sockaddr_in (saddr)
+ * Translate a struct openvpn_sockaddr (osaddr)
* to a struct mroute_addr (addr).
*/
-bool
-mroute_extract_sockaddr_in (struct mroute_addr *addr, const struct sockaddr_in *saddr, bool use_port)
+bool mroute_extract_openvpn_sockaddr (struct mroute_addr *addr,
+ const struct openvpn_sockaddr *osaddr,
+ bool use_port)
{
- if (saddr->sin_family == AF_INET)
+ if (osaddr->sa.sin_family == AF_INET)
{
if (use_port)
{
addr->type = MR_ADDR_IPV4 | MR_WITH_PORT;
addr->netbits = 0;
addr->len = 6;
- memcpy (addr->addr, &saddr->sin_addr.s_addr, 4);
- memcpy (addr->addr + 4, &saddr->sin_port, 2);
+ memcpy (addr->addr, &osaddr->sa.sin_addr.s_addr, 4);
+ memcpy (addr->addr + 4, &osaddr->sa.sin_port, 2);
}
else
{
addr->type = MR_ADDR_IPV4;
addr->netbits = 0;
addr->len = 4;
- memcpy (addr->addr, &saddr->sin_addr.s_addr, 4);
+ memcpy (addr->addr, &osaddr->sa.sin_addr.s_addr, 4);
}
return true;
}