1 diff -dur grub-2.00.git20131218.orig/grub-core/kern/ieee1275/init.c grub-2.00.git20131218/grub-core/kern/ieee1275/init.c
2 --- grub-2.00.git20131218.orig/grub-core/kern/ieee1275/init.c 2013-12-18 13:11:29.000000000 +0100
3 +++ grub-2.00.git20131218/grub-core/kern/ieee1275/init.c 2013-12-18 14:39:17.000000000 +0100
7 dev = grub_ieee1275_get_aliasdevname (bootpath);
8 + grub_ieee1275_parse_net_options (bootpath);
9 canon = grub_ieee1275_canonicalise_devname (dev);
10 ptr = canon + grub_strlen (canon) - 1;
11 while (ptr > canon && (*ptr == ',' || *ptr == ':'))
12 Only in grub-2.00.git20131218/grub-core/kern/ieee1275: init.c.orig
13 diff -dur grub-2.00.git20131218.orig/grub-core/kern/ieee1275/openfw.c grub-2.00.git20131218/grub-core/kern/ieee1275/openfw.c
14 --- grub-2.00.git20131218.orig/grub-core/kern/ieee1275/openfw.c 2013-12-18 13:11:29.000000000 +0100
15 +++ grub-2.00.git20131218/grub-core/kern/ieee1275/openfw.c 2013-12-18 14:39:17.000000000 +0100
18 #include <grub/ieee1275/ieee1275.h>
20 +#include <grub/env.h>
22 enum grub_ieee1275_parse_type
29 +grub_ieee1275_parse_net_options (const char *path)
35 + args = grub_ieee1275_get_devargs (path);
37 + /* There is no option. */
42 + comma = grub_strchr (args, ',');
44 + option = grub_strdup (args);
46 + option = grub_strndup (args, (grub_size_t)(comma - args));
49 + if (! grub_strncmp(option, "vtag", 4))
50 + grub_env_set ("vlan-tag", option + grub_strlen("vtag="));
58 grub_ieee1275_get_device_type (const char *path)
60 Only in grub-2.00.git20131218/grub-core/kern/ieee1275: openfw.c.orig
61 diff -dur grub-2.00.git20131218.orig/grub-core/net/ethernet.c grub-2.00.git20131218/grub-core/net/ethernet.c
62 --- grub-2.00.git20131218.orig/grub-core/net/ethernet.c 2013-12-18 13:11:29.000000000 +0100
63 +++ grub-2.00.git20131218/grub-core/net/ethernet.c 2013-12-18 14:39:17.000000000 +0100
65 #include <grub/net/arp.h>
66 #include <grub/net/netbuff.h>
68 +#include <grub/env.h>
69 #include <grub/time.h>
70 #include <grub/net/arp.h>
76 + grub_uint32_t vlantag = 0;
77 + grub_uint8_t etherhdr_size;
79 - COMPILE_TIME_ASSERT (sizeof (*eth) < GRUB_NET_MAX_LINK_HEADER_SIZE);
80 + etherhdr_size = sizeof (*eth);
81 + COMPILE_TIME_ASSERT (sizeof (*eth) + 4 < GRUB_NET_MAX_LINK_HEADER_SIZE);
83 - err = grub_netbuff_push (nb, sizeof (*eth));
84 + const char *vlantag_text = grub_env_get ("vlan-tag");
85 + if (vlantag_text != 0) {
87 + vlantag = grub_strtoul (vlantag_text, 0, 16);
90 + err = grub_netbuff_push (nb, etherhdr_size);
93 eth = (struct etherhdr *) nb->data;
96 inf->card->opened = 1;
99 + /* Check if a vlan-tag is needed. */
102 + /* Move eth type to the right */
103 + grub_memcpy((char *) nb->data + etherhdr_size - 2,
104 + (char *) nb->data + etherhdr_size - 6, 2);
106 + /* Add the tag in the middle */
107 + grub_memcpy((char *) nb->data + etherhdr_size - 6,
111 return inf->card->driver->send (inf->card, nb);
115 grub_net_link_level_address_t hwaddress;
116 grub_net_link_level_address_t src_hwaddress;
118 + grub_uint8_t etherhdr_size = sizeof (*eth);
120 + grub_uint16_t vlantag_identifier = 0;
121 + grub_memcpy (&vlantag_identifier, nb->data + etherhdr_size - 2, 2);
123 + /* Check if a vlan-tag is present. */
124 + if (vlantag_identifier == VLANTAG_IDENTIFIER)
126 + etherhdr_size += 4;
127 + /* Move eth type to the original position */
128 + grub_memcpy((char *) nb->data + etherhdr_size - 6,
129 + (char *) nb->data + etherhdr_size - 2, 2);
132 eth = (struct etherhdr *) nb->data;
133 type = grub_be_to_cpu16 (eth->type);
134 - err = grub_netbuff_pull (nb, sizeof (*eth));
135 + err = grub_netbuff_pull (nb, etherhdr_size);
139 diff -dur grub-2.00.git20131218.orig/include/grub/ieee1275/ieee1275.h grub-2.00.git20131218/include/grub/ieee1275/ieee1275.h
140 --- grub-2.00.git20131218.orig/include/grub/ieee1275/ieee1275.h 2013-12-18 13:11:29.000000000 +0100
141 +++ grub-2.00.git20131218/include/grub/ieee1275/ieee1275.h 2013-12-18 14:40:11.000000000 +0100
143 char *EXPORT_FUNC(grub_ieee1275_canonicalise_devname) (const char *path);
144 char *EXPORT_FUNC(grub_ieee1275_get_device_type) (const char *path);
145 char *EXPORT_FUNC(grub_ieee1275_get_devname) (const char *path);
146 +int EXPORT_FUNC(grub_ieee1275_parse_net_options) (const char *path);
148 void EXPORT_FUNC(grub_ieee1275_devalias_init_iterator) (struct grub_ieee1275_devalias *alias);
149 void EXPORT_FUNC(grub_ieee1275_devalias_free) (struct grub_ieee1275_devalias *alias);
150 diff -dur grub-2.00.git20131218.orig/include/grub/net.h grub-2.00.git20131218/include/grub/net.h
151 --- grub-2.00.git20131218.orig/include/grub/net.h 2013-12-18 13:11:29.000000000 +0100
152 +++ grub-2.00.git20131218/include/grub/net.h 2013-12-18 14:39:18.000000000 +0100
154 #define GRUB_NET_TRIES 40
155 #define GRUB_NET_INTERVAL 400
157 +#define VLANTAG_IDENTIFIER 0x8100
159 #endif /* ! GRUB_NET_HEADER */
160 Only in grub-2.00.git20131218/include/grub: net.h.orig