This patch prevents connman from [ab]using the default gateway as a
fallback NTP server. The rationale for the previous behaviour was
apparently that if the DHCP server does not advertise an NTP server
option, then attempting to use the default gateway has at least a
non-zero chance of success. However as there's no requirement that a
router also must run a NTP service, there's also a non-zero chance of
failure, which would lead to junk packets being transmitted.

This reverts commit bbd1981. Since that time, the "FallbackTimeservers"
config option has been implemented, which is a much better way to deal
with the eventuality of not receiving any NTP server list via DHCP.

Closes CM-674.
---
 src/timeserver.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/src/timeserver.c b/src/timeserver.c
index f0d33e5..d719d08 100644
--- a/src/timeserver.c
+++ b/src/timeserver.c
@@ -179,13 +179,11 @@ GSList *__connman_timeserver_add_list(GSList *server_list,
 GSList *__connman_timeserver_get_all(struct connman_service *service)
 {
        GSList *list = NULL;
-       struct connman_network *network;
        char **timeservers;
        char **service_ts;
        char **service_ts_config;
-       const char *service_gw;
        char **fallback_ts;
-       int index, i;
+       int i;
 
        if (__connman_clock_timeupdates() == TIME_UPDATES_MANUAL)
                return NULL;
@@ -204,17 +202,6 @@ GSList *__connman_timeserver_get_all(struct 
connman_service *service)
        for (i = 0; service_ts && service_ts[i]; i++)
                list = __connman_timeserver_add_list(list, service_ts[i]);
 
-       network = __connman_service_get_network(service);
-       if (network) {
-               index = connman_network_get_index(network);
-               service_gw = __connman_ipconfig_get_gateway_from_index(index,
-                       CONNMAN_IPCONFIG_TYPE_ALL);
-
-               /* Then add Service Gateway to the list */
-               if (service_gw)
-                       list = __connman_timeserver_add_list(list, service_gw);
-       }
-
        /* Then add Global Timeservers to the list */
        timeservers = load_timeservers();
 
-- 
2.1.0

_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to