aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
Diffstat (limited to 'networking')
-rw-r--r--networking/ifupdown.c16
-rw-r--r--networking/ntpd.c11
-rw-r--r--networking/udhcp/d6_dhcpc.c8
-rw-r--r--networking/udhcp/dhcpc.c8
4 files changed, 30 insertions, 13 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index 5481134e5..80fce87a6 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -1022,6 +1022,22 @@ static struct interfaces_file_t *read_interfaces(const char *filename, struct in
1022 currently_processing = NONE; 1022 currently_processing = NONE;
1023 } else if (strcmp(first_word, "source") == 0) { 1023 } else if (strcmp(first_word, "source") == 0) {
1024 read_interfaces(next_word(&rest_of_line), defn); 1024 read_interfaces(next_word(&rest_of_line), defn);
1025 } else if (is_prefixed_with(first_word, "source-dir")) {
1026 const char *dirpath;
1027 DIR *dir;
1028 struct dirent *entry;
1029
1030 dirpath = next_word(&rest_of_line);
1031 dir = xopendir(dirpath);
1032 while ((entry = readdir(dir)) != NULL) {
1033 char *path;
1034 if (entry->d_name[0] == '.')
1035 continue;
1036 path = concat_path_file(dirpath, entry->d_name);
1037 read_interfaces(path, defn);
1038 free(path);
1039 }
1040 closedir(dir);
1025 } else { 1041 } else {
1026 switch (currently_processing) { 1042 switch (currently_processing) {
1027 case IFACE: 1043 case IFACE:
diff --git a/networking/ntpd.c b/networking/ntpd.c
index 991c518f6..1ebdc34c3 100644
--- a/networking/ntpd.c
+++ b/networking/ntpd.c
@@ -1116,20 +1116,25 @@ fit(peer_t *p, double rd)
1116{ 1116{
1117 if ((p->reachable_bits & (p->reachable_bits-1)) == 0) { 1117 if ((p->reachable_bits & (p->reachable_bits-1)) == 0) {
1118 /* One or zero bits in reachable_bits */ 1118 /* One or zero bits in reachable_bits */
1119 VERB4 bb_error_msg("peer %s unfit for selection: unreachable", p->p_dotted); 1119 VERB4 bb_error_msg("peer %s unfit for selection: "
1120 "unreachable", p->p_dotted);
1120 return 0; 1121 return 0;
1121 } 1122 }
1122#if 0 /* we filter out such packets earlier */ 1123#if 0 /* we filter out such packets earlier */
1123 if ((p->lastpkt_status & LI_ALARM) == LI_ALARM 1124 if ((p->lastpkt_status & LI_ALARM) == LI_ALARM
1124 || p->lastpkt_stratum >= MAXSTRAT 1125 || p->lastpkt_stratum >= MAXSTRAT
1125 ) { 1126 ) {
1126 VERB4 bb_error_msg("peer %s unfit for selection: bad status/stratum", p->p_dotted); 1127 VERB4 bb_error_msg("peer %s unfit for selection: "
1128 "bad status/stratum", p->p_dotted);
1127 return 0; 1129 return 0;
1128 } 1130 }
1129#endif 1131#endif
1130 /* rd is root_distance(p) */ 1132 /* rd is root_distance(p) */
1131 if (rd > MAXDIST + FREQ_TOLERANCE * (1 << G.poll_exp)) { 1133 if (rd > MAXDIST + FREQ_TOLERANCE * (1 << G.poll_exp)) {
1132 VERB4 bb_error_msg("peer %s unfit for selection: root distance too high", p->p_dotted); 1134 VERB3 bb_error_msg("peer %s unfit for selection: "
1135 "root distance %f too high, jitter:%f",
1136 p->p_dotted, rd, p->filter_jitter
1137 );
1133 return 0; 1138 return 0;
1134 } 1139 }
1135//TODO 1140//TODO
diff --git a/networking/udhcp/d6_dhcpc.c b/networking/udhcp/d6_dhcpc.c
index ed2255ef3..66e4b6c6a 100644
--- a/networking/udhcp/d6_dhcpc.c
+++ b/networking/udhcp/d6_dhcpc.c
@@ -1405,7 +1405,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
1405 case RENEW_REQUESTED: /* manual (SIGUSR1) renew */ 1405 case RENEW_REQUESTED: /* manual (SIGUSR1) renew */
1406 case_RENEW_REQUESTED: 1406 case_RENEW_REQUESTED:
1407 case RENEWING: 1407 case RENEWING:
1408 if (timeout > 60) { 1408 if (timeout >= 60) {
1409 /* send an unicast renew request */ 1409 /* send an unicast renew request */
1410 /* Sometimes observed to fail (EADDRNOTAVAIL) to bind 1410 /* Sometimes observed to fail (EADDRNOTAVAIL) to bind
1411 * a new UDP socket for sending inside send_renew. 1411 * a new UDP socket for sending inside send_renew.
@@ -1465,11 +1465,9 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
1465 * For the second case, must make sure timeout 1465 * For the second case, must make sure timeout
1466 * is not too big, or else we can send 1466 * is not too big, or else we can send
1467 * futile renew requests for hours. 1467 * futile renew requests for hours.
1468 * (Ab)use -A TIMEOUT value (usually 20 sec)
1469 * as a cap on the timeout.
1470 */ 1468 */
1471 if (timeout > tryagain_timeout) 1469 if (timeout > 60)
1472 timeout = tryagain_timeout; 1470 timeout = 60;
1473 goto case_RENEW_REQUESTED; 1471 goto case_RENEW_REQUESTED;
1474 } 1472 }
1475 /* Start things over */ 1473 /* Start things over */
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index 0310663e0..ab3e5a463 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -1519,7 +1519,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1519 case RENEW_REQUESTED: /* manual (SIGUSR1) renew */ 1519 case RENEW_REQUESTED: /* manual (SIGUSR1) renew */
1520 case_RENEW_REQUESTED: 1520 case_RENEW_REQUESTED:
1521 case RENEWING: 1521 case RENEWING:
1522 if (timeout > 60) { 1522 if (timeout >= 60) {
1523 /* send an unicast renew request */ 1523 /* send an unicast renew request */
1524 /* Sometimes observed to fail (EADDRNOTAVAIL) to bind 1524 /* Sometimes observed to fail (EADDRNOTAVAIL) to bind
1525 * a new UDP socket for sending inside send_renew. 1525 * a new UDP socket for sending inside send_renew.
@@ -1592,11 +1592,9 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1592 * For the second case, must make sure timeout 1592 * For the second case, must make sure timeout
1593 * is not too big, or else we can send 1593 * is not too big, or else we can send
1594 * futile renew requests for hours. 1594 * futile renew requests for hours.
1595 * (Ab)use -A TIMEOUT value (usually 20 sec)
1596 * as a cap on the timeout.
1597 */ 1595 */
1598 if (timeout > tryagain_timeout) 1596 if (timeout > 60)
1599 timeout = tryagain_timeout; 1597 timeout = 60;
1600 goto case_RENEW_REQUESTED; 1598 goto case_RENEW_REQUESTED;
1601 } 1599 }
1602 /* Start things over */ 1600 /* Start things over */