All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Fahim Akhter <akhter.fahim@hotmail.com>
Cc: bridge@lists.linux-foundation.org
Subject: Re: [Bridge] Modifying All Packets passing through the bridge!
Date: Mon, 10 Nov 2008 08:35:01 -0800	[thread overview]
Message-ID: <20081110083501.55aa10fd@extreme> (raw)
In-Reply-To: <BLU149-W34C4000F51A9F3DBDA06EC8B1A0@phx.gbl>

On Mon, 10 Nov 2008 17:02:34 +0500
Fahim Akhter <akhter.fahim@hotmail.com> wrote:

> 
> Thanks a lot for the quick replies. 
>  
> I tried doing it with Bridging Hooks. Rather in the Bridge. I wrote a script with was used to modify the packets if not already modified which was placed in /net/bridge/br_forward.c  br_forward() and the packets were listened and encrypted in /net/bridge/br_forward.c should_deliver(). The enmcryption keys and status were travelling fine. But upon analyzing the packet. On the receiving end using a Windows Based packet Analyzer. I got to know that only ARP broadcast packets were being modified.
>  
> I found an old code which used kernel 2.4 used for encryption. The encryption was done in /net/bridge/br_input.c br_handle_frame().  I did all the usual stuff there but still now effect its still only modifying the ARP packets.
>  
> The ethernets are running in promiscous mode, the settings are default and the bridge works fine. Except for the fact it doesn't encrypt. 
>  
> It's taken me a while to get to this point. This being my first linux project. Hope I get a solution which takes me forward from this instead of starting from the start...> Date: Mon, 10 Nov 2008 15:58:05 +0530> From: srinivas.aji@gmail.com> To: akhter.fahim@hotmail.com> Subject: Re: [Bridge] Modifying All Packets passing through the bridge!> CC: bridge@lists.linux-foundation.org> > On Mon, Nov 10, 2008 at 11:57 AM, Fahim Akhter <akhter.fahim@hotmail.com> wrote:> > The Link> > https://lists.linux-foundation.org/pipermail/bridge/2008-October/006074.html> > , is about capturing packets and sending to user space. Speed is important> > in my current scenario. Is there anyway I can do everything in kernel> > specially by hacking or tweaking the already kernel space. Instead of socket> > programming and capturing packets at ethernet?> > That message also talks about the case where userspace will not give> you enough performance. The thing to do then would be to write a> network d
 river which sits on top of a real network device and> processes the packets before passing it on in either direction. Look> for the vlan and bonding drivers for examples. Or maybe you could use> the netfilter hooks in bridging, if your use of this encrypted link is> restricted to being between bridges.
> _________________________________________________________________
> Explore the seven wonders of the world
> http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE


Use ebtables, and write a netfilter module to do what you want.
There is no reason to mess wit the bridging infrastructure to do this.

Netfilter is the way to do all the kinds of analysis, filtering, and packet
mangling you might want.

  reply	other threads:[~2008-11-10 16:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-08 11:20 [Bridge] Modifying All Packets passing through the bridge! Fahim Akhter
2008-11-08 18:44 ` Srinivas M.A.
2008-11-10  6:27   ` Fahim Akhter
2008-11-10 10:28     ` Srinivas M.A.
2008-11-10 12:02       ` Fahim Akhter
2008-11-10 16:35         ` Stephen Hemminger [this message]
2008-11-11  5:19           ` Fahim Akhter
2008-11-11  7:16           ` Fahim Akhter
2008-11-11 17:11             ` Stephen Hemminger
2008-11-13  6:12               ` Fahim Akhter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081110083501.55aa10fd@extreme \
    --to=shemminger@vyatta.com \
    --cc=akhter.fahim@hotmail.com \
    --cc=bridge@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.