service: Minor address_updated Changes
cover service: Minor address_updated Changes
This makes some minor changes to 'address_updated':
1. Leverage 'connman_service_is_default'.
2. Add 'DBG' statement.
3. Add documentation.
Grant Erickson (3):
service: Leverage 'connman_service_is_default'.
service: Add DBG statement to 'address_updated'.
service: Add documentation to 'address_updated'.
src/service.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-)
Signature · 1 line
2.42.0
PATCH 1/3 service: Leverage 'connman_service_is_default'.
This leverages the recently-added 'connman_service_is_default' in 'address_updated' rather than duplicating the same logic from the former in the latter.
--- src/service.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
src/service.c +2 -1
@@ -164,6 +164,7 @@ static void complete_online_check(struct connman_service *service,enum connman_ipconfig_type type, bool success);static bool service_downgrade_online_state (struct connman_service *service); +static bool connman_service_is_default (const struct connman_service *service);struct find_data {const char *path;
@@ -2018,7 +2019,7 @@ static void address_updated(struct connman_service *service, enum connman_ipconfig_type type) {if (is_connected (service->state) && - service ==connman_service_get_default ()) { +connman_service_is_default (service)) {nameserver_remove_all (service, type);nameserver_add_all (service, type);start_online_check (service, type);
Signature · 1 line
2.42.0
PATCH 2/3 service: Add DBG statement to 'address_updated'.
In reply to Grant EricksonThis adds a DBG statement to 'address_upated' to aid in debugging.
--- src/service.c | 5 +++++ 1 file changed, 5 insertions(+)
src/service.c +5 -0
@@ -2018,6 +2018,11 @@ void __connman_service_wispr_start(struct connman_service *service,static void address_updated (struct connman_service *service,enum connman_ipconfig_type type) { +DBG ("service %p (%s) type %d (%s)" , + service, +connman_service_get_identifier (service), + type,__connman_ipconfig_type2string (type)); +if (is_connected (service->state) &&connman_service_is_default (service)) {nameserver_remove_all (service, type);
Signature · 1 line
2.42.0
PATCH 3/3 service: Add documentation to 'address_updated'.
In reply to Grant EricksonThis adds documentation to the 'address_updated' function.
--- src/service.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
src/service.c +27 -0
@@ -2015,6 +2015,33 @@ void __connman_service_wispr_start(struct connman_service *service,__connman_wispr_start (service, type, complete_online_check); } +/** +* @brief +* Handle an update to the address(es) for the specified network +* service and IP configuration type. +* +* This attempts to handle an address change or update for the +* specified network service and IP configuration type if and only if +* it is connected (that is, #is_connected returns true) and it is +* the default service (that is, has the default route). +* +* If the service meets those criteria, then nameservers are +* refreshed, an "online" HTTP-based Internet reachability check is +* initiated, and a time-of-day synchronization is requested. +* +* @param[in,out] service A pointer to the mutable network service +* for which there was an address change or +* update. +* @param[in] type The IP configuration type for @a service +* for which there was an address change or +* update. +* +* @sa nameserver_remove_all +* @sa nameserver_add_all +* @sa start_online_check +* @sa __connman_timeserver_sync +* +*/ static void address_updated (struct connman_service *service,enum connman_ipconfig_type type) {
Signature · 1 line
2.42.0
Hi Grant,
Quoted 6 lines
This makes some minor changes to '
address_updated':1. Leverage '
connman_service_is_default'.
2. Add 'DBG' statement.
3. Add documentation.
Quoted 7 lines
Grant Erickson (3):
service: Leverage 'connman_service_is_default'.
service: Add DBG statement to 'address_updated'.
service: Add documentation to 'address_updated'.
src/service.c| 35 ++++++++++++++++++++++++++++++++++-1 file changed, 34 insertions(+), 1 deletion(-)
sadly this doesnt apply cleanly anymore.
Regards
Marcel
Quoted 11 lines · Marcel Holtmann
Quoted 11 lines
This makes some minor changes to '
address_updated':1. Leverage '
connman_service_is_default'.
2. Add 'DBG' statement.
3. Add documentation.Grant Erickson (3):
service: Leverage 'connman_service_is_default'.
service: Add DBG statement to 'address_updated'.
service: Add documentation to 'address_updated'.
Quoted 4 lines
Quoted 2 lines
src/service.c| 35 ++++++++++++++++++++++++++++++++++-1 file changed, 34 insertions(+), 1 deletion(-)sadly this doesnt apply cleanly anymore.
Thanks; resubmitted as v2.
Best,
Grant
Signature · 5 lines
Principal Nuovations [email protected] http://www.nuovations.com/
v2 cover service: Minor address_updated Changes
In reply to Grant EricksonThis makes some minor changes to 'address_updated':
1. Leverage 'connman_service_is_default'.
2. Add 'DBG' statement.
3. Add documentation.
Grant Erickson (3):
service: Leverage 'connman_service_is_default'.
service: Add DBG statement to 'address_updated'.
service: Add documentation to 'address_updated'.
src/service.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-)
Signature · 1 line
2.42.0
PATCH v2 1/3 service: Leverage 'connman_service_is_default'.
This leverages the recently-added 'connman_service_is_default' in 'address_updated' rather than duplicating the same logic from the former in the latter.
--- src/service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/service.c +1 -1
@@ -2239,7 +2239,7 @@ static void address_updated(struct connman_service *service, enum connman_ipconfig_type type) {if (is_connected (service->state) && - service ==connman_service_get_default ()) { +connman_service_is_default (service)) {nameserver_remove_all (service, type);nameserver_add_all (service, type);start_online_check (service, type);
Signature · 1 line
2.42.0
PATCH v2 2/3 service: Add DBG statement to 'address_updated'.
In reply to Grant EricksonThis adds a DBG statement to 'address_upated' to aid in debugging.
--- src/service.c | 5 +++++ 1 file changed, 5 insertions(+)
src/service.c +5 -0
@@ -2238,6 +2238,11 @@ void __connman_service_wispr_start(struct connman_service *service,static void address_updated (struct connman_service *service,enum connman_ipconfig_type type) { +DBG ("service %p (%s) type %d (%s)" , + service, +connman_service_get_identifier (service), + type,__connman_ipconfig_type2string (type)); +if (is_connected (service->state) &&connman_service_is_default (service)) {nameserver_remove_all (service, type);
Signature · 1 line
2.42.0
PATCH v2 3/3 service: Add documentation to 'address_updated'.
In reply to Grant EricksonThis adds documentation to the 'address_updated' function.
--- src/service.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
src/service.c +27 -0
@@ -2235,6 +2235,33 @@ void __connman_service_wispr_start(struct connman_service *service, online_check_connect_timeout_ms, complete_online_check); } +/** +* @brief +* Handle an update to the address(es) for the specified network +* service and IP configuration type. +* +* This attempts to handle an address change or update for the +* specified network service and IP configuration type if and only if +* it is connected (that is, #is_connected returns true) and it is +* the default service (that is, has the default route). +* +* If the service meets those criteria, then nameservers are +* refreshed, an "online" HTTP-based Internet reachability check is +* initiated, and a time-of-day synchronization is requested. +* +* @param[in,out] service A pointer to the mutable network service +* for which there was an address change or +* update. +* @param[in] type The IP configuration type for @a service +* for which there was an address change or +* update. +* +* @sa nameserver_remove_all +* @sa nameserver_add_all +* @sa start_online_check +* @sa __connman_timeserver_sync +* +*/ static void address_updated (struct connman_service *service,enum connman_ipconfig_type type) {
Signature · 1 line
2.42.0
Hi Grant,
Quoted 6 lines
This makes some minor changes to '
address_updated':1. Leverage '
connman_service_is_default'.
2. Add 'DBG' statement.
3. Add documentation.
Quoted 7 lines
Grant Erickson (3):
service: Leverage 'connman_service_is_default'.
service: Add DBG statement to 'address_updated'.
service: Add documentation to 'address_updated'.
src/service.c| 34 +++++++++++++++++++++++++++++++++-1 file changed, 33 insertions(+), 1 deletion(-)
all 3 patches have been applied.
Regards
Marcel