summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2006-01-10 04:53:20 +0000
committerbrooks <brooks@FreeBSD.org>2006-01-10 04:53:20 +0000
commit1c7bd4aed4bda77a690703a2e5f4023a68f850fb (patch)
tree878439821a58f41cf22b2d5badff6d336e58f584 /sbin
parent1218aa562705d6bca13ef113ee55d30b3a1d62ea (diff)
downloadFreeBSD-src-1c7bd4aed4bda77a690703a2e5f4023a68f850fb.zip
FreeBSD-src-1c7bd4aed4bda77a690703a2e5f4023a68f850fb.tar.gz
Allow users to add aliases to the interface.
PR: bin/87465 (different solution used) MFC after: 1 week
Diffstat (limited to 'sbin')
-rw-r--r--sbin/dhclient/dhclient.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index 2c722fe..40e68af 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -200,13 +200,23 @@ routehandler(struct protocol *p)
switch (rtm->rtm_type) {
case RTM_NEWADDR:
+ /*
+ * XXX: If someone other than us adds our address,
+ * we should assume they are taking over from us,
+ * delete the lease record, and exit without modifying
+ * the interface.
+ */
+ break;
+ case RTM_DELADDR:
ifam = (struct ifa_msghdr *)rtm;
+
if (ifam->ifam_index != ifi->index)
break;
if (findproto((char *)(ifam + 1), ifam->ifam_addrs) != AF_INET)
break;
- if (ifi == NULL)
- goto die;
+ if (scripttime == 0 || t < scripttime + 10)
+ break;
+
sa = get_ifa((char *)(ifam + 1), ifam->ifam_addrs);
if (sa == NULL)
goto die;
@@ -221,17 +231,7 @@ routehandler(struct protocol *p)
if (addr_eq(a, l->address))
break;
- if (l != NULL) /* new addr is the one we set */
- break;
-
- goto die;
- case RTM_DELADDR:
- ifam = (struct ifa_msghdr *)rtm;
- if (ifam->ifam_index != ifi->index)
- break;
- if (findproto((char *)(ifam + 1), ifam->ifam_addrs) != AF_INET)
- break;
- if (scripttime == 0 || t < scripttime + 10)
+ if (l == NULL) /* deleted addr is not the one we set */
break;
goto die;
case RTM_IFINFO:
OpenPOWER on IntegriCloud