Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153445653
D7809.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D7809.diff
View Options
Index: head/sys/dev/hyperv/utilities/hv_kvp.c
===================================================================
--- head/sys/dev/hyperv/utilities/hv_kvp.c
+++ head/sys/dev/hyperv/utilities/hv_kvp.c
@@ -332,20 +332,23 @@
if (devclass_get_devices(devclass_find("hn"), &devs, &devcnt) == 0) {
for (devcnt = devcnt - 1; devcnt >= 0; devcnt--) {
- /* XXX access other driver's softc? are you kidding? */
device_t dev = devs[devcnt];
struct vmbus_channel *chan;
char buf[HYPERV_GUID_STRLEN];
+ int n;
- /*
- * Trying to find GUID of Network Device
- */
chan = vmbus_get_channel(dev);
- hyperv_guid2str(vmbus_chan_guid_inst(chan),
- buf, sizeof(buf));
+ n = hyperv_guid2str(vmbus_chan_guid_inst(chan), buf,
+ sizeof(buf));
- if (strncmp(buf, (char *)umsg->body.kvp_ip_val.adapter_id,
- HYPERV_GUID_STRLEN - 1) == 0) {
+ /*
+ * The string in the 'kvp_ip_val.adapter_id' has
+ * braces around the GUID; skip the leading brace
+ * in 'kvp_ip_val.adapter_id'.
+ */
+ if (strncmp(buf,
+ ((char *)&umsg->body.kvp_ip_val.adapter_id) + 1,
+ n) == 0) {
strlcpy((char *)umsg->body.kvp_ip_val.adapter_id,
device_get_nameunit(dev), MAX_ADAPTER_ID_SIZE);
break;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 22, 5:30 AM (17 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31956147
Default Alt Text
D7809.diff (1 KB)
Attached To
Mode
D7809: hyperv/kvp: fix the issue of IP injection
Attached
Detach File
Event Timeline
Log In to Comment