Skip to content

Commit

Permalink
看未转发列表时, 按照C网段过滤已经转发的ip地址,
Browse files Browse the repository at this point in the history
解决"ip已经转发, 但是仍然被列到为转发的清单里"的问题
V1.2
  • Loading branch information
lshw committed Jun 20, 2022
1 parent 5a801e0 commit 7b7f697
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions dnsmasq_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ void load_ips() {
if(fp) {
while(!feof(fp)) {
/*
29010: from all to 120.121.121.140 lookup 107
29010: from all to 120.121.121.141 lookup 107
29010: from all to 120.121.121.0 lookup 107
*/
rc = fscanf(fp,"%10s %10s %10s %10s %hhd.%hhd.%hhd.%hhd", skip, skip, skip, skip, &ip[0],&ip[1],&ip[2],&ip[3]);
fgets(skip, sizeof(skip), fp);
Expand Down Expand Up @@ -187,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];
uint32_t sip32 = (uint32_t) (sip[0] << 24) | (sip[1] << 16) | (sip[2] << 8) ; //忽略sip[3],因为目前目标地址改成了C网段
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 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.20220323
PKG_RELEASE:=V1.1
PKG_VERSION:=0.20220621
PKG_RELEASE:=V1.2

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

0 comments on commit 7b7f697

Please sign in to comment.