From: Simon Horman Subject: [patch] netfront: arp code needs CONFIG_INET Date: Wed, 31 Oct 2007 18:15:54 +0900 Message-ID: <20071031091609.9B39C4F8D2@tabatha.lab.ultramonkey.org> Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org 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 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(¬ifier_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(¬ifier_inetdev); +#endif return xenbus_unregister_driver(&netfront); }