浏览代码

Tools: hv: KVP: Fix a bug in IPV6 subnet enumeration

Each subnet string needs to be separated with a semicolon. Fix this bug.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
K. Y. Srinivasan 12 年之前
父节点
当前提交
ed4bb9744b
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      tools/hv/hv_kvp_daemon.c

+ 3 - 2
tools/hv/hv_kvp_daemon.c

@@ -1026,9 +1026,10 @@ kvp_get_ip_info(int family, char *if_name, int op,
 
 
 				if (sn_offset == 0)
 				if (sn_offset == 0)
 					strcpy(sn_str, cidr_mask);
 					strcpy(sn_str, cidr_mask);
-				else
+				else {
+					strcat((char *)ip_buffer->sub_net, ";");
 					strcat(sn_str, cidr_mask);
 					strcat(sn_str, cidr_mask);
-				strcat((char *)ip_buffer->sub_net, ";");
+				}
 				sn_offset += strlen(sn_str) + 1;
 				sn_offset += strlen(sn_str) + 1;
 			}
 			}