diff --git a/configure.ac b/configure.ac index 4830e22..2da490a 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,12 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.63]) -AC_INIT(iptables-ext-dns,1.0.3 , mimuret@gmail.com) +m4_define([VERSION_MAJOR],[1]) +m4_define([VERSION_MINOR],[1]) +m4_define([VERSION_MICRO],[0]) +AC_INIT(iptables-ext-dns,m4_defn([VERSION_MAJOR]).m4_defn([VERSION_MINOR]).m4_defn([VERSION_MICRO]), mimuret@gmail.com, iptables-ext-dns) +AC_SUBST(VERSION_INFO, [VERSION_MAJOR:VERSION_MINOR:VERSION_MICRO]) + AC_CONFIG_AUX_DIR(misc) AM_INIT_AUTOMAKE([foreign]) AC_CONFIG_SRCDIR([extensions/libxt_dns.c]) diff --git a/extensions/Makefile.am b/extensions/Makefile.am index 5a99d24..885d449 100644 --- a/extensions/Makefile.am +++ b/extensions/Makefile.am @@ -1,4 +1,4 @@ nobase_lib_LTLIBRARIES = xtables/libxt_dns.la xtables_libxt_dns_la_SOURCES = libxt_dns.c xtables_libxt_dns_la_CFLAGS = -lresolv -I../include -xtables_libxt_dns_la_LDFLAGS = -version-info 1:3:0 +xtables_libxt_dns_la_LDFLAGS = -version-info @VERSION_INFO@ diff --git a/iptables-ext-dns.spec b/iptables-ext-dns.spec.in similarity index 98% rename from iptables-ext-dns.spec rename to iptables-ext-dns.spec.in index 8abc2d9..bf63342 100644 --- a/iptables-ext-dns.spec +++ b/iptables-ext-dns.spec.in @@ -3,7 +3,7 @@ Summary: Administration tool for IPv4/IPv6 TCP/UDP packet filtering. Name: iptables-ext-dns -Version: 1.0.3 +Version: @PACKAGE_VERSION@ Release: 0%{?dist} License: GPLv3 Group: System Environment/Base diff --git a/modules/xt_dns.c b/modules/xt_dns.c index f3fec23..86ca5e4 100644 --- a/modules/xt_dns.c +++ b/modules/xt_dns.c @@ -184,8 +184,7 @@ static bool dns_mt_tcp(const struct sk_buff *skb, XT_PARAM *par, HOTDROP(par); return false; } - if (!(th->ack & th->psh) || - (ntohs(th->source) != DNS_PORT && ntohs(th->dest) != DNS_PORT)) { + if (!(th->ack & th->psh) || (th->dest != htons(DNS_PORT))) { DEBUG_PRINT("not dns packet"); return false; } @@ -206,7 +205,7 @@ static bool dns_mt_udp(const struct sk_buff *skb, XT_PARAM *par, HOTDROP(par); return false; } - if (ntohs(uh->source) != DNS_PORT && ntohs(uh->dest) != DNS_PORT) { + if (uh->dest != htons(DNS_PORT)) { DEBUG_PRINT("not dns packet"); return false; }