diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2011-01-24 17:10:30 -0800 |
---|---|---|
committer | Dmitry Shmidt <dimitrysh@google.com> | 2011-01-24 17:10:30 -0800 |
commit | 7d05a80da8c210d11df657bcec8b19a6bf1e8a16 (patch) | |
tree | 14e9ede4ae8e3a7f3b12603c6caa40f4793f5a2c /libnetutils | |
parent | 97186a9c3d1874ac79f94676dc9f0df1f0815e1f (diff) | |
download | system_core-7d05a80da8c210d11df657bcec8b19a6bf1e8a16.zip system_core-7d05a80da8c210d11df657bcec8b19a6bf1e8a16.tar.gz system_core-7d05a80da8c210d11df657bcec8b19a6bf1e8a16.tar.bz2 |
libnetutils: Fix warning
Change-Id: I2a914314a027e0e542d45dff0c2e6029e9f40615
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'libnetutils')
-rw-r--r-- | libnetutils/ifc_utils.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libnetutils/ifc_utils.c b/libnetutils/ifc_utils.c index 95a144c..8076496 100644 --- a/libnetutils/ifc_utils.c +++ b/libnetutils/ifc_utils.c @@ -25,6 +25,7 @@ #include <sys/types.h> #include <netinet/in.h> #include <arpa/inet.h> +#include <net/if.h> #include <linux/if.h> #include <linux/if_ether.h> @@ -126,7 +127,7 @@ int ifc_get_ifindex(const char *name, int *if_indexp) if(r < 0) return -1; *if_indexp = ifr.ifr_ifindex; - return 0; + return 0; } static int ifc_set_flags(const char *name, unsigned set, unsigned clr) @@ -163,7 +164,7 @@ int ifc_set_addr(const char *name, in_addr_t addr) ifc_init_ifr(name, &ifr); init_sockaddr_in(&ifr.ifr_addr, addr); - + return ioctl(ifc_ctl_sock, SIOCSIFADDR, &ifr); } @@ -184,7 +185,7 @@ int ifc_set_mask(const char *name, in_addr_t mask) ifc_init_ifr(name, &ifr); init_sockaddr_in(&ifr.ifr_addr, mask); - + return ioctl(ifc_ctl_sock, SIOCSIFNETMASK, &ifr); } @@ -200,7 +201,7 @@ int ifc_get_info(const char *name, in_addr_t *addr, in_addr_t *mask, unsigned *f *addr = ((struct sockaddr_in*) &ifr.ifr_addr)->sin_addr.s_addr; } } - + if (mask != NULL) { if(ioctl(ifc_ctl_sock, SIOCGIFNETMASK, &ifr) < 0) { *mask = 0; @@ -333,7 +334,7 @@ int ifc_reset_connections(const char *ifname) init_sockaddr_in(&ifr.ifr_addr, myaddr); result = ioctl(ifc_ctl_sock, SIOCKILLADDR, &ifr); ifc_close(); - + return result; #else return 0; |