mirror of https://github.com/hak5/openwrt-owl.git
parent
f12c42940d
commit
6b533fd4bc
|
@ -12,9 +12,9 @@ PKG_RELEASE:=1
|
|||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=http://git.zx2c4.com/ipset-dns
|
||||
PKG_SOURCE_DATE:=2013-05-03
|
||||
PKG_SOURCE_VERSION:=6be3afd819a86136b51c5ae722ab48266187155b
|
||||
PKG_MIRROR_HASH:=4e34943b547babe705c2fad295ee24a5ee0c93ca03e2a9cdeaf323150f97e60b
|
||||
PKG_SOURCE_DATE:=2017-10-08
|
||||
PKG_SOURCE_VERSION:=ade2cf88e933f4f90451e0a6171f0aa4a523f989
|
||||
PKG_MIRROR_HASH:=34ad1f5c7d2eab90b795f2a512102891428216e3d439d918a8992846550e9697
|
||||
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
|
|
@ -1,57 +0,0 @@
|
|||
--- a/ipset-dns.c
|
||||
+++ b/ipset-dns.c
|
||||
@@ -307,19 +307,20 @@ int main(int argc, char *argv[])
|
||||
struct timeval tv;
|
||||
char msg[512];
|
||||
char ip[INET6_ADDRSTRLEN];
|
||||
- char *ipset;
|
||||
+ char *ipset, *ipset6;
|
||||
int listen_sock, upstream_sock;
|
||||
int pos, i, size, af;
|
||||
socklen_t len;
|
||||
size_t received;
|
||||
pid_t child;
|
||||
|
||||
- if (argc != 4) {
|
||||
- fprintf(stderr, "Usage: %s ipset port upstream\n", argv[0]);
|
||||
+ if (argc != 5) {
|
||||
+ fprintf(stderr, "Usage: %s ipv4-ipset ipv6-ipset port upstream\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
ipset = argv[1];
|
||||
+ ipset6 = argv[2];
|
||||
|
||||
listen_sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||
if (listen_sock < 0) {
|
||||
@@ -329,7 +330,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
memset(&listen_addr, 0, sizeof(listen_addr));
|
||||
listen_addr.sin_family = AF_INET;
|
||||
- listen_addr.sin_port = htons(atoi(argv[2]));
|
||||
+ listen_addr.sin_port = htons(atoi(argv[3]));
|
||||
listen_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
|
||||
i = 1;
|
||||
setsockopt(listen_sock, SOL_SOCKET, SO_REUSEADDR, &i, sizeof(i));
|
||||
@@ -341,7 +342,7 @@ int main(int argc, char *argv[])
|
||||
memset(&upstream_addr, 0, sizeof(upstream_addr));
|
||||
upstream_addr.sin_family = AF_INET;
|
||||
upstream_addr.sin_port = htons(53);
|
||||
- inet_aton(argv[3], &upstream_addr.sin_addr);
|
||||
+ inet_aton(argv[4], &upstream_addr.sin_addr);
|
||||
|
||||
/* TODO: Put all of the below code in several forks all listening on the same sock. */
|
||||
|
||||
@@ -434,8 +435,11 @@ int main(int argc, char *argv[])
|
||||
continue;
|
||||
}
|
||||
|
||||
+ if ((af == AF_INET && !*ipset) || (af == AF_INET6 && !*ipset6))
|
||||
+ continue;
|
||||
+
|
||||
printf("%s: %s\n", answer.dotted, ip);
|
||||
- if (add_to_ipset(ipset, answer.rdata, af) < 0)
|
||||
+ if (add_to_ipset((af == AF_INET) ? ipset : ipset6, answer.rdata, af) < 0)
|
||||
perror("add_to_ipset");
|
||||
}
|
||||
|
Loading…
Reference in New Issue