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-ia64-devel

[Xen-ia64-devel] [patch] netfront: arp code needs CONFIG_INET

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [patch] netfront: arp code needs CONFIG_INET
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Wed, 31 Oct 2007 18:07:43 +0900
Delivery-date: Wed, 31 Oct 2007 02:13:17 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
drivers/built-in.o: In function 
`send_fake_arp':drivers/xen/netfront/netfront.c:568: undefined reference to 
`inet_select_addr'
:drivers/xen/netfront/netfront.c:574: undefined reference to `arp_create'
drivers/built-in.o: In function 
`netif_init':drivers/xen/netfront/netfront.c:2199: undefined reference to 
`register_inetaddr_notifier'

In order for arp_create to exist CONFIG_INET is needed.
I've taken the approach of surrounding all the functionality
that depents on arp_create() with #if CONFIG_INET.

An alternate approach would be to make sure that Kconfig
enables CONFIG_INET if CONFIG_XEN_NETDEV_FRONTEND is enabled
which would likely mean that CONFIG_INET would always be enabled
if CONFIG_NET and CONFIG_XEN are enabled.

Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>

Index: linux-2.6.18-xen.hg/drivers/xen/netfront/netfront.c
===================================================================
--- linux-2.6.18-xen.hg.orig/drivers/xen/netfront/netfront.c    2007-10-31 
18:01:33.000000000 +0900
+++ linux-2.6.18-xen.hg/drivers/xen/netfront/netfront.c 2007-10-31 
18:01:52.000000000 +0900
@@ -561,6 +561,7 @@ static void backend_changed(struct xenbu
  */
 static int send_fake_arp(struct net_device *dev)
 {
+#ifdef CONFIG_INET
        struct sk_buff *skb;
        u32             src_ip, dst_ip;
 
@@ -579,6 +580,9 @@ static int send_fake_arp(struct net_devi
                return -ENOMEM;
 
        return dev_queue_xmit(skb);
+#else
+       return -ENODEV;
+#endif
 }
 
 static inline int netfront_tx_slot_available(struct netfront_info *np)
@@ -2098,6 +2102,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.
@@ -2114,6 +2119,7 @@ inetdev_notify(struct notifier_block *th
 
        return NOTIFY_DONE;
 }
+#endif
 
 
 static void netif_disconnect_backend(struct netfront_info *info)
@@ -2168,11 +2174,13 @@ static struct xenbus_driver netfront = {
 };
 
 
+#ifdef CONFIG_INET
 static struct notifier_block notifier_inetdev = {
        .notifier_call  = inetdev_notify,
        .next           = NULL,
        .priority       = 0
 };
+#endif
 
 static int __init netif_init(void)
 {
@@ -2196,7 +2204,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 +2218,9 @@ static void __exit netif_exit(void)
        if (is_initial_xendomain())
                return;
 
+#ifdef CONFIG_INET
        unregister_inetaddr_notifier(&notifier_inetdev);
+#endif
 
        return xenbus_unregister_driver(&netfront);
 }

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

<Prev in Thread] Current Thread [Next in Thread>