From 503cdc60064fd115c9a65837efe40bc7d2d47708 Mon Sep 17 00:00:00 2001 From: yuqing Date: Fri, 24 Oct 2014 18:20:00 +0800 Subject: [PATCH] get local ipaddr support interface based 1 --- HISTORY | 3 ++- src/fast_timer.c | 3 ++- src/sockopt.c | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/HISTORY b/HISTORY index 6c6af86..a84259c 100644 --- a/HISTORY +++ b/HISTORY @@ -1,5 +1,6 @@ -Version 1.09 2014-10-23 +Version 1.09 2014-10-24 * Version struct add variable: patch + * get local ipaddr support interface based 1 Version 1.08 2014-10-09 * sched_thread.c: calculate next_call_time correctly diff --git a/src/fast_timer.c b/src/fast_timer.c index 8462786..19b0882 100644 --- a/src/fast_timer.c +++ b/src/fast_timer.c @@ -146,12 +146,13 @@ int fast_timer_timeouts_get(FastTimer *timer, const int64_t current_time, continue; } } - else { + else { //expired count++; if (first == NULL) { first = entry; } } + last = entry; entry = entry->next; } diff --git a/src/sockopt.c b/src/sockopt.c index 40d870c..0e0cf77 100644 --- a/src/sockopt.c +++ b/src/sockopt.c @@ -1736,6 +1736,10 @@ int gethostaddrs(char **if_alias_prefixes, const int prefix_count, \ ret = ioctl(sock, SIOCGIFADDR, &req); if (ret == -1) { + if (*count == 0 && k == 0) //maybe based 1 + { + continue; + } break; }