summaryrefslogtreecommitdiff
path: root/plugins/loopback.c
diff options
context:
space:
mode:
authorGrant Erickson <marathon96@gmail.com>2011-07-15 10:21:32 -0700
committerMarcel Holtmann <marcel@holtmann.org>2011-07-15 22:32:50 +0200
commit6427539c5b7b040d902384af6ca0fb2b6c536e3e (patch)
tree3218c45ff03303a7079494334035fe04aa0997b9 /plugins/loopback.c
parentef11aabba167f987b53fb5a034d8de14682b83db (diff)
downloadconnman-6427539c5b7b040d902384af6ca0fb2b6c536e3e.tar.gz
connman-6427539c5b7b040d902384af6ca0fb2b6c536e3e.tar.bz2
connman-6427539c5b7b040d902384af6ca0fb2b6c536e3e.zip
loopback: Use Existing Loopback Globals Rather than Temporaries
Use preassigned globals for the loopback address and netmask rather than creating and assigning additional temporaries.
Diffstat (limited to 'plugins/loopback.c')
-rw-r--r--plugins/loopback.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/loopback.c b/plugins/loopback.c
index ba8f51ad..8e6d8cbd 100644
--- a/plugins/loopback.c
+++ b/plugins/loopback.c
@@ -242,7 +242,7 @@ static int setup_loopback(void)
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
- addr.sin_addr.s_addr = inet_addr("127.0.0.1");
+ addr.sin_addr.s_addr = loopback_address;
memcpy(&ifr.ifr_addr, &addr, sizeof(ifr.ifr_addr));
err = ioctl(sk, SIOCSIFADDR, &ifr);
@@ -254,7 +254,7 @@ static int setup_loopback(void)
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
- addr.sin_addr.s_addr = inet_addr("255.0.0.0");
+ addr.sin_addr.s_addr = loopback_netmask;
memcpy(&ifr.ifr_netmask, &addr, sizeof(ifr.ifr_netmask));
err = ioctl(sk, SIOCSIFNETMASK, &ifr);