summaryrefslogtreecommitdiffstats
path: root/init.c
diff options
context:
space:
mode:
authorJames Yonan <james@openvpn.net>2011-02-14 03:46:37 +0000
committerJames Yonan <james@openvpn.net>2011-02-14 03:46:37 +0000
commit6a8ea97069b8edb4a50744faae3bab8ecd931840 (patch)
tree4cfa15f9c70376ff4b99cd6eb2c5e2d9f216a9fe /init.c
parentc65e30f520398d3b031a663978eb7668315add69 (diff)
downloadopenvpn-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.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/init.c b/init.c
index 7f072ae..70357e1 100644
--- a/init.c
+++ b/init.c
@@ -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 ();