summaryrefslogtreecommitdiffstats
path: root/if-bsd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-03-29 16:50:18 +0000
committerRoy Marples <roy@marples.name>2008-03-29 16:50:18 +0000
commitc910d0d0a84907051c6436c9fef97e30b2aec212 (patch)
tree43ba250487d191ec6c6bfcdd4081d05fe91f121b /if-bsd.c
parentb4fb54de2c7813d375b4623db290cf43791e3752 (diff)
downloaddhcpcd-c910d0d0a84907051c6436c9fef97e30b2aec212.tar.xz
Remove all logging from if.c and into the proper bits.
Diffstat (limited to 'if-bsd.c')
-rw-r--r--if-bsd.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/if-bsd.c b/if-bsd.c
index 41ca61c8..4da02999 100644
--- a/if-bsd.c
+++ b/if-bsd.c
@@ -96,7 +96,7 @@ if_address(const char *ifname, struct in_addr address,
int
if_route(const char *ifname, struct in_addr destination,
struct in_addr netmask, struct in_addr gateway,
- int metric, int change, int del)
+ int metric, int action)
{
int s;
static int seq;
@@ -126,7 +126,12 @@ if_route(const char *ifname, struct in_addr destination,
memset(&rtm, 0, sizeof(rtm));
rtm.hdr.rtm_version = RTM_VERSION;
rtm.hdr.rtm_seq = ++seq;
- rtm.hdr.rtm_type = change ? RTM_CHANGE : del ? RTM_DELETE : RTM_ADD;
+ if (action == 0)
+ rtm.hdr.rtm_type = RTM_CHANGE;
+ else if (action > 0)
+ rtm.hdr.rtm_type = RTM_ADD;
+ else
+ rtm.hdr.rtm_type = RTM_DELETE;
rtm.hdr.rtm_flags = RTF_UP | RTF_STATIC;
/* This order is important */