[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] Re: [RFC PATCH 32/33] Add the Xen virtual network device driver.
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 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |