From: Roy Marples Date: Sat, 29 Mar 2008 12:53:24 +0000 (+0000) Subject: flush_addresses can become a macro. X-Git-Tag: v4.0.2~520 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6e1e0ba13d9ffaf9e3597a110b81a7f08aa1ee5;p=thirdparty%2Fdhcpcd.git flush_addresses can become a macro. --- diff --git a/if.c b/if.c index d08fa046..9448dd13 100644 --- a/if.c +++ b/if.c @@ -480,16 +480,6 @@ del_route(const char *ifname, struct in_addr destination, return retval; } -int -flush_addresses(const char *ifname) -{ - int retval; - retval = do_interface(ifname, NULL, NULL, NULL, true, false); - if (retval == -1) - logger(LOG_ERR, "do_interface: %s", strerror(errno)); - return retval; -} - in_addr_t get_address(const char *ifname) { diff --git a/if.h b/if.h index 06e73001..3e436cf8 100644 --- a/if.h +++ b/if.h @@ -134,6 +134,8 @@ int do_mtu(const char *, short int); int add_address(const char *, struct in_addr, struct in_addr, struct in_addr); int del_address(const char *, struct in_addr, struct in_addr); 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);