X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flibsystemd-network%2Fsd-dhcp6-client.c;h=8fdbbfe3201e62d4da0b4f37fc8884feb4f39798;hb=5e91345094a9e983e7abb2313334e7808bcd2cc2;hp=2d5bedcb8bced12993244b225f83dffbe4d1e429;hpb=ed6ee21953dac9c78383da00bc4514ece6b75ab5;p=elogind.git diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c index 2d5bedcb8..8fdbbfe32 100644 --- a/src/libsystemd-network/sd-dhcp6-client.c +++ b/src/libsystemd-network/sd-dhcp6-client.c @@ -254,6 +254,8 @@ static int client_send_message(sd_dhcp6_client *client) { r = dhcp6_option_append(&opt, &optlen, DHCP6_OPTION_RAPID_COMMIT, 0, NULL); + if (r < 0) + return r; r = dhcp6_option_append_ia(&opt, &optlen, &client->ia_na); if (r < 0) @@ -386,7 +388,7 @@ static int client_timeout_resend(sd_event_source *s, uint64_t usec, int r = 0; sd_dhcp6_client *client = userdata; usec_t time_now, init_retransmit_time, max_retransmit_time; - usec_t max_retransmit_duration; + usec_t max_retransmit_duration = 0; uint8_t max_retransmit_count = 0; char time_string[FORMAT_TIMESPAN_MAX]; uint32_t expire = 0; @@ -407,8 +409,6 @@ static int client_timeout_resend(sd_event_source *s, uint64_t usec, init_retransmit_time = DHCP6_SOL_TIMEOUT; max_retransmit_time = DHCP6_SOL_MAX_RT; - max_retransmit_count = 0; - max_retransmit_duration = 0; break; @@ -416,28 +416,22 @@ static int client_timeout_resend(sd_event_source *s, uint64_t usec, init_retransmit_time = DHCP6_REQ_TIMEOUT; max_retransmit_time = DHCP6_REQ_MAX_RT; max_retransmit_count = DHCP6_REQ_MAX_RC; - max_retransmit_duration = 0; break; case DHCP6_STATE_RENEW: init_retransmit_time = DHCP6_REN_TIMEOUT; max_retransmit_time = DHCP6_REN_MAX_RT; - max_retransmit_count = 0; /* RFC 3315, section 18.1.3. says max retransmit duration will be the remaining time until T2. Instead of setting MRD, wait for T2 to trigger with the same end result */ - max_retransmit_duration = 0; break; case DHCP6_STATE_REBIND: init_retransmit_time = DHCP6_REB_TIMEOUT; max_retransmit_time = DHCP6_REB_MAX_RT; - max_retransmit_count = 0; - - max_retransmit_duration = 0; if (!client->timeout_resend_expire) { r = dhcp6_lease_ia_rebind_expire(&client->lease->ia, @@ -532,6 +526,9 @@ error: } static int client_ensure_iaid(sd_dhcp6_client *client) { + /* name is a pointer to memory in the udev_device struct, so must + have the same scope */ + _cleanup_udev_device_unref_ struct udev_device *device = NULL; const char *name = NULL; uint64_t id; @@ -543,7 +540,6 @@ static int client_ensure_iaid(sd_dhcp6_client *client) { if (detect_container(NULL) <= 0) { /* not in a container, udev will be around */ _cleanup_udev_unref_ struct udev *udev; - _cleanup_udev_device_unref_ struct udev_device *device = NULL; char ifindex_str[2 + DECIMAL_STR_MAX(int)]; udev = udev_new();