[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] netfront: arp code needs CONFIG_INET.



# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1193823740 0
# Node ID 6c81f3879f3dbdec666c491377eacb01bd9309a0
# Parent  ba69bacc7e8a28ec3aa7bcec0dbd21a3be2db2eb
netfront: arp code needs CONFIG_INET.
Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>
---
 drivers/xen/netfront/netfront.c |   38 +++++++++++++++++++++++---------------
 1 files changed, 23 insertions(+), 15 deletions(-)

diff -r ba69bacc7e8a -r 6c81f3879f3d drivers/xen/netfront/netfront.c
--- a/drivers/xen/netfront/netfront.c   Wed Oct 31 09:21:37 2007 +0000
+++ b/drivers/xen/netfront/netfront.c   Wed Oct 31 09:42:20 2007 +0000
@@ -221,7 +221,7 @@ static int network_connect(struct net_de
 static int network_connect(struct net_device *);
 static void network_tx_buf_gc(struct net_device *);
 static void network_alloc_rx_buffers(struct net_device *);
-static int send_fake_arp(struct net_device *);
+static void send_fake_arp(struct net_device *);
 
 static irqreturn_t netif_int(int irq, void *dev_id, struct pt_regs *ptregs);
 
@@ -542,7 +542,7 @@ static void backend_changed(struct xenbu
                if (network_connect(netdev) != 0)
                        break;
                xenbus_switch_state(dev, XenbusStateConnected);
-               (void)send_fake_arp(netdev);
+               send_fake_arp(netdev);
                break;
 
        case XenbusStateClosing:
@@ -557,8 +557,9 @@ static void backend_changed(struct xenbu
  * @param dev device
  * @return 0 on success, error code otherwise
  */
-static int send_fake_arp(struct net_device *dev)
-{
+static void send_fake_arp(struct net_device *dev)
+{
+#ifdef CONFIG_INET
        struct sk_buff *skb;
        u32             src_ip, dst_ip;
 
@@ -567,16 +568,17 @@ static int send_fake_arp(struct net_devi
 
        /* No IP? Then nothing to do. */
        if (src_ip == 0)
-               return 0;
+               return;
 
        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);
+               return;
+
+       dev_queue_xmit(skb);
+#endif
 }
 
 static inline int netfront_tx_slot_available(struct netfront_info *np)
@@ -2098,6 +2100,7 @@ static struct net_device * __devinit cre
        return ERR_PTR(err);
 }
 
+#ifdef CONFIG_INET
 /*
  * We use this notifier to send out a fake ARP reply to reset switches and
  * router ARP caches when an IP interface is brought up on a VIF.
@@ -2110,10 +2113,17 @@ inetdev_notify(struct notifier_block *th
 
        /* UP event and is it one of our devices? */
        if (event == NETDEV_UP && dev->open == network_open)
-               (void)send_fake_arp(dev);
+               send_fake_arp(dev);
 
        return NOTIFY_DONE;
 }
+
+static struct notifier_block notifier_inetdev = {
+       .notifier_call  = inetdev_notify,
+       .next           = NULL,
+       .priority       = 0
+};
+#endif
 
 
 static void netif_disconnect_backend(struct netfront_info *info)
@@ -2168,12 +2178,6 @@ static struct xenbus_driver netfront = {
 };
 
 
-static struct notifier_block notifier_inetdev = {
-       .notifier_call  = inetdev_notify,
-       .next           = NULL,
-       .priority       = 0
-};
-
 static int __init netif_init(void)
 {
        if (!is_running_on_xen())
@@ -2196,7 +2200,9 @@ static int __init netif_init(void)
 
        IPRINTK("Initialising virtual ethernet driver.\n");
 
+#ifdef CONFIG_INET
        (void)register_inetaddr_notifier(&notifier_inetdev);
+#endif
 
        return xenbus_register_frontend(&netfront);
 }
@@ -2208,7 +2214,9 @@ static void __exit netif_exit(void)
        if (is_initial_xendomain())
                return;
 
+#ifdef CONFIG_INET
        unregister_inetaddr_notifier(&notifier_inetdev);
+#endif
 
        netif_exit_accel();
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.