]> git.ozlabs.org Git - yaboot.git/commitdiff
Move ipv4 arguments handling to a separate function. No fucntional change.
authorChandra Seetharaman <sekharan@us.ibm.com>
Fri, 9 Jan 2009 13:59:18 +0000 (05:59 -0800)
committerTony Breeds <tony@bakeyournoodle.com>
Thu, 5 Mar 2009 00:07:23 +0000 (11:07 +1100)
This is just in preparation for the next patch which adds supports for
ipv6.

Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
---

second/file.c

index e5135995a74e33fb73ebec5e318b8baa71c5f033..875cad807063efaac91c729648786a470d4e938c 100644 (file)
@@ -62,19 +62,14 @@ scopy(char **dest, char **source)
 }
 
 /*
 }
 
 /*
- * Extract all the arguments provided in the imagepath and fill it in result.
+ * Extract all the ipv4 arguments from the bootpath provided and fill result
  * Returns 1 on success, 0 on failure.
  */
 static int
  * Returns 1 on success, 0 on failure.
  */
 static int
-extract_args_from_netdev_path(char *imagepath, struct boot_fspec_t *result)
+extract_ipv4_args(char *imagepath, struct boot_fspec_t *result)
 {
      char *tmp, *args, *str, *start;
 
 {
      char *tmp, *args, *str, *start;
 
-     DEBUG_F("imagepath = %s\n", imagepath);
-
-     if (!imagepath)
-         return 1;
-
      args = strrchr(imagepath, ':');
      if (!args)
          return 1;
      args = strrchr(imagepath, ':');
      if (!args)
          return 1;
@@ -133,6 +128,24 @@ extract_args_from_netdev_path(char *imagepath, struct boot_fspec_t *result)
          if (!result->addl_params)
                return 0;
      }
          if (!result->addl_params)
                return 0;
      }
+     return 1;
+}
+
+/*
+ * Extract all the arguments provided in the imagepath and fill it in result.
+ * Returns 1 on success, 0 on failure.
+ */
+static int
+extract_args_from_netdev_path(char *imagepath, struct boot_fspec_t *result)
+{
+     int ret;
+
+     DEBUG_F("imagepath = %s\n", imagepath);
+
+     if (!imagepath)
+         return 1;
+
+     ret = extract_ipv4_args(imagepath, result);
 
      DEBUG_F("siaddr = <%s>\n", result->siaddr);
      DEBUG_F("file = <%s>\n", result->file);
 
      DEBUG_F("siaddr = <%s>\n", result->siaddr);
      DEBUG_F("file = <%s>\n", result->file);
@@ -141,7 +154,7 @@ extract_args_from_netdev_path(char *imagepath, struct boot_fspec_t *result)
      DEBUG_F("bootp_retries = <%s>\n", result->bootp_retries);
      DEBUG_F("tftp_retries = <%s>\n", result->tftp_retries);
      DEBUG_F("addl_params = <%s>\n", result->addl_params);
      DEBUG_F("bootp_retries = <%s>\n", result->bootp_retries);
      DEBUG_F("tftp_retries = <%s>\n", result->tftp_retries);
      DEBUG_F("addl_params = <%s>\n", result->addl_params);
-     return 1;
+     return ret;
 }
 
 static char *netdev_path_to_dev(const char *path)
 }
 
 static char *netdev_path_to_dev(const char *path)