]> git.ozlabs.org Git - yaboot.git/commitdiff
Support for VLAN tags
authorSantiago Leon <santil@linux.vnet.ibm.com>
Fri, 1 Mar 2013 14:48:04 +0000 (09:48 -0500)
committerTony Breeds <tony@bakeyournoodle.com>
Mon, 8 Apr 2013 04:04:41 +0000 (14:04 +1000)
Adds support for booting from an IPv4 or IPv6 network with a VLAN tag.

Signed-off-by: Santiago Leon <santil@linux.vnet.ibm.com>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
include/file.h
second/file.c
second/fs_of.c

index b2d9c63a71d9082f499382c877fdb3ee074883d5..e2ccc13d2265b8d4c665c0a4b7bc45072852e956 100644 (file)
@@ -47,6 +47,7 @@ struct boot_fspec_t {
        char*   tftp_retries;   /* TFTP retries */
        char*   subnetmask;     /* Subnet mask */
        char*   addl_params;    /* copy all additional parameters */
        char*   tftp_retries;   /* TFTP retries */
        char*   subnetmask;     /* Subnet mask */
        char*   addl_params;    /* copy all additional parameters */
+       char*   vtag;           /* VLAN tag */
 
        /* Following fields are used only in ipv6 format */
        int     is_ipv6;        /* is ipv6 specified ? */
 
        /* Following fields are used only in ipv6 format */
        int     is_ipv6;        /* is ipv6 specified ? */
index fd081a3010d3ba4710349144da54ac73fe23cb3f..02b187231716e318964dc77681637d000ad2a35a 100644 (file)
@@ -163,9 +163,14 @@ extract_ipv4_args(char *imagepath, struct boot_fspec_t *result)
          args++; /* If comma(,) is not immediately followed by ':' then go past the , */
 
      /*
          args++; /* If comma(,) is not immediately followed by ':' then go past the , */
 
      /*
-      * read the arguments in order: siaddr,filename,ciaddr,giaddr,
+      * read the arguments in order: vtag,siaddr,filename,ciaddr,giaddr,
       * bootp-retries,tftp-retries,addl_prameters
       */
       * bootp-retries,tftp-retries,addl_prameters
       */
+     if ((tmp = strstr(imagepath, "vtag=")) != NULL) {
+       result->vtag = scopy(&str, &tmp);
+       args = tmp;
+     }
+
      result->siaddr = is_valid_ipv4_str(scopy(&str, &args));
      result->file = scopy(&str, &args);
      result->ciaddr = is_valid_ipv4_str(scopy(&str, &args));
      result->siaddr = is_valid_ipv4_str(scopy(&str, &args));
      result->file = scopy(&str, &args);
      result->ciaddr = is_valid_ipv4_str(scopy(&str, &args));
@@ -331,6 +336,9 @@ extract_ipv6_args(char *imagepath, struct boot_fspec_t *result)
      if ((tmp = strstr(imagepath, "dhcpv6=")) != NULL)
        result->dhcpv6 = scopy(&str, &tmp);
 
      if ((tmp = strstr(imagepath, "dhcpv6=")) != NULL)
        result->dhcpv6 = scopy(&str, &tmp);
 
+     if ((tmp = strstr(imagepath, "vtag=")) != NULL)
+       result->vtag = scopy(&str, &tmp);
+
      if ((tmp = strstr(imagepath, "ciaddr=")) != NULL)
        result->ciaddr = scopy(&str, &tmp);
 
      if ((tmp = strstr(imagepath, "ciaddr=")) != NULL)
        result->ciaddr = scopy(&str, &tmp);
 
index 77113b14ed8bb68f1f8e83a8aacda769c2510d74..3a8819c4b83f82c9342848712edb7fd5f311ec49 100644 (file)
@@ -152,9 +152,9 @@ of_net_open(struct boot_file_t* file,
      }
 
      DEBUG_F("siaddr <%s>; filename <%s>; ciaddr <%s>; giaddr <%s>;"
      }
 
      DEBUG_F("siaddr <%s>; filename <%s>; ciaddr <%s>; giaddr <%s>;"
-             " ipv6 <%d>\n",
+             " ipv6 <%d>; vtag <%s>\n",
              fspec->siaddr, filename, fspec->ciaddr, fspec->giaddr,
              fspec->siaddr, filename, fspec->ciaddr, fspec->giaddr,
-             fspec->is_ipv6);
+             fspec->is_ipv6, fspec->vtag);
 
      strncpy(buffer, fspec->dev, 768);
      /* If we didn't get a ':' include one */
 
      strncpy(buffer, fspec->dev, 768);
      /* If we didn't get a ':' include one */
@@ -169,6 +169,13 @@ of_net_open(struct boot_file_t* file,
      DEBUG_F("Using %s tftp style\n", (new_tftp? "new": "old"));
 
      if (new_tftp) {
      DEBUG_F("Using %s tftp style\n", (new_tftp? "new": "old"));
 
      if (new_tftp) {
+          if (fspec->is_ipv6)
+              strcat(buffer, "ipv6,");
+
+          if (fspec->vtag) {
+              strcat(buffer, fspec->vtag);
+              strcat(buffer, ",");
+         }
           strcat(buffer, fspec->siaddr);
           strcat(buffer, ",");
 
           strcat(buffer, fspec->siaddr);
           strcat(buffer, ",");