From: Roy Marples Date: Sat, 29 Mar 2008 13:07:39 +0000 (+0000) Subject: Convert has_address into a macro. X-Git-Tag: v4.0.2~519 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4fb54de2c7813d375b4623db290cf43791e3752;p=thirdparty%2Fdhcpcd.git Convert has_address into a macro. --- diff --git a/if.c b/if.c index 9448dd13..57c6f531 100644 --- a/if.c +++ b/if.c @@ -493,14 +493,3 @@ get_address(const char *ifname) logger(LOG_ERR, "do_interface: %s", strerror(errno)); return retval; } - -int -has_address(const char *ifname, struct in_addr address) -{ - int retval; - - retval = do_interface(ifname, NULL, NULL, &address, false, false); - if (retval == -1) - logger(LOG_ERR, "do_interface: %s", strerror(errno)); - return retval; -} diff --git a/if.h b/if.h index 3e436cf8..8f3db081 100644 --- a/if.h +++ b/if.h @@ -137,7 +137,8 @@ int flush_addresses(const char *); #define flush_addresses(ifname) \ do_interface(ifname, NULL, NULL, NULL, true, false) in_addr_t get_address(const char *); -int has_address(const char *, struct in_addr); +#define has_address(ifname, addr) \ + do_interface(ifname, NULL, NULL, (struct in_addr *)&(addr), false, false) int add_route(const char *, struct in_addr, struct in_addr, struct in_addr, int);