diff options
author | James Yonan <james@openvpn.net> | 2011-02-14 03:46:37 +0000 |
---|---|---|
committer | James Yonan <james@openvpn.net> | 2011-02-14 03:46:37 +0000 |
commit | 6a8ea97069b8edb4a50744faae3bab8ecd931840 (patch) | |
tree | 4cfa15f9c70376ff4b99cd6eb2c5e2d9f216a9fe /init.c | |
parent | c65e30f520398d3b031a663978eb7668315add69 (diff) | |
download | openvpn-6a8ea97069b8edb4a50744faae3bab8ecd931840.tar.gz openvpn-6a8ea97069b8edb4a50744faae3bab8ecd931840.tar.xz openvpn-6a8ea97069b8edb4a50744faae3bab8ecd931840.zip |
Implemented get_default_gateway_mac_addr for Mac OS X (previously,
was only defined for Windows and Linux). This enables OS X to report
the MAC address of the default gateway to the server for ID purposes
when client-side --push-peer-info option is specified.
Also, minor fix to OS X get_default_gateway function:
* include net/route.h directly rather than selectively paste stuff
from it into route.c
git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@6925 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'init.c')
-rw-r--r-- | init.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -600,6 +600,27 @@ init_static (void) return false; #endif +#ifdef TEST_GET_DEFAULT_GATEWAY + { + struct gc_arena gc = gc_new (); + in_addr_t addr; + char macaddr[6]; + + if (get_default_gateway(&addr, NULL)) + msg (M_INFO, "GW %s", print_in_addr_t(addr, 0, &gc)); + else + msg (M_INFO, "GDG ERROR"); + + if (get_default_gateway_mac_addr(macaddr)) + msg (M_INFO, "MAC %s", format_hex_ex (macaddr, 6, 0, 1, ":", &gc)); + else + msg (M_INFO, "GDGMA ERROR"); + + gc_free (&gc); + return false; + } +#endif + #ifdef GEN_PATH_TEST { struct gc_arena gc = gc_new (); |