Skip to contentSkip to conversation

netfront: arp code needs CONFIG_INET

PATCH New Simon Horman 1 participant 1 message Oct 31, 2007 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netfront: arp code needs CONFIG_INET

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.

drivers/xen/netfront/netfront.c +12 -0
Index: linux-2.6.18-xen.hg/drivers/xen/netfront/netfront.c
===================================================================
@@ -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);
 }