mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-25 16:49:23 +00:00
Add Virtual LAN support.
This patch adds support for virtual LAN (VLAN) tagging. VLAN tagging allows multiple VLANs in a bridged network to share the same physical network link but maintain isolation: http://en.wikipedia.org/wiki/IEEE_802.1Q * grub-core/net/ethernet.c: Add check, get, and set vlan tag id. * grub-core/net/drivers/ieee1275/ofnet.c: Get vlan tag id from bootargs. * grub-core/net/arp.c: Add check. * grub-core/net/ip.c: Likewise. * include/grub/net/arp.h: Add vlantag attribute. * include/grub/net/ip.h: Likewise.
This commit is contained in:
1 parent
8ff3c31f6d
commit
af768f8d41
8 files changed
+109
-20
No files matched your search
@@ -147,11 +147,11 @@ grub_ieee1275_parse_bootargs (const char *devpath, char *bootpath,
|
||||
char *comma_char = 0;
|
||||
char *equal_char = 0;
|
||||
grub_size_t field_counter = 0;
|
||||
|
||||
grub_net_network_level_address_t client_addr, gateway_addr, subnet_mask;
|
||||
grub_net_link_level_address_t hw_addr;
|
||||
grub_net_interface_flags_t flags = 0;
|
||||
struct grub_net_network_level_interface *inter;
|
||||
grub_uint16_t vlantag = 0;
|
||||
|
||||
hw_addr.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET;
|
||||
|
||||
@@ -169,6 +169,11 @@ grub_ieee1275_parse_bootargs (const char *devpath, char *bootpath,
|
||||
*equal_char = 0;
|
||||
grub_env_set_net_property ((*card)->name, args, equal_char + 1,
|
||||
grub_strlen(equal_char + 1));
|
||||
|
||||
if ((grub_strcmp (args, "vtag") == 0) &&
|
||||
(grub_strlen (equal_char + 1) == 8))
|
||||
vlantag = grub_strtoul (equal_char + 1 + 4, 0, 16);
|
||||
|
||||
*equal_char = '=';
|
||||
}
|
||||
else
|
||||
@@ -207,8 +212,10 @@ grub_ieee1275_parse_bootargs (const char *devpath, char *bootpath,
|
||||
hw_addr.mac, sizeof(hw_addr.mac), 0);
|
||||
inter = grub_net_add_addr ((*card)->name, *card, &client_addr, &hw_addr,
|
||||
flags);
|
||||
inter->vlantag = vlantag;
|
||||
grub_net_add_ipv4_local (inter,
|
||||
__builtin_ctz (~grub_le_to_cpu32 (subnet_mask.ipv4)));
|
||||
|
||||
}
|
||||
|
||||
if (gateway_addr.ipv4 != 0)
|
||||
|
||||
Reference in new issue
Block a user