diff options
| author | Michael Biebl <biebl@debian.org> | 2020-03-13 00:44:14 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2020-03-13 00:44:14 +0100 |
| commit | b012fa6e1d808e0736c009799c62d835cbfcc1dd (patch) | |
| tree | ff9a3777f6740e91b55f0a566914bfe4ab37935f /shared | |
| parent | e536d40eaea5dcdc0743b0a5e8e17faa46608a50 (diff) | |
New upstream version 1.22.10 upstream/1.22.10
Diffstat (limited to 'shared')
| -rw-r--r-- | shared/n-dhcp4/src/n-dhcp4-c-connection.c | 25 | ||||
| -rw-r--r-- | shared/n-dhcp4/src/n-dhcp4-private.h | 5 | ||||
| -rw-r--r-- | shared/nm-version-macros.h | 2 |
3 files changed, 17 insertions, 15 deletions
diff --git a/shared/n-dhcp4/src/n-dhcp4-c-connection.c b/shared/n-dhcp4/src/n-dhcp4-c-connection.c index d4354467..a5c8ea66 100644 --- a/shared/n-dhcp4/src/n-dhcp4-c-connection.c +++ b/shared/n-dhcp4/src/n-dhcp4-c-connection.c @@ -1006,6 +1006,7 @@ static int n_dhcp4_c_connection_send_request(NDhcp4CConnection *connection, uint64_t timestamp) { char server_addr[INET_ADDRSTRLEN]; char client_addr[INET_ADDRSTRLEN]; + char error_msg[128]; int r; bool broadcast = false; @@ -1045,45 +1046,45 @@ static int n_dhcp4_c_connection_send_request(NDhcp4CConnection *connection, case N_DHCP4_C_MESSAGE_REBIND: broadcast = true; r = n_dhcp4_c_connection_packet_broadcast(connection, request); - if (r) - return r; break; case N_DHCP4_C_MESSAGE_INFORM: broadcast = true; r = n_dhcp4_c_connection_udp_broadcast(connection, request); - if (r) - return r; - break; case N_DHCP4_C_MESSAGE_RENEW: case N_DHCP4_C_MESSAGE_RELEASE: r = n_dhcp4_c_connection_udp_send(connection, request); - if (r) - return r; - break; default: c_assert(0); } + if (r) { + snprintf(error_msg, sizeof(error_msg), ": error %d", r); + } else { + error_msg[0] = '\0'; + } + if (request->userdata.client_addr == INADDR_ANY) { n_dhcp4_c_log(connection->client_config, LOG_INFO, - "sent %s to %s", + "send %s to %s%s", message_type_to_str(request->userdata.message_type), broadcast ? "255.255.255.255" : inet_ntop(AF_INET, &connection->server_ip, - server_addr, sizeof(server_addr))); + server_addr, sizeof(server_addr)), + error_msg); } else { n_dhcp4_c_log(connection->client_config, LOG_INFO, - "sent %s of %s to %s", + "send %s of %s to %s%s", message_type_to_str(request->userdata.message_type), inet_ntop(AF_INET, &request->userdata.client_addr, client_addr, sizeof(client_addr)), broadcast ? "255.255.255.255" : inet_ntop(AF_INET, &connection->server_ip, - server_addr, sizeof(server_addr))); + server_addr, sizeof(server_addr)), + error_msg); } ++request->userdata.n_send; diff --git a/shared/n-dhcp4/src/n-dhcp4-private.h b/shared/n-dhcp4/src/n-dhcp4-private.h index 436ee806..f647cb5e 100644 --- a/shared/n-dhcp4/src/n-dhcp4-private.h +++ b/shared/n-dhcp4/src/n-dhcp4-private.h @@ -702,10 +702,11 @@ static inline uint64_t n_dhcp4_gettime(clockid_t clock) { #define n_dhcp4_c_log(_config, _level, ...) \ do { \ const NDhcp4ClientConfig *__config = _config; \ + int __level = _level; \ \ - if (_level <= __config->log.level && __config->log.func) { \ + if (__level <= __config->log.level && __config->log.func) { \ if (1) { \ - _config->log.func(_level, \ + _config->log.func(__level, \ __config->log.data, \ __VA_ARGS__); \ } else { \ diff --git a/shared/nm-version-macros.h b/shared/nm-version-macros.h index 1d98c935..70ef84f9 100644 --- a/shared/nm-version-macros.h +++ b/shared/nm-version-macros.h @@ -30,7 +30,7 @@ * Evaluates to the micro version number of NetworkManager which this source * compiled against. */ -#define NM_MICRO_VERSION (8) +#define NM_MICRO_VERSION (10) /** * NM_CHECK_VERSION: |