[Bridge] [RFC patch] allow IP address on enslaved interfaces

Joakim Tjernlund joakim.tjernlund at transmode.se
Tue Mar 30 09:42:43 PDT 2010


Stephen Hemminger <shemminger at linux-foundation.org> wrote on 2010/03/30 17:22:28:
>
> On Tue, 30 Mar 2010 09:18:13 +0200
> Joakim Tjernlund <joakim.tjernlund at transmode.se> wrote:
>
> >
> > This quick hack lets me use an IP address on an enslaved interface:
> >  #eth1 has IP 192.168.1.16
> >  brctl addbr br0
> >  brctl setfd br0 0
> >  ifconfig br0 up
> >  brctl addif br0 eth1
> >
> > After this I can use eth1 as if it was the br0 interface.
> > This obviously needs cleanup(skb->cb[42] = 99 needs to be fixed)
> > I probably broke something else too :(
> > Is this useful for someone else too?
> >
> >           Jocke
> >
> > diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
> > index 1a99c4e..60d04eb 100644
> > --- a/net/bridge/br_device.c
> > +++ b/net/bridge/br_device.c
> > @@ -32,6 +32,7 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
> >     skb_reset_mac_header(skb);
> >     skb_pull(skb, ETH_HLEN);
> >
> > +   skb->cb[42] = 99;
> >
>
> Using skb->cb is an ugly hack and won't work if qdisc modifies.
> So sorry no.

I know(I wrote that it needed fixing) but that was the only thing I could think of at the moment.
Problem is that I need to tag the skb so I know if the bride already have seen the skb, otherwise
an endless loop occurs. Any ideas what to use instead?

Other than that, is the idea OK or is something else needed?

 Jocke



More information about the Bridge mailing list