Skip to contentSkip to conversation

Issuing a verdict for a packet more than once in userspace

DISCUSSION Maarten Wijnants 1 participant 1 message Jul 22, 2004 netfilter

lore
Share & tools
lore
#0 lore raw

Hi all,

I'll begin by explaining my goal/network architecture. The idea is that clients connect to a server through a proxy device. This proxy device checks the network streams that the server sends to the client, and only forwards a (small) part of this data to the client based on some set of "rules". These rules can be enforced by the client. I hope this is clear enough, if not, say so and I will elaborate :-)

To implement the proxy, I've used netfilter in combination with libipq. I use iptables to queue all packets on the FORWARD chain to a user space application (iptables -A FORWARD -j QUEUE). In this app, I then check the rules and set a verdict for the packets. This all works very well for unicast network traffic.

The problem however is that I also want the proxy to change multicast traffic into unicast traffic. Therefor I thought I would change the destination IP of MC packets (this is a multicast IP address) to the IP address of the interested client(s) in the userspace app. However, if more than one client is interested in the MC packet, I need to create and send 2 or more unicast packets. Some testing revealed that mangling a received packet and issuing a verdict for it more than once results in libipq errors (e.g. I receive a MC packet, change the destination address and issue NF_ACCEPT, I change the destination address again and again issue NF_ACCEPT). Is there something I am doing wrong, or is it just not possible what I am trying to do? And if it is not possible, is there any other way I can achieve my goal?

Many thanks in advance,
Maarten

--

Maarten Wijnants
Expertisecentrum voor Digitale Media
Limburgs Universitair Centrum
Wetenschapspark 2 - 3590 Diepenbeek
Tel: +32 (0)11 268419 - Mobile: +32 (0)497 341848
E-mail: [email protected]
URL: http://edm.luc.ac.be