WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] netfront: arp code needs CONFIG_INET.
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 31 Oct 2007 15:00:55 -0700
Delivery-date: Wed, 31 Oct 2007 15:03:10 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] netfront: arp code needs CONFIG_INET., Xen patchbot-linux-2.6.18-xen <=