Skip to content

Commit

Permalink
看未转发列表时, 按照C网段过滤已经转发的ip地址,
Browse files Browse the repository at this point in the history
    解决"ip已经转发, 但是仍然被列到为转发的清单里"的问题
    V1.3
  • Loading branch information
lshw committed Jul 8, 2022
1 parent 7b7f697 commit 0588110
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dnsmasq_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Sun Dec 26 15:29:33 2021 daemon.info dnsmasq[11997]:xxxx
strcpy(domain, cname);
}
if(strcmp(domain, domain0) == 0) continue; //与上次域名不同
uint32_t sip32 = (uint32_t) (sip[0] << 24) | (sip[1] << 16) | (sip[2] << 8) ; //忽略sip[3],因为目前目标地址改成了C网段
uint32_t sip32 = (uint32_t) (sip[0] << 24) | (sip[1] << 16) | (sip[2] << 8) | sip[3];
if(is_exists(sip32, domain)) continue;
strncpy(domain0, domain, sizeof(domain));
snprintf(sipstr, sizeof(sipstr), "%d.%d.%d.%d", sip[0], sip[1] ,sip[2], sip[3]);
Expand All @@ -197,7 +197,7 @@ Sun Dec 26 15:29:33 2021 daemon.info dnsmasq[11997]:xxxx
ipname = hostnames[l].name;
break;
}
dip32 = (uint32_t) (dip[0] << 24) | (dip[1] << 16) | (dip[2] << 8) | dip[3];
dip32 = (uint32_t) (dip[0] << 24) | (dip[1] << 16) | (dip[2] << 8) ; //目标地址改成C网段
is_route = false;
for(uint16_t i = 0; i< 2048; i ++) { //检查是否在 已经转路由的ip列表里面,有的话, 就不显示
if(ips[i] == 0) break; //ips结束
Expand Down
4 changes: 2 additions & 2 deletions openwrt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=dnsmasq_route
PKG_VERSION:=0.20220621
PKG_RELEASE:=V1.2
PKG_VERSION:=0.20220702
PKG_RELEASE:=V1.3

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/lshw/dnsmasq_route.git
Expand Down

0 comments on commit 0588110

Please sign in to comment.