代码拉取完成,页面将自动刷新
同步操作将从 songkai/grub2 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mark Salter <msalter@redhat.com>
Date: Tue, 22 Aug 2017 12:21:12 -0400
Subject: [PATCH] Fix grub_net_hwaddr_to_str
commit 5c3b78c92f8 introduced support for larger network hw addresses.
However, grub_net_hwaddr_to_str() relies on GRUB_NET_MAX_STR_ADDRESS_SIZE
to prevent a spurious ':' at the end of the string. So now, if actual
hwaddr size is less than max, an extra ':' appears at the end of the
string. So calculate max string size based on actual hwaddr length to
fix the problem.
Signed-off-by: Mark Salter <msalter@redhat.com>
---
grub-core/net/net.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/grub-core/net/net.c b/grub-core/net/net.c
index a0f4d00f0..191e8e41b 100644
--- a/grub-core/net/net.c
+++ b/grub-core/net/net.c
@@ -770,6 +770,7 @@ grub_net_hwaddr_to_str (const grub_net_link_level_address_t *addr, char *str)
{
char *ptr;
unsigned i;
+ int maxstr;
if (addr->len > GRUB_NET_MAX_LINK_ADDRESS_SIZE)
{
@@ -778,9 +779,10 @@ grub_net_hwaddr_to_str (const grub_net_link_level_address_t *addr, char *str)
addr->type, addr->len);
return;
}
+ maxstr = addr->len * grub_strlen ("XX:");
for (ptr = str, i = 0; i < addr->len; i++)
{
- ptr += grub_snprintf (ptr, GRUB_NET_MAX_STR_HWADDR_LEN - (ptr - str),
+ ptr += grub_snprintf (ptr, maxstr - (ptr - str),
"%02x:", addr->mac[i] & 0xff);
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。