[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4BE9428A.5090402@trash.net>
Date: Tue, 11 May 2010 13:42:02 +0200
From: Patrick McHardy <kaber@...sh.net>
To: Eric Dumazet <eric.dumazet@...il.com>
CC: davem@...emloft.net, netfilter-devel@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH 72/84] netfilter: xtables: inclusion of xt_TEE
Eric Dumazet wrote:
> Le lundi 10 mai 2010 à 22:18 +0200, kaber@...sh.net a écrit :
>> From: Jan Engelhardt <jengelh@...ozas.de>
>>
>> xt_TEE can be used to clone and reroute a packet. This can for
>> example be used to copy traffic at a router for logging purposes
>> to another dedicated machine.
>>
>> References: http://www.gossamer-threads.com/lists/iptables/devel/68781
>> Signed-off-by: Jan Engelhardt <jengelh@...ozas.de>
>> Signed-off-by: Patrick McHardy <kaber@...sh.net>
>> ---
>
>> +static bool tee_tg_route_oif(struct flowi *f, struct net *net,
>> + const struct xt_tee_tginfo *info)
>> +{
>> + const struct net_device *dev;
>> +
>> + if (*info->oif != '\0')
>> + return true;
>> + dev = dev_get_by_name(net, info->oif);
>> + if (dev == NULL)
>> + return false;
>> + f->oif = dev->ifindex;
>> + return true;
>> +}
>> +
>
> This leaks a refcount on device.
>
> But I see patch 76/84 replaces the whole thing, so this is probably
> harmless.
Correct, that patch replaces the per-packet lookup and uses
netdevice notifiers to store the ifindex of the output device,
without keeping a reference at all.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists