lkml.org 
[lkml]   [2006]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [RFC PATCH 32/33] Add the Xen virtual network device driver.
    From
    Date
    On Tue, 2006-07-18 at 00:00 -0700, Chris Wright wrote:
    > +
    > +/** Send a packet on a net device to encourage switches to learn the
    > + * MAC. We send a fake ARP request.
    > + *
    > + * @param dev device
    > + * @return 0 on success, error code otherwise
    > + */
    > +static int send_fake_arp(struct net_device *dev)
    > +{
    > + struct sk_buff *skb;
    > + u32 src_ip, dst_ip;
    > +
    > + dst_ip = INADDR_BROADCAST;
    > + src_ip = inet_select_addr(dev, dst_ip, RT_SCOPE_LINK);
    > +
    > + /* No IP? Then nothing to do. */
    > + if (src_ip == 0)
    > + return 0;
    > +
    > + skb = arp_create(ARPOP_REPLY, ETH_P_ARP,
    > + dst_ip, dev, src_ip,
    > + /*dst_hw*/ NULL, /*src_hw*/ NULL,
    > + /*target_hw*/ dev->dev_addr);
    > + if (skb == NULL)
    > + return -ENOMEM;
    > +
    > + return dev_queue_xmit(skb);
    > +}

    Hi,

    Hmmm maybe it's me, but something bugs me if a NIC driver is going to
    send IP level ARP packets... that just feels very very wrong and is a
    blatant layering violation.... shouldn't the ifup/ifconfig scripts just
    be fixed instead if this is critical behavior?

    Greetings,
    Arjan van de Ven



    -
    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: 2006-07-18 12:31    [W:5.250 / U:0.240 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site