From ee69e39fd14f53ec767fbc825a450a77f0700b61 Mon Sep 17 00:00:00 2001 From: haozi007 Date: Sat, 28 Nov 2020 14:22:02 +0800 Subject: [PATCH] sync from openeuler Signed-off-by: haozi007 --- 0001-ignore-proxy-envs.patch | 2 +- ...ignore-http-proxy-env-for-cni-plugin.patch | 2 +- 0003-fix-invalid-ipv6-format.patch | 50 +++++++++++++++++++ clibcni.spec | 9 +++- 4 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 0003-fix-invalid-ipv6-format.patch diff --git a/0001-ignore-proxy-envs.patch b/0001-ignore-proxy-envs.patch index 190288b..67ca849 100644 --- a/0001-ignore-proxy-envs.patch +++ b/0001-ignore-proxy-envs.patch @@ -1,7 +1,7 @@ From 6af19b52f4867cfb722425ab702162af0f81d0ab Mon Sep 17 00:00:00 2001 From: haozi007 Date: Fri, 4 Sep 2020 09:53:37 +0800 -Subject: [PATCH 1/2] ignore proxy envs +Subject: [PATCH 1/3] ignore proxy envs do not inherit proxy envs from isulad diff --git a/0002-ignore-http-proxy-env-for-cni-plugin.patch b/0002-ignore-http-proxy-env-for-cni-plugin.patch index 441af68..3f2999f 100644 --- a/0002-ignore-http-proxy-env-for-cni-plugin.patch +++ b/0002-ignore-http-proxy-env-for-cni-plugin.patch @@ -1,7 +1,7 @@ From 71d2666525ed064f93693ff182cf8a862220a253 Mon Sep 17 00:00:00 2001 From: haozi007 Date: Wed, 18 Nov 2020 16:22:42 +0800 -Subject: [PATCH 2/2] ignore http proxy env for cni plugin +Subject: [PATCH 2/3] ignore http proxy env for cni plugin Signed-off-by: haozi007 --- diff --git a/0003-fix-invalid-ipv6-format.patch b/0003-fix-invalid-ipv6-format.patch new file mode 100644 index 0000000..9332ad0 --- /dev/null +++ b/0003-fix-invalid-ipv6-format.patch @@ -0,0 +1,50 @@ +From d194158130c6824fa048c07783f470f83ec9d8ae Mon Sep 17 00:00:00 2001 +From: haozi007 +Date: Thu, 26 Nov 2020 15:11:05 +0800 +Subject: [PATCH 3/3] fix invalid ipv6 format + +Signed-off-by: haozi007 +--- + README.md | 2 +- + src/types/types.c | 12 ++++++++---- + 2 files changed, 9 insertions(+), 5 deletions(-) + +diff --git a/README.md b/README.md +index bcc0368..d52e27e 100644 +--- a/README.md ++++ b/README.md +@@ -1,7 +1,7 @@ + # clibcni + + CNI (Container Network Interface), a Cloud Native Computing Foundation project. +-clibcni is a library used by iSulad to configure network interfaces in containers, following ++clibcni is a library used by [iSulad](https://gitee.com/openeuler/iSulad) to configure network interfaces in containers, following + the specification of CNI (Container Network Interface), a Cloud Native Computing Foundation project. + + ## How to Contribute +diff --git a/src/types/types.c b/src/types/types.c +index 60a63c3..a9a04e7 100644 +--- a/src/types/types.c ++++ b/src/types/types.c +@@ -313,10 +313,14 @@ static void generate_ip_string(const uint8_t *ip, int e0, int e1, char **result) + } else if (i > 0) { + (*result)[j++] = ':'; + } +- int nret = (ip[i] >> 4); +- (*result)[j++] = g_HEX_DICT[nret]; +- nret = (ip[i] & 0x0f); +- (*result)[j++] = g_HEX_DICT[nret]; ++ uint32_t nret = (ip[i] << 8) | ip[i + 1]; ++ if (sprintf((*result) + j, "%x", nret) < 0) { ++ ERROR("sprint ip failed"); ++ free(*result); ++ *result = NULL; ++ return; ++ } ++ j = strlen(*result); + } + return; + } +-- +2.25.1 + diff --git a/clibcni.spec b/clibcni.spec index 81d6aef..33927f8 100644 --- a/clibcni.spec +++ b/clibcni.spec @@ -1,5 +1,5 @@ %global _version 2.0.3 -%global _release 20201118.164602.gitdd73f4ba +%global _release 20201128.142102.git866f22d3 Name: clibcni Version: %{_version} Release: %{_release} @@ -12,6 +12,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version} Patch9001: 0001-ignore-proxy-envs.patch Patch9002: 0002-ignore-http-proxy-env-for-cni-plugin.patch +Patch9003: 0003-fix-invalid-ipv6-format.patch BuildRequires: gcc BuildRequires: cmake @@ -88,6 +89,12 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/%{name}.pc %changelog +* Sat Nov 28 2020 haozi007 - 2.0.3-20201128.142102.git866f22d3 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: fix parse ipv6 format error + * Thu Nov 12 2020 gaohuatao - 2.0.3-20201112.165252.gitc4aadda4 - Type:enhancement - ID:NA -- Gitee