Skip to content

Commit

Permalink
fix mask > 0xFFFF with chnroute
Browse files Browse the repository at this point in the history
  • Loading branch information
clowwindy committed Aug 10, 2014
1 parent 139fdcc commit 94f7809
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
1.1.2 2014-08-11
- Fix mask > 0xFFFF with chnroute

1.1.1 2014-08-08
- Use CIDR format in chnroute.txt

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.67])
AC_INIT([ChinaDNS-C], [1.1.1], [[email protected]])
AC_INIT([ChinaDNS-C], [1.1.2], [[email protected]])
AC_CONFIG_SRCDIR([src/chinadns.c])
AC_CONFIG_HEADERS([config.h])

Expand Down
2 changes: 1 addition & 1 deletion openwrt/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=ChinaDNS-C
PKG_VERSION:=1.1.1
PKG_VERSION:=1.1.2
PKG_RELEASE=$(PKG_SOURCE_VERSION)

PKG_SOURCE_URL:=https://github.com/clowwindy/ChinaDNS-C/releases/download/$(PKG_VERSION)
Expand Down
4 changes: 3 additions & 1 deletion src/chinadns.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,10 @@ static int test_ip_in_list(struct in_addr ip, const net_list_t *netlist) {
DLOG("%s, %d\n", inet_ntoa(netlist->nets[m].net),
netlist->nets[m].mask);
}
DLOG("result: %x\n", (ntohl(netlist->nets[l].net.s_addr) ^ ntohl(ip.s_addr)));
DLOG("mask: %x\n", (UINT32_MAX - netlist->nets[l].mask));
if ((ntohl(netlist->nets[l].net.s_addr) ^ ntohl(ip.s_addr)) &
(0xFFFF - netlist->nets[l].mask)) {
(UINT32_MAX - netlist->nets[l].mask)) {
return 0;
}
return 1;
Expand Down

0 comments on commit 94f7809

Please sign in to comment.