summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-07-16 02:43:47 +0200
committerMarcel Holtmann <marcel@holtmann.org>2009-07-16 02:43:47 +0200
commite6be58c2322fab098466d66816d99f67ae5a210f (patch)
tree0d312815c73b5e61c2ea0a75dda84000a8809c5c /scripts
parent016c1490e180fa737815bf65f96cc60b1761ed89 (diff)
downloadconnman-e6be58c2322fab098466d66816d99f67ae5a210f.tar.gz
connman-e6be58c2322fab098466d66816d99f67ae5a210f.tar.bz2
connman-e6be58c2322fab098466d66816d99f67ae5a210f.zip
Fix handling of strict-aliasing rules
Diffstat (limited to 'scripts')
-rw-r--r--scripts/pppd-plugin.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/pppd-plugin.c b/scripts/pppd-plugin.c
index e8bae0e1..81cb59c1 100644
--- a/scripts/pppd-plugin.c
+++ b/scripts/pppd-plugin.c
@@ -23,6 +23,7 @@
#include <config.h>
#endif
+#include <string.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@@ -44,12 +45,15 @@ static void notifier_ipup(void *data, int arg)
{
ipcp_options opts = ipcp_gotoptions[0];
ipcp_options peer = ipcp_hisoptions[0];
+ struct in_addr ouraddr, hisaddr;
printf("ipup: data %p arg %d\n", data, arg);
- printf("%s: %s -> %s\n", ifname,
- inet_ntoa(*((struct in_addr *) &opts.ouraddr)),
- inet_ntoa(*((struct in_addr *) &peer.hisaddr)));
+ memcpy(&ouraddr, &opts.ouraddr, sizeof(ouraddr));
+ memcpy(&hisaddr, &peer.hisaddr, sizeof(hisaddr));
+
+ printf("%s: %s -> %s\n",
+ ifname, inet_ntoa(ouraddr), inet_ntoa(hisaddr));
script_unsetenv("USEPEERDNS");
script_unsetenv("DNS1");