aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJP Abgrall <jpa@google.com>2013-02-06 17:40:07 -0800
committerRicardo Cerqueira <cyanogenmod@cerqueira.org>2013-09-10 18:55:53 +0100
commit99a8b0a7c48c3b126380c60876cfea5cc11fe033 (patch)
tree1d6dfe6166ab83e8b11bc2684740f241213f7054 /net
parentc9bfa9a5655c86f9682253df3c0cc9f1a6749cc2 (diff)
downloadkernel_samsung_smdk4412-99a8b0a7c48c3b126380c60876cfea5cc11fe033.zip
kernel_samsung_smdk4412-99a8b0a7c48c3b126380c60876cfea5cc11fe033.tar.gz
kernel_samsung_smdk4412-99a8b0a7c48c3b126380c60876cfea5cc11fe033.tar.bz2
netfilter: xt_qtaguid: Allow tracking loopback
In the past it would always ignore interfaces with loopback addresses. Now we just treat them like any other. This also helps with writing tests that check for the presence of the qtaguid module. Signed-off-by: JP Abgrall <jpa@google.com>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/xt_qtaguid.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/net/netfilter/xt_qtaguid.c b/net/netfilter/xt_qtaguid.c
index 8032b77..202ddc1 100644
--- a/net/netfilter/xt_qtaguid.c
+++ b/net/netfilter/xt_qtaguid.c
@@ -1108,18 +1108,13 @@ static void iface_stat_create(struct net_device *net_dev,
spin_lock_bh(&iface_stat_list_lock);
entry = get_iface_entry(ifname);
if (entry != NULL) {
- bool activate = !ipv4_is_loopback(ipaddr);
IF_DEBUG("qtaguid: iface_stat: create(%s): entry=%p\n",
ifname, entry);
iface_check_stats_reset_and_adjust(net_dev, entry);
- _iface_stat_set_active(entry, net_dev, activate);
+ _iface_stat_set_active(entry, net_dev, true);
IF_DEBUG("qtaguid: %s(%s): "
"tracking now %d on ip=%pI4\n", __func__,
- entry->ifname, activate, &ipaddr);
- goto done_unlock_put;
- } else if (ipv4_is_loopback(ipaddr)) {
- IF_DEBUG("qtaguid: iface_stat: create(%s): "
- "ignore loopback dev. ip=%pI4\n", ifname, &ipaddr);
+ entry->ifname, true, &ipaddr);
goto done_unlock_put;
}
@@ -1170,19 +1165,13 @@ static void iface_stat_create_ipv6(struct net_device *net_dev,
spin_lock_bh(&iface_stat_list_lock);
entry = get_iface_entry(ifname);
if (entry != NULL) {
- bool activate = !(addr_type & IPV6_ADDR_LOOPBACK);
IF_DEBUG("qtaguid: %s(%s): entry=%p\n", __func__,
ifname, entry);
iface_check_stats_reset_and_adjust(net_dev, entry);
- _iface_stat_set_active(entry, net_dev, activate);
+ _iface_stat_set_active(entry, net_dev, true);
IF_DEBUG("qtaguid: %s(%s): "
"tracking now %d on ip=%pI6c\n", __func__,
- entry->ifname, activate, &ifa->addr);
- goto done_unlock_put;
- } else if (addr_type & IPV6_ADDR_LOOPBACK) {
- IF_DEBUG("qtaguid: %s(%s): "
- "ignore loopback dev. ip=%pI6c\n", __func__,
- ifname, &ifa->addr);
+ entry->ifname, true, &ifa->addr);
goto done_unlock_put;
}