summaryrefslogtreecommitdiff
path: root/sbin/dhclient/dhclient.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2013-06-09 17:31:55 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2013-06-09 17:31:55 +0000
commit0693f53fb0b7bdbeafab3f3b7b962a9d6d3ed6e6 (patch)
treed3e2fa96f5d25e9687494a38a749c31045dcaeab /sbin/dhclient/dhclient.c
parent3e2683ad937f6dcdf76303725b90a68fa9e0bbc7 (diff)
Fix/clarify some comments. do memset()'s only when variable is going
to be used.
Diffstat (limited to 'sbin/dhclient/dhclient.c')
-rw-r--r--sbin/dhclient/dhclient.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index 16dd15ac8c7..dc0feac7bff 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.252 2013/06/09 16:21:50 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.253 2013/06/09 17:31:54 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -2285,8 +2285,6 @@ priv_write_file(struct imsg_write_file *imsg)
* or
*
* route -q $rdomain add default $router
- *
- * depending on the contents of the gateway parameter.
*/
void
add_default_route(int rdomain, struct in_addr addr, struct in_addr gateway)
@@ -2299,8 +2297,9 @@ add_default_route(int rdomain, struct in_addr addr, struct in_addr gateway)
addrs = RTA_DST | RTA_NETMASK;
/*
- * Set gateway address if and only if non-zero addr supplied. A
- * gateway address of 0 implies '-iface'.
+ * When 'addr' and 'gateway' are identical the desired behaviour is
+ * to emulate the '-iface' variant of 'route'. This is done by
+ * claiming there is no gateway address to use.
*/
if (bcmp(&gateway, &addr, sizeof(addr)) != 0)
addrs |= RTA_GATEWAY;