* [PATCH] remove superfluous diverter printk'ing
@ 2005-01-14 12:47 Lennert Buytenhek
2005-01-14 21:46 ` David S. Miller
0 siblings, 1 reply; 6+ messages in thread
From: Lennert Buytenhek @ 2005-01-14 12:47 UTC (permalink / raw)
To: benwa; +Cc: netdev
Hi Benoit,
You're not listed as diverter maintainer but I'm sending this via
you anyway. This patch removes some printk'ing from the diverter
driver (and cleans up the code a bit), because after a while it gets
really annoying to have log messages like this one for every single
tunnel you create or tear down.
divert: not allocating divert_blk for non-ethernet device tunl0
Please consider sending upstream.
cheers,
Lennert
--- linux-2.6.10/net/core/dv.c.orig 2005-01-14 13:36:44.507808269 +0100
+++ linux-2.6.10/net/core/dv.c 2005-01-14 13:38:18.808399830 +0100
@@ -52,26 +52,20 @@
{
int alloc_size = (sizeof(struct divert_blk) + 3) & ~3;
+ dev->divert = NULL;
if (dev->type == ARPHRD_ETHER) {
- printk(KERN_DEBUG "divert: allocating divert_blk for %s\n",
- dev->name);
-
dev->divert = (struct divert_blk *)
kmalloc(alloc_size, GFP_KERNEL);
if (dev->divert == NULL) {
- printk(KERN_DEBUG "divert: unable to allocate divert_blk for %s\n",
+ printk(KERN_INFO "divert: unable to allocate divert_blk for %s\n",
dev->name);
return -ENOMEM;
- } else {
- memset(dev->divert, 0, sizeof(struct divert_blk));
}
- dev_hold(dev);
- } else {
- printk(KERN_DEBUG "divert: not allocating divert_blk for non-ethernet device %s\n",
- dev->name);
- dev->divert = NULL;
+ memset(dev->divert, 0, sizeof(struct divert_blk));
+ dev_hold(dev);
}
+
return 0;
}
@@ -85,11 +79,6 @@
kfree(dev->divert);
dev->divert=NULL;
dev_put(dev);
- printk(KERN_DEBUG "divert: freeing divert_blk for %s\n",
- dev->name);
- } else {
- printk(KERN_DEBUG "divert: no divert_blk to free, %s not ethernet\n",
- dev->name);
}
}
@@ -192,8 +181,12 @@
/*
* control function of the diverter
*/
+#if 0
#define DVDBG(a) \
printk(KERN_DEBUG "divert_ioctl() line %d %s\n", __LINE__, (a))
+#else
+#define DVDBG(a)
+#endif
int divert_ioctl(unsigned int cmd, struct divert_cf __user *arg)
{
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] remove superfluous diverter printk'ing
2005-01-14 12:47 [PATCH] remove superfluous diverter printk'ing Lennert Buytenhek
@ 2005-01-14 21:46 ` David S. Miller
2005-01-15 10:47 ` Lennert Buytenhek
0 siblings, 1 reply; 6+ messages in thread
From: David S. Miller @ 2005-01-14 21:46 UTC (permalink / raw)
To: Lennert Buytenhek; +Cc: benwa, netdev
On Fri, 14 Jan 2005 13:47:00 +0100
Lennert Buytenhek <buytenh@wantstofly.org> wrote:
> You're not listed as diverter maintainer but I'm sending this via
> you anyway. This patch removes some printk'ing from the diverter
> driver (and cleans up the code a bit), because after a while it gets
> really annoying to have log messages like this one for every single
> tunnel you create or tear down.
>
> divert: not allocating divert_blk for non-ethernet device tunl0
>
> Please consider sending upstream.
Those diverter messages drive me crazy too, I think I'll
add your patch Lennert.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] remove superfluous diverter printk'ing
2005-01-14 21:46 ` David S. Miller
@ 2005-01-15 10:47 ` Lennert Buytenhek
2005-01-16 17:10 ` jamal
0 siblings, 1 reply; 6+ messages in thread
From: Lennert Buytenhek @ 2005-01-15 10:47 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
On Fri, Jan 14, 2005 at 01:46:42PM -0800, David S. Miller wrote:
> > You're not listed as diverter maintainer but I'm sending this via
> > you anyway. This patch removes some printk'ing from the diverter
> > driver (and cleans up the code a bit), because after a while it gets
> > really annoying to have log messages like this one for every single
> > tunnel you create or tear down.
> >
> > divert: not allocating divert_blk for non-ethernet device tunl0
> >
> > Please consider sending upstream.
>
> Those diverter messages drive me crazy too, I think I'll
> add your patch Lennert.
Benoit's email address bounces, and it's the latest address of his I
could find, so if he doesn't read this list you might as well go ahead.
cheers,
Lennert
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] remove superfluous diverter printk'ing
2005-01-15 10:47 ` Lennert Buytenhek
@ 2005-01-16 17:10 ` jamal
2005-01-16 17:22 ` Lennert Buytenhek
0 siblings, 1 reply; 6+ messages in thread
From: jamal @ 2005-01-16 17:10 UTC (permalink / raw)
To: Lennert Buytenhek; +Cc: David S. Miller, netdev
Diverter could simply be killed now that tc actions exist if theres no
maintainer or user.
Should be able to divert any packet of choce to any interface.
cheers,
jamal
On Sat, 2005-01-15 at 05:47, Lennert Buytenhek wrote:
> On Fri, Jan 14, 2005 at 01:46:42PM -0800, David S. Miller wrote:
>
> > > You're not listed as diverter maintainer but I'm sending this via
> > > you anyway. This patch removes some printk'ing from the diverter
> > > driver (and cleans up the code a bit), because after a while it gets
> > > really annoying to have log messages like this one for every single
> > > tunnel you create or tear down.
> > >
> > > divert: not allocating divert_blk for non-ethernet device tunl0
> > >
> > > Please consider sending upstream.
> >
> > Those diverter messages drive me crazy too, I think I'll
> > add your patch Lennert.
>
> Benoit's email address bounces, and it's the latest address of his I
> could find, so if he doesn't read this list you might as well go ahead.
>
>
> cheers,
> Lennert
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] remove superfluous diverter printk'ing
2005-01-16 17:10 ` jamal
@ 2005-01-16 17:22 ` Lennert Buytenhek
2005-01-16 17:33 ` jamal
0 siblings, 1 reply; 6+ messages in thread
From: Lennert Buytenhek @ 2005-01-16 17:22 UTC (permalink / raw)
To: jamal; +Cc: David S. Miller, netdev, bdschuym
On Sun, Jan 16, 2005 at 12:10:21PM -0500, jamal wrote:
> Diverter could simply be killed now that tc actions exist if theres no
> maintainer or user.
> Should be able to divert any packet of choce to any interface.
The diverter is not used for redirecting a packet to another interface.
What it does (IIRC) is overwrite the destination MAC address on selected
packets so that the local host will process them. You can do the same
thing with iptables' "-j REDIRECT" but the diverter was made for use on
ethernet bridges (REDIRECTing bridged packets) when the bridge-nf stuff
didn't exist yet.
Nowadays we have bridge-nf and you should be able to do the same thing
by just using '-j REDIRECT' as you would do with routing (Bart, please
correct me if I'm wrong there.)
--L
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] remove superfluous diverter printk'ing
2005-01-16 17:22 ` Lennert Buytenhek
@ 2005-01-16 17:33 ` jamal
0 siblings, 0 replies; 6+ messages in thread
From: jamal @ 2005-01-16 17:33 UTC (permalink / raw)
To: Lennert Buytenhek; +Cc: David S. Miller, netdev, bdschuym
On Sun, 2005-01-16 at 12:22, Lennert Buytenhek wrote:
> On Sun, Jan 16, 2005 at 12:10:21PM -0500, jamal wrote:
>
> > Diverter could simply be killed now that tc actions exist if theres no
> > maintainer or user.
> > Should be able to divert any packet of choce to any interface.
>
> The diverter is not used for redirecting a packet to another interface.
>
> What it does (IIRC) is overwrite the destination MAC address on selected
> packets so that the local host will process them. You can do the same
> thing with iptables' "-j REDIRECT" but the diverter was made for use on
> ethernet bridges (REDIRECTing bridged packets) when the bridge-nf stuff
> didn't exist yet.
the action code is hit before bridging, so something along the lines of:
#attach to ingress of eth0
tc qdisc add dev eth0 ingress
# Munge MAC address if coming from 192.168.200.200/32
tc filter add dev eth0 parent ffff: protocol ip prio 10 u32 \
match ip src 192.168.200.200/32 flowid 1:2 \
action pedit munge offset -16 u16 set 0x0000 \
munge offset -12 u32 set 0x00020200 \
munge offset -8 u32 set 0x0001AF0A \
munge offset -4 u32 set 0x06EC0800
pedit could be taught better (macros needed) to do:
action pedit munge set src MAC 00:01:AF:0A:06:EC
instead of all that raw formating
Or if you want to redirect it after rewriting MAC to eth1:
tc filter add dev eth0 parent ffff: protocol ip prio 10 u32 \
match ip src 192.168.200.200/32 flowid 1:2 \
action pedit munge set src MAC 00:01:AF:0A:06:EC \
mirred egress redirect dev eth1
cheers,
jamal
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-01-16 17:33 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-14 12:47 [PATCH] remove superfluous diverter printk'ing Lennert Buytenhek
2005-01-14 21:46 ` David S. Miller
2005-01-15 10:47 ` Lennert Buytenhek
2005-01-16 17:10 ` jamal
2005-01-16 17:22 ` Lennert Buytenhek
2005-01-16 17:33 ` jamal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).