diff options
author | james <james@e7ae566f-a301-0410-adde-c780ea21d3b5> | 2005-10-15 08:44:02 +0000 |
---|---|---|
committer | james <james@e7ae566f-a301-0410-adde-c780ea21d3b5> | 2005-10-15 08:44:02 +0000 |
commit | 8bc93d7ffbc127e0b095c7274a68eb0c175f93ae (patch) | |
tree | be0d71b15492041caeb3deb1ac923123a44ea96e /mroute.c | |
parent | Merged --capath patch (Thomas Noel). (diff) | |
download | openvpn-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.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -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; } |