]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Prevente a bootp packet to be sent on open.
authorManoel Rebelo Abranches <mrabran@br.ibm.com>
Tue, 10 May 2011 12:45:57 +0000 (09:45 -0300)
committerManoel Rebelo Abranches <mrabran@br.ibm.com>
Tue, 10 May 2011 12:45:57 +0000 (09:45 -0300)
grub-core/net/drivers/ieee1275/ofnet.c

index 10de81bc7ed02b87fde5f466c751b9bcb0689aa7..ce7ab32a826f5217f81c6c50990ad3640a7e7fbf 100644 (file)
@@ -1,17 +1,23 @@
 #include <grub/net/netbuff.h>
 #include <grub/ieee1275/ofnet.h>
 #include <grub/ieee1275/ieee1275.h>
+#include <grub/dl.h>
 #include <grub/net.h>
+#include <grub/time.h>
 
 static grub_err_t 
 card_open (struct grub_net_card *dev)
 {
   int status;
   struct grub_ofnetcard_data *data = dev->data;
-  status = grub_ieee1275_open (data->path,&(data->handle)); 
+  char path[grub_strlen(data->path) + grub_strlen(":speed=auto,duplex=auto,1.1.1.1,dummy,1.1.1.1,1.1.1.1,5,5,1.1.1.1,512") + 1];
+  /* The full string will prevent a bootp packet to be sent. Just put some valid ip in there.  */
+  grub_snprintf(path,sizeof(path),"%s%s",data->path,":speed=auto,duplex=auto,1.1.1.1,dummy,1.1.1.1,1.1.1.1,5,5,1.1.1.1,512");
+  status = grub_ieee1275_open (path,&(data->handle)); 
 
   if (status)
-    return grub_error (GRUB_ERR_IO, "couldn't open network card");
+    return grub_error (GRUB_ERR_IO, "Couldn't open network card.");
+
   return GRUB_ERR_NONE;
 }