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

Stephen Hemminger
Tue, 30 Mar 2010 15:22:28 -0000

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.