diff options
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/cmd/cmd-inet/sbin/dhcpagent/agent.c | 2 | ||||
-rw-r--r-- | usr/src/cmd/cmd-inet/sbin/dhcpagent/bound.c | 1 | ||||
-rw-r--r-- | usr/src/cmd/cmd-inet/sbin/dhcpagent/interface.c | 2 | ||||
-rw-r--r-- | usr/src/cmd/cmd-inet/sbin/dhcpagent/packet.c | 1 | ||||
-rw-r--r-- | usr/src/cmd/cmd-inet/sbin/dhcpagent/release.c | 3 | ||||
-rw-r--r-- | usr/src/cmd/cmd-inet/sbin/dhcpagent/request.c | 38 | ||||
-rw-r--r-- | usr/src/cmd/cmd-inet/sbin/dhcpagent/select.c | 5 |
7 files changed, 35 insertions, 17 deletions
diff --git a/usr/src/cmd/cmd-inet/sbin/dhcpagent/agent.c b/usr/src/cmd/cmd-inet/sbin/dhcpagent/agent.c index aebf723f93..12fda6da80 100644 --- a/usr/src/cmd/cmd-inet/sbin/dhcpagent/agent.c +++ b/usr/src/cmd/cmd-inet/sbin/dhcpagent/agent.c @@ -1430,7 +1430,7 @@ rtsock_event(iu_eh_t *ehp, int fd, short events, iu_event_id_t id, void *arg) */ if (!dsmp->dsm_isv6) { dhcpmsg(MSG_VERBOSE, "rtsock_event: %s has no " - "LIFs left; restarting", dsmp->dsm_name); + "LIFs left", dsmp->dsm_name); dhcp_restart(dsmp); } } else { diff --git a/usr/src/cmd/cmd-inet/sbin/dhcpagent/bound.c b/usr/src/cmd/cmd-inet/sbin/dhcpagent/bound.c index 3c9713666e..26dd80d2c4 100644 --- a/usr/src/cmd/cmd-inet/sbin/dhcpagent/bound.c +++ b/usr/src/cmd/cmd-inet/sbin/dhcpagent/bound.c @@ -215,6 +215,7 @@ dhcp_bound(dhcp_smach_t *dsmp, PKT_LIST *ack) case PRE_BOUND: case BOUND: + case INFORMATION: /* This is just a duplicate ack; silently ignore it */ return (B_TRUE); diff --git a/usr/src/cmd/cmd-inet/sbin/dhcpagent/interface.c b/usr/src/cmd/cmd-inet/sbin/dhcpagent/interface.c index 708a9bce0b..816cd54fe8 100644 --- a/usr/src/cmd/cmd-inet/sbin/dhcpagent/interface.c +++ b/usr/src/cmd/cmd-inet/sbin/dhcpagent/interface.c @@ -428,7 +428,7 @@ pif_status(dhcp_pif_t *pif, boolean_t isup) dhcp_smach_t *dsmp; pif->pif_running = isup; - dhcpmsg(LOG_DEBUG, "interface %s has %s", pif->pif_name, + dhcpmsg(MSG_DEBUG, "interface %s has %s", pif->pif_name, isup ? "come back up" : "gone down"); for (lif = pif->pif_lifs; lif != NULL; lif = lif->lif_next) { for (dsmp = lif->lif_smachs; dsmp != NULL; diff --git a/usr/src/cmd/cmd-inet/sbin/dhcpagent/packet.c b/usr/src/cmd/cmd-inet/sbin/dhcpagent/packet.c index f07b7297b0..bed755a833 100644 --- a/usr/src/cmd/cmd-inet/sbin/dhcpagent/packet.c +++ b/usr/src/cmd/cmd-inet/sbin/dhcpagent/packet.c @@ -1451,7 +1451,6 @@ pkt_smach_enqueue(dhcp_smach_t *dsmp, PKT_LIST *plp) /* add to front of list */ insque(plp, &dsmp->dsm_recv_pkt_list); - dsmp->dsm_received++; } /* diff --git a/usr/src/cmd/cmd-inet/sbin/dhcpagent/release.c b/usr/src/cmd/cmd-inet/sbin/dhcpagent/release.c index 28d4ec77f8..ccd2555b17 100644 --- a/usr/src/cmd/cmd-inet/sbin/dhcpagent/release.c +++ b/usr/src/cmd/cmd-inet/sbin/dhcpagent/release.c @@ -294,8 +294,7 @@ stop_release_decline(dhcp_smach_t *dsmp, unsigned int n_requests) if (dsmp->dsm_leases == NULL) { dhcpmsg(MSG_VERBOSE, "stop_release_decline: " - "%s has no leases left; restarting", - dsmp->dsm_name); + "%s has no leases left", dsmp->dsm_name); dhcp_restart(dsmp); } return (B_TRUE); diff --git a/usr/src/cmd/cmd-inet/sbin/dhcpagent/request.c b/usr/src/cmd/cmd-inet/sbin/dhcpagent/request.c index 0784096a5c..2206ca4b23 100644 --- a/usr/src/cmd/cmd-inet/sbin/dhcpagent/request.c +++ b/usr/src/cmd/cmd-inet/sbin/dhcpagent/request.c @@ -607,6 +607,9 @@ select_best(dhcp_smach_t *dsmp) static void accept_v4_acknak(dhcp_smach_t *dsmp, PKT_LIST *plp) { + /* Account for received and processed messages */ + dsmp->dsm_received++; + if (*plp->opts[CD_DHCP_TYPE]->value == ACK) { if (dsmp->dsm_state != INFORM_SENT && dsmp->dsm_state != INFORMATION && @@ -659,7 +662,7 @@ accept_v4_acknak(dhcp_smach_t *dsmp, PKT_LIST *plp) if (plp->opts[CD_SERVER_ID] == NULL || plp->opts[CD_SERVER_ID]->len != sizeof (ipaddr_t)) { dhcpmsg(MSG_ERROR, "accept_v4_acknak: ACK with no valid " - "server id, restarting DHCP on %s", dsmp->dsm_name); + "server id on %s", dsmp->dsm_name); dsmp->dsm_bad_offers++; free_pkt_entry(plp); dhcp_restart(dsmp); @@ -700,6 +703,17 @@ accept_v6_message(dhcp_smach_t *dsmp, PKT_LIST *plp, const char *pname, uint_t msglen; int status; + /* Account for received and processed messages */ + dsmp->dsm_received++; + + /* We don't yet support Reconfigure at all. */ + if (recv_type == DHCPV6_MSG_RECONFIGURE) { + dhcpmsg(MSG_VERBOSE, "accept_v6_message: ignored Reconfigure " + "on %s", dsmp->dsm_name); + free_pkt_entry(plp); + return; + } + /* * All valid DHCPv6 messages must have our Client ID specified. */ @@ -861,8 +875,7 @@ accept_v6_message(dhcp_smach_t *dsmp, PKT_LIST *plp, const char *pname, "dhcp_bound failed for %s", dsmp->dsm_name); (void) remove_hostconf(dsmp->dsm_name, dsmp->dsm_isv6); - if (dsmp->dsm_state != INFORM_SENT) - dhcp_restart(dsmp); + dhcp_restart(dsmp); } } else { dhcpmsg(MSG_WARNING, "accept_v6_message: Reply: %s", @@ -903,7 +916,7 @@ accept_v6_message(dhcp_smach_t *dsmp, PKT_LIST *plp, const char *pname, free_pkt_entry(plp); if (dsmp->dsm_leases == NULL) { dhcpmsg(MSG_VERBOSE, "accept_v6_message: %s has no " - "leases left; restarting", dsmp->dsm_name); + "leases left", dsmp->dsm_name); dhcp_restart(dsmp); } else if (dsmp->dsm_lif_wait == 0) { (void) set_smach_state(dsmp, BOUND); @@ -992,13 +1005,6 @@ dhcp_acknak_common(iu_eh_t *ehp, int fd, short events, iu_event_id_t id, return; } - if (isv6 && recv_type == DHCPV6_MSG_RECONFIGURE) { - dhcpmsg(MSG_VERBOSE, "dhcp_acknak_common: ignored v6 " - "Reconfigure received via %s", pif->pif_name); - free_pkt_entry(plp); - return; - } - /* * Find the corresponding state machine not using DLPI. * @@ -1117,7 +1123,9 @@ dhcp_acknak_lif(iu_eh_t *ehp, int fd, short events, iu_event_id_t id, } /* - * dhcp_restart(): restarts DHCP (from INIT) on a given state machine + * dhcp_restart(): restarts DHCP (from INIT) on a given state machine, but only + * if we're leasing addresses. Doesn't restart for information- + * only interfaces. * * input: dhcp_smach_t *: the state machine to restart DHCP on * output: void @@ -1126,6 +1134,9 @@ dhcp_acknak_lif(iu_eh_t *ehp, int fd, short events, iu_event_id_t id, void dhcp_restart(dhcp_smach_t *dsmp) { + if (dsmp->dsm_state == INFORM_SENT || dsmp->dsm_state == INFORMATION) + return; + /* * As we're returning to INIT state, we need to discard any leases we * may have, and (for v4) canonize the LIF. There's a bit of tension @@ -1143,6 +1154,9 @@ dhcp_restart(dhcp_smach_t *dsmp) (void) set_smach_state(dsmp, INIT); dsmp->dsm_dflags |= DHCP_IF_FAILED; ipc_action_finish(dsmp, DHCP_IPC_E_MEMORY); + } else { + dhcpmsg(MSG_DEBUG, "dhcp_restart: restarting DHCP on %s", + dsmp->dsm_name); } } diff --git a/usr/src/cmd/cmd-inet/sbin/dhcpagent/select.c b/usr/src/cmd/cmd-inet/sbin/dhcpagent/select.c index e557dfd32c..d0ebdb0a6e 100644 --- a/usr/src/cmd/cmd-inet/sbin/dhcpagent/select.c +++ b/usr/src/cmd/cmd-inet/sbin/dhcpagent/select.c @@ -308,6 +308,9 @@ dhcp_collect_dlpi(iu_eh_t *eh, int fd, short events, iu_event_id_t id, return; } + /* See also accept_v[46]_message; account for processed packets. */ + dsmp->dsm_received++; + if (pkt_v4_match(recv_type, DHCP_PACK)) { if (!dhcp_bound(dsmp, plp)) { dhcpmsg(MSG_WARNING, "dhcp_collect_dlpi: dhcp_bound " @@ -318,6 +321,8 @@ dhcp_collect_dlpi(iu_eh_t *eh, int fd, short events, iu_event_id_t id, dhcpmsg(MSG_VERBOSE, "dhcp_collect_dlpi: %s on %s", pname, dsmp->dsm_name); } else if (pkt_v4_match(recv_type, DHCP_PNAK)) { + dhcpmsg(MSG_VERBOSE, "dhcp_collect_dlpi: %s on %s", + pname, dsmp->dsm_name); free_pkt_entry(plp); dhcp_restart(dsmp); } else { |