[systemd-devel] [PATCH] dhcp-network: remove unused DHCP6_STATE_RS

Dan Williams dcbw at redhat.com
Tue Jul 22 15:18:14 PDT 2014


Probably a left-over from when router solicitations were
requested in the DHCP6 code.  But since they are now separate,
this state is no longer needed.

Signed-off-by: Dan Williams <dcbw at redhat.com>
---
 src/libsystemd-network/dhcp6-protocol.h  | 1 -
 src/libsystemd-network/sd-dhcp6-client.c | 4 ----
 2 files changed, 5 deletions(-)

diff --git a/src/libsystemd-network/dhcp6-protocol.h b/src/libsystemd-network/dhcp6-protocol.h
index e9ae598..eaa6717 100644
--- a/src/libsystemd-network/dhcp6-protocol.h
+++ b/src/libsystemd-network/dhcp6-protocol.h
@@ -67,15 +67,14 @@ enum {
         DHCP6_DUID_EN                           = 2,
         DHCP6_DUID_LL                           = 3,
         DHCP6_DUID_UUID                         = 4,
 };
 
 enum DHCP6State {
         DHCP6_STATE_STOPPED                     = 0,
-        DHCP6_STATE_RS                          = 1,
         DHCP6_STATE_SOLICITATION                = 2,
         DHCP6_STATE_REQUEST                     = 3,
         DHCP6_STATE_BOUND                       = 4,
         DHCP6_STATE_RENEW                       = 5,
         DHCP6_STATE_REBIND                      = 6,
 };
 
diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c
index 4f60578..13bed67 100644
--- a/src/libsystemd-network/sd-dhcp6-client.c
+++ b/src/libsystemd-network/sd-dhcp6-client.c
@@ -289,15 +289,14 @@ static int client_send_message(sd_dhcp6_client *client) {
                 r = dhcp6_option_append_ia(&opt, &optlen, &client->lease->ia);
                 if (r < 0)
                         return r;
 
                 break;
 
         case DHCP6_STATE_STOPPED:
-        case DHCP6_STATE_RS:
         case DHCP6_STATE_BOUND:
                 return -EINVAL;
         }
 
         r = dhcp6_option_append(&opt, &optlen, DHCP6_OPTION_ORO,
                                 client->req_opts_len * sizeof(be16_t),
                                 client->req_opts);
@@ -442,15 +441,14 @@ static int client_timeout_resend(sd_event_source *s, uint64_t usec,
                         }
                         max_retransmit_duration = expire * USEC_PER_SEC;
                 }
 
                 break;
 
         case DHCP6_STATE_STOPPED:
-        case DHCP6_STATE_RS:
         case DHCP6_STATE_BOUND:
                 return 0;
         }
 
         if (max_retransmit_count &&
             client->retransmit_count >= max_retransmit_count) {
                 client_stop(client, DHCP6_EVENT_RETRANS_MAX);
@@ -839,15 +837,14 @@ static int client_receive_message(sd_event_source *s, int fd, uint32_t revents,
                 break;
 
         case DHCP6_STATE_BOUND:
 
                 break;
 
         case DHCP6_STATE_STOPPED:
-        case DHCP6_STATE_RS:
                 return 0;
         }
 
         if (r >= 0) {
                 log_dhcp6_client(client, "Recv %s",
                                  dhcp6_message_type_to_string(message->type));
         }
@@ -870,15 +867,14 @@ static int client_start(sd_dhcp6_client *client, enum DHCP6State state)
                 sd_event_source_unref(client->timeout_resend_expire);
         client->timeout_resend = sd_event_source_unref(client->timeout_resend);
         client->retransmit_time = 0;
         client->retransmit_count = 0;
 
         switch (state) {
         case DHCP6_STATE_STOPPED:
-        case DHCP6_STATE_RS:
         case DHCP6_STATE_SOLICITATION:
 
                 r = client_ensure_iaid(client);
                 if (r < 0)
                         return r;
 
                 r = dhcp6_network_bind_udp_socket(client->index, NULL);
-- 
1.9.3




More information about the systemd-devel mailing list