lkml.org 
[lkml]   [2009]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [PATCH 1/3] macvlan: Reflect macvlan packets meant for other macvlan devices
    From
    On Tue, Nov 17, 2009 at 11:39 PM, Arnd Bergmann <arnd@arndb.de> wrote:
    > From: Eric Biederman <ebiederm@xmission.com>
    >
    > Switch ports do not send packets back out the same port they came
    > in on.  This causes problems when using a macvlan device inside
    > of a network namespace as it becomes impossible to talk to
    > other macvlan devices.
    >
    > Signed-off-by: Eric Biederman <ebiederm@xmission.com>
    > Signed-off-by: Arnd Bergmann <arnd@arndb.de>

    I found a problem:

    > @@ -140,20 +145,45 @@ static void macvlan_broadcast(struct sk_buff *skb,
    >        }
    >  }
    >
    > +static int macvlan_unicast(struct sk_buff *skb, const struct macvlan_dev *dest)
    > +{
    > +       struct net_device *dev = dest->dev;
    > +
    > +       if (unlikely(!dev->flags & IFF_UP)) {

    parentheses are missing:

    if (unlikely(!(dev->flags & IFF_UP))) {

    > +               kfree_skb(skb);
    > +               return NET_XMIT_DROP;
    > +       }
    > +
    > +       skb = skb_share_check(skb, GFP_ATOMIC);
    > +       if (!skb) {
    > +               dev->stats.rx_errors++;
    > +               dev->stats.rx_dropped++;
    > +               return NET_XMIT_DROP;
    > +       }
    > +
    > +       dev->stats.rx_bytes += skb->len + ETH_HLEN;
    > +       dev->stats.rx_packets++;
    > +
    > +       skb->dev = dev;
    > +       skb->pkt_type = PACKET_HOST;
    > +       netif_rx(skb);
    > +       return NET_XMIT_SUCCESS;
    > +}
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2009-11-18 11:03    [W:0.025 / U:31.976 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site