diff options
author | Grant Erickson <marathon96@gmail.com> | 2011-07-15 10:21:32 -0700 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2011-07-15 22:32:50 +0200 |
commit | 6427539c5b7b040d902384af6ca0fb2b6c536e3e (patch) | |
tree | 3218c45ff03303a7079494334035fe04aa0997b9 /plugins/loopback.c | |
parent | ef11aabba167f987b53fb5a034d8de14682b83db (diff) | |
download | connman-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.c | 4 |
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); |