Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
06e51ae558 !11 [sync] PR-9: Synchronize some patches from upstream community
From: @openeuler-sync-bot
Reviewed-by: 
Signed-off-by: @seuzw
2021-03-11 10:19:22 +08:00
zengwefeng
ab91692107 sync patches from the upstream community
(cherry picked from commit ac7e8e77169ff74ea414b9126647b6e10e56c1b3)
2021-03-10 15:14:30 +08:00
openeuler-ci-bot
ab81dc7965 !8 add libnl3-help dependency for libnl3
From: @haochenstar
Reviewed-by: @zengwefeng
Signed-off-by: @zengwefeng
2020-11-10 20:36:07 +08:00
haochenstar
84c3d52a92 add help libnl3-help denpendency for libnl3 2020-11-09 16:09:38 +08:00
openeuler-ci-bot
784ac1bcb8 !4 rebuild for requirement package update
Merge pull request !4 from chenyaqiang/openEuler-20.03-LTS
2020-08-18 21:50:01 +08:00
chenyaqiang
daeb412e8a rebuild for requirement package update 2020-08-18 21:46:19 +08:00
openeuler-ci-bot
58f3a80956 !2 update to 3.5.0
Merge pull request !2 from yaqwer/test_ci
2020-01-12 18:09:01 +08:00
yaqwer
d0d988eb3b update software to 3.5.0 2020-01-12 16:48:48 +08:00
openeuler-ci-bot
47ced845a0 !1 libnl3: openEuler Debranding
Merge pull request !1 from openeuler-net/lwdev
2019-12-26 18:52:31 +08:00
liuwei
d5f9b18083 modify 2019-12-26 11:39:22 +08:00
25 changed files with 360 additions and 811 deletions

View File

@ -0,0 +1,123 @@
From abb7391f38893af7d6108f97ac8597468f113a41 Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Wed, 15 Apr 2020 12:42:05 +0200
Subject: [PATCH] lib: add "include/netlink-private/nl-auto.h" header
Conflict:NA
Reference:https://github.com/thom311/libnl/commit/abb7391f38893af7d6108f97ac8597468f113a41
---
Makefile.am | 1 +
include/netlink-private/nl-auto.h | 60 +++++++++++++++++++++++++++++++
include/netlink-private/utils.h | 14 ++------
3 files changed, 63 insertions(+), 12 deletions(-)
create mode 100644 include/netlink-private/nl-auto.h
diff --git a/Makefile.am b/Makefile.am
index b2e87379..085da53f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -261,6 +261,7 @@ noinst_HEADERS = \
include/netlink-private/cache-api.h \
include/netlink-private/genl.h \
include/netlink-private/netlink.h \
+ include/netlink-private/nl-auto.h \
include/netlink-private/object-api.h \
include/netlink-private/route/link/api.h \
include/netlink-private/route/link/sriov.h \
diff --git a/include/netlink-private/nl-auto.h b/include/netlink-private/nl-auto.h
new file mode 100644
index 00000000..7b923f26
--- /dev/null
+++ b/include/netlink-private/nl-auto.h
@@ -0,0 +1,60 @@
+// SPDX-License-Identifier: LGPL-2.1+
+
+#ifndef NETLINK_NL_AUTO_H_
+#define NETLINK_NL_AUTO_H_
+
+#define _nl_auto(fcn) __attribute__ ((__cleanup__(fcn)))
+
+#define _NL_AUTO_DEFINE_FCN_VOID0(CastType, name, func) \
+static inline void name(void *v) \
+{ \
+ if (*((CastType *) v)) \
+ func(*((CastType *) v)); \
+}
+
+#define _NL_AUTO_DEFINE_FCN_TYPED0(CastType, name, func) \
+static inline void name(CastType *v) \
+{ \
+ if (*v) \
+ func(*v); \
+}
+
+#define _nl_auto_free _nl_auto(_nl_auto_free_fcn)
+_NL_AUTO_DEFINE_FCN_VOID0(void *, _nl_auto_free_fcn, free)
+
+struct nl_addr;
+void nl_addr_put(struct nl_addr *);
+#define _nl_auto_nl_addr _nl_auto(_nl_auto_nl_addr_fcn)
+_NL_AUTO_DEFINE_FCN_TYPED0(struct nl_addr *, _nl_auto_nl_addr_fcn, nl_addr_put)
+
+struct nl_msg;
+void nlmsg_free(struct nl_msg *);
+#define _nl_auto_nl_msg _nl_auto(_nl_auto_nl_msg_fcn)
+_NL_AUTO_DEFINE_FCN_TYPED0(struct nl_msg *, _nl_auto_nl_msg_fcn, nlmsg_free)
+
+struct rtnl_link;
+void rtnl_link_put(struct rtnl_link *);
+#define _nl_auto_rtnl_link _nl_auto(_nl_auto_rtnl_link_fcn)
+_NL_AUTO_DEFINE_FCN_TYPED0(struct rtnl_link *, _nl_auto_rtnl_link_fcn, rtnl_link_put)
+
+struct rtnl_route;
+void rtnl_route_put(struct rtnl_route *);
+#define _nl_auto_rtnl_route _nl_auto(_nl_auto_rtnl_route_fcn)
+_NL_AUTO_DEFINE_FCN_TYPED0(struct rtnl_route *, _nl_auto_rtnl_route_fcn, rtnl_route_put)
+
+struct rtnl_nexthop;
+void rtnl_route_nh_free(struct rtnl_nexthop *);
+#define _nl_auto_rtnl_nexthop _nl_auto(_nl_auto_rtnl_nexthop_fcn)
+_NL_AUTO_DEFINE_FCN_TYPED0(struct rtnl_nexthop *, _nl_auto_rtnl_nexthop_fcn, rtnl_route_nh_free)
+
+struct nl_cache;
+void nl_cache_put(struct nl_cache *);
+#define _nl_auto_nl_cache _nl_auto(_nl_auto_nl_cache_fcn)
+_NL_AUTO_DEFINE_FCN_TYPED0(struct nl_cache *, _nl_auto_nl_cache_fcn, nl_cache_put)
+
+struct rtnl_link_af_ops;
+void rtnl_link_af_ops_put(struct rtnl_link_af_ops *);
+#define _nl_auto_rtnl_link_af_ops _nl_auto(_nl_auto_rtnl_link_af_ops_fcn)
+_NL_AUTO_DEFINE_FCN_TYPED0(struct rtnl_link_af_ops *, _nl_auto_rtnl_link_af_ops_fcn, rtnl_link_af_ops_put)
+
+#endif /* NETLINK_NL_AUTO_H_ */
diff --git a/include/netlink-private/utils.h b/include/netlink-private/utils.h
index 9c5a3d82..46e77451 100644
--- a/include/netlink-private/utils.h
+++ b/include/netlink-private/utils.h
@@ -85,18 +85,6 @@
/*****************************************************************************/
-#define _NL_AUTO_DEFINE_FCN_VOID0(CastType, name, func) \
-static inline void name (void *v) \
-{ \
- if (*((CastType *) v)) \
- func (*((CastType *) v)); \
-}
-
-#define _nl_auto_free _nl_auto(_nl_auto_free_fcn)
-_NL_AUTO_DEFINE_FCN_VOID0 (void *, _nl_auto_free_fcn, free)
-
-/*****************************************************************************/
-
extern const char *nl_strerror_l(int err);
/*****************************************************************************/
@@ -222,4 +210,6 @@ _nl_strncpy(char *dst, const char *src, size_t len)
return dst;
}
+#include "nl-auto.h"
+
#endif

View File

@ -0,0 +1,29 @@
From f9d0181ceb2fc7c54abf89eff4c6b57e8fe6dd97 Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Fri, 17 Apr 2020 16:31:10 +0200
Subject: [PATCH] lib: use proper int type for id attributes in
nl_object_identical()
Conflict:NA
Reference:https://github.com/thom311/libnl/commit/f9d0181ceb2fc7c54abf89eff4c6b57e8fe6dd97
---
lib/object.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/object.c b/lib/object.c
index d15cd152..07a21d22 100644
--- a/lib/object.c
+++ b/lib/object.c
@@ -314,8 +314,9 @@ int nl_object_identical(struct nl_object *a, struct nl_object *b)
return 0;
if (ops->oo_id_attrs_get) {
- int req_attrs_a = ops->oo_id_attrs_get(a);
- int req_attrs_b = ops->oo_id_attrs_get(b);
+ uint32_t req_attrs_a = ops->oo_id_attrs_get(a);
+ uint32_t req_attrs_b = ops->oo_id_attrs_get(b);
+
if (req_attrs_a != req_attrs_b)
return 0;
req_attrs = req_attrs_a;

View File

@ -0,0 +1,30 @@
From 01ea9a6224b77292e8506bf179729aeeaac30398 Mon Sep 17 00:00:00 2001
From: Jan Slomski <jan.slomski@westermo.se>
Date: Wed, 21 Mar 2018 10:23:57 +0100
Subject: [PATCH] route/link: Check for null pointer in macvlan
In cases where link->l_info is not set, a null-ptr-exception
will be invoked.
https://github.com/thom311/libnl/pull/238
Conflict:NA
Reference:https://github.com/thom311/libnl/commit/01ea9a6224b77292e8506bf179729aeeaac30398
Reference:https://github.com/thom311/libnl/commit/9cc38dcaeb55b5729c6c97b47884cebbda72b693
---
lib/route/link/macvlan.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/route/link/macvlan.c b/lib/route/link/macvlan.c
index a23fe6d8..3ccebf45 100644
--- a/lib/route/link/macvlan.c
+++ b/lib/route/link/macvlan.c
@@ -149,6 +149,8 @@ static void macvlan_free(struct rtnl_link *link)
uint32_t i;
mvi = link->l_info;
+ if (!mvi)
+ return;
for (i = 0; i < mvi->mvi_maccount; i++)
nl_addr_put(mvi->mvi_macaddr[i]);

View File

@ -0,0 +1,66 @@
From bab9e77c87d3b596e77d669b0a827b50e725bb62 Mon Sep 17 00:00:00 2001
From: Ilya Pronin <ipronin@twitter.com>
Date: Fri, 3 Apr 2020 20:00:37 -0700
Subject: [PATCH] route/link: add RTNL_LINK_REASM_OVERLAPS stat
The new stat exposes IPSTATS_MIB_REASM_OVERLAPS link stat. However, the
original motivation for this change was fixing the issue with missing RX
packets link stat.
The regression was introduced in version 3.5.0 with commit 73c1d047,
that added a new enum constant IPSTATS_MIB_REASM_OVERLAPS. Without this
patch, IPSTATS_MIB_REASM_OVERLAPS is missing from
map_stat_id_from_IPSTATS_MIB_v2 and is mapped by it to 0. This tricks
inet6_parse_protinfo() into erroneously overwriting RTNL_LINK_RX_PACKETS
stat, which happens to have value 0, when it tries to set
IPSTATS_MIB_REASM_OVERLAPS.
Fixes: 73c1d0479643 ('Sync linux headers to 4.19.66')
https://github.com/thom311/libnl/pull/235
Conflict:NA
Reference:https://github.com/thom311/libnl/commit/bab9e77c87d3b596e77d669b0a827b50e725bb62
---
include/netlink/route/link.h | 1 +
lib/route/link.c | 1 +
lib/route/link/inet6.c | 1 +
3 files changed, 3 insertions(+)
diff --git a/include/netlink/route/link.h b/include/netlink/route/link.h
index 516d8e16..d0d6d2b5 100644
--- a/include/netlink/route/link.h
+++ b/include/netlink/route/link.h
@@ -93,6 +93,7 @@ typedef enum {
RTNL_LINK_IP6_ECT0PKTS, /*!< IPv6 SNMP InECT0Pkts */
RTNL_LINK_IP6_CEPKTS, /*!< IPv6 SNMP InCEPkts */
RTNL_LINK_RX_NOHANDLER, /*!< Received packets dropped on inactive device */
+ RTNL_LINK_REASM_OVERLAPS, /*!< SNMP ReasmOverlaps */
__RTNL_LINK_STATS_MAX,
} rtnl_link_stat_id_t;
diff --git a/lib/route/link.c b/lib/route/link.c
index 9439fe6d..ed6f4558 100644
--- a/lib/route/link.c
+++ b/lib/route/link.c
@@ -3007,6 +3007,7 @@ static const struct trans_tbl link_stats[] = {
__ADD(RTNL_LINK_IP6_ECT0PKTS, Ip6_InECT0Pkts),
__ADD(RTNL_LINK_IP6_CEPKTS, Ip6_InCEPkts),
__ADD(RTNL_LINK_RX_NOHANDLER, rx_nohandler),
+ __ADD(RTNL_LINK_REASM_OVERLAPS, ReasmOverlaps),
};
char *rtnl_link_stat2str(int st, char *buf, size_t len)
diff --git a/lib/route/link/inet6.c b/lib/route/link/inet6.c
index c977b617..1ad49bf1 100644
--- a/lib/route/link/inet6.c
+++ b/lib/route/link/inet6.c
@@ -135,6 +135,7 @@ static const uint8_t map_stat_id_from_IPSTATS_MIB_v2[__IPSTATS_MIB_MAX] = {
[33] = RTNL_LINK_IP6_ECT1PKTS, /* IPSTATS_MIB_ECT1PKTS */
[34] = RTNL_LINK_IP6_ECT0PKTS, /* IPSTATS_MIB_ECT0PKTS */
[35] = RTNL_LINK_IP6_CEPKTS, /* IPSTATS_MIB_CEPKTS */
+ [36] = RTNL_LINK_REASM_OVERLAPS, /* IPSTATS_MIB_REASM_OVERLAPS */
};
static int inet6_parse_protinfo(struct rtnl_link *link, struct nlattr *attr,

View File

@ -0,0 +1,25 @@
From 2957d8f6c8bf1189545a7b0c1a49c4ccb26984a1 Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Wed, 15 Apr 2020 14:01:09 +0200
Subject: [PATCH] rtnl/link: fix leaking rtnl_link_af_ops in link_msg_parser()
Conflict:NA
Reference:https://github.com/thom311/libnl/commit/2957d8f6c8bf1189545a7b0c1a49c4ccb26984a1
---
lib/route/link.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/route/link.c b/lib/route/link.c
index 0ce4b0ab..b73a8c5f 100644
--- a/lib/route/link.c
+++ b/lib/route/link.c
@@ -722,6 +722,8 @@ static int link_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who,
int remaining;
nla_for_each_nested(af_attr, tb[IFLA_AF_SPEC], remaining) {
+ _nl_auto_rtnl_link_af_ops struct rtnl_link_af_ops *af_ops = NULL;
+
af_ops = af_lookup_and_alloc(link, nla_type(af_attr));
if (af_ops && af_ops->ao_parse_af) {
char *af_data = link->l_af_data[nla_type(af_attr)];

View File

@ -0,0 +1,40 @@
From fca338b9f453295037f96e8fe9236ebb4763dd25 Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Wed, 15 Apr 2020 13:17:40 +0200
Subject: [PATCH] rtnl/route: fix NLE_NOMEM handling in parse_multipath()
Conflict:NA
Reference:https://github.com/thom311/libnl/commit/fca338b9f453295037f96e8fe9236ebb4763dd25
---
lib/route/route_obj.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/lib/route/route_obj.c b/lib/route/route_obj.c
index b5cc4ed4..de56a76b 100644
--- a/lib/route/route_obj.c
+++ b/lib/route/route_obj.c
@@ -1072,8 +1072,10 @@ static int parse_multipath(struct rtnl_route *route, struct nlattr *attr)
addr = nl_addr_alloc_attr(ntb[RTA_NEWDST],
route->rt_family);
- if (!addr)
+ if (!addr) {
+ err = -NLE_NOMEM;
goto errout;
+ }
err = rtnl_route_nh_set_newdst(nh, addr);
nl_addr_put(addr);
@@ -1085,8 +1087,10 @@ static int parse_multipath(struct rtnl_route *route, struct nlattr *attr)
struct nl_addr *addr;
addr = rtnl_route_parse_via(ntb[RTA_VIA]);
- if (!addr)
+ if (!addr) {
+ err = -NLE_NOMEM;
goto errout;
+ }
err = rtnl_route_nh_set_via(nh, addr);
nl_addr_put(addr);

Binary file not shown.

BIN
libnl-3.5.0.tar.gz Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,30 +0,0 @@
From a31948b905ac20e1d85cda56fb3672b44d66305e Mon Sep 17 00:00:00 2001
From: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
Date: Fri, 8 Jun 2018 15:43:53 +1200
Subject: [PATCH 55/76] ipgre: Fix wrong array size initialization
IPv4 GRE tunnels use the GRE defines.
Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
Fixes: 57bdc4ff4895dd91cc723d22eecadcf48945e87c
---
lib/route/link/ipgre.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/route/link/ipgre.c b/lib/route/link/ipgre.c
index 6551323..a7665fe 100644
--- a/lib/route/link/ipgre.c
+++ b/lib/route/link/ipgre.c
@@ -91,7 +91,7 @@ static int ipgre_alloc(struct rtnl_link *link)
static int ipgre_parse(struct rtnl_link *link, struct nlattr *data,
struct nlattr *xstats)
{
- struct nlattr *tb[IFLA_IPTUN_MAX + 1];
+ struct nlattr *tb[IFLA_GRE_MAX + 1];
struct ipgre_info *ipgre;
int err;
--
1.8.3.1

View File

@ -1,46 +0,0 @@
From daa2edebe71d794284142696397bfce6fd45f926 Mon Sep 17 00:00:00 2001
From: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
Date: Fri, 8 Jun 2018 15:45:42 +1200
Subject: [PATCH 56/76] ipvti: Fix wrong array size initialization
IPv4 VTI tunnels use the VTI defines.
Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
Fixes: 8f6301426a00d992d00238c7ddd666e96aa63e28
---
lib/route/link/ipvti.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/route/link/ipvti.c b/lib/route/link/ipvti.c
index 0fa80ea..851d566 100644
--- a/lib/route/link/ipvti.c
+++ b/lib/route/link/ipvti.c
@@ -48,7 +48,7 @@ struct ipvti_info
uint32_t ipvti_mask;
};
-static struct nla_policy ipvti_policy[IFLA_GRE_MAX + 1] = {
+static struct nla_policy ipvti_policy[IFLA_VTI_MAX + 1] = {
[IFLA_VTI_LINK] = { .type = NLA_U32 },
[IFLA_VTI_IKEY] = { .type = NLA_U32 },
[IFLA_VTI_OKEY] = { .type = NLA_U32 },
@@ -76,13 +76,13 @@ static int ipvti_alloc(struct rtnl_link *link)
static int ipvti_parse(struct rtnl_link *link, struct nlattr *data,
struct nlattr *xstats)
{
- struct nlattr *tb[IFLA_IPTUN_MAX + 1];
+ struct nlattr *tb[IFLA_VTI_MAX + 1];
struct ipvti_info *ipvti;
int err;
NL_DBG(3, "Parsing IPVTI link info\n");
- err = nla_parse_nested(tb, IFLA_GRE_MAX, data, ipvti_policy);
+ err = nla_parse_nested(tb, IFLA_VTI_MAX, data, ipvti_policy);
if (err < 0)
goto errout;
--
1.8.3.1

View File

@ -1,48 +0,0 @@
From 52cd3c14ce42db53637f8f5dafaf0d5c24d724db Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Mon, 8 Oct 2018 13:41:25 +0200
Subject: [PATCH 62/76] lib/tc: ensure correct error code in
rtnl_tc_msg_build()
---
lib/route/tc.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/lib/route/tc.c b/lib/route/tc.c
index 62efd35..061e54e 100644
--- a/lib/route/tc.c
+++ b/lib/route/tc.c
@@ -202,14 +202,16 @@ int rtnl_tc_msg_build(struct rtnl_tc *tc, int type, int flags,
.tcm_handle = tc->tc_handle,
.tcm_parent = tc->tc_parent,
};
- int err = -NLE_MSGSIZE;
+ int err;
msg = nlmsg_alloc_simple(type, flags);
if (!msg)
return -NLE_NOMEM;
- if (nlmsg_append(msg, &tchdr, sizeof(tchdr), NLMSG_ALIGNTO) < 0)
+ if (nlmsg_append(msg, &tchdr, sizeof(tchdr), NLMSG_ALIGNTO) < 0) {
+ err = -NLE_MSGSIZE;
goto nla_put_failure;
+ }
if (tc->ce_mask & TCA_ATTR_KIND)
NLA_PUT_STRING(msg, TCA_KIND, tc->tc_kind);
@@ -220,8 +222,10 @@ int rtnl_tc_msg_build(struct rtnl_tc *tc, int type, int flags,
void *data = rtnl_tc_data(tc);
if (ops->to_msg_fill) {
- if (!(opts = nla_nest_start(msg, TCA_OPTIONS)))
+ if (!(opts = nla_nest_start(msg, TCA_OPTIONS))) {
+ err = -NLE_NOMEM;
goto nla_put_failure;
+ }
if ((err = ops->to_msg_fill(tc, data, msg)) < 0)
goto nla_put_failure;
--
1.8.3.1

View File

@ -1,55 +0,0 @@
From 1bffe3cc6739d95c1a42f12b417e98f9d6ee5e80 Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Wed, 10 Oct 2018 10:59:27 +0200
Subject: [PATCH] lib/tc: fix uninitalized err variable in rtnl_tc_msg_build()
Fixes: 52cd3c14ce42db53637f8f5dafaf0d5c24d724db
---
lib/route/tc.c | 10 +++++++-----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/lib/route/tc.c b/lib/route/tc.c
index 061e54e..694c48e 100644
--- a/lib/route/tc.c
+++ b/lib/route/tc.c
@@ -210,11 +210,11 @@
if (nlmsg_append(msg, &tchdr, sizeof(tchdr), NLMSG_ALIGNTO) < 0) {
err = -NLE_MSGSIZE;
- goto nla_put_failure;
+ goto out_err;
}
if (tc->ce_mask & TCA_ATTR_KIND)
- NLA_PUT_STRING(msg, TCA_KIND, tc->tc_kind);
+ NLA_PUT_STRING(msg, TCA_KIND, tc->tc_kind);
ops = rtnl_tc_get_ops(tc);
if (ops && (ops->to_msg_fill || ops->to_msg_fill_raw)) {
@@ -224,21 +224,23 @@
if (ops->to_msg_fill) {
if (!(opts = nla_nest_start(msg, TCA_OPTIONS))) {
err = -NLE_NOMEM;
- goto nla_put_failure;
+ goto out_err;
}
if ((err = ops->to_msg_fill(tc, data, msg)) < 0)
- goto nla_put_failure;
+ goto out_err;
nla_nest_end(msg, opts);
} else if ((err = ops->to_msg_fill_raw(tc, data, msg)) < 0)
- goto nla_put_failure;
+ goto out_err;
}
*result = msg;
return 0;
nla_put_failure:
+ err = -NLE_NOMEM;
+out_err:
nlmsg_free(msg);
return err;
}

View File

@ -1,98 +0,0 @@
From 470b98354627eb4ab9eeb67308bc2f2c746e83eb Mon Sep 17 00:00:00 2001
From: Wang Jian <jianjian.wang1@gmail.com>
Date: Sat, 29 Sep 2018 11:09:17 +0000
Subject: [PATCH 75/76] link: macvlan fixes
1. While parsing flags, it overrides mode.
2. Before, dump-line and dump-details are same leading that macvlan info will be shown twice while dumpping details.
So make dump-line show nothing.
3. Add some spaces to show dump-details more prettier.
Signed-off-by: Wang Jian <jianjian.wang1@gmail.com>
Fixes: c76393e2037d78eb60c32f95b26f5b1e5b9422a6
http://lists.infradead.org/pipermail/libnl/2018-August/002405.html
http://lists.infradead.org/pipermail/libnl/2018-September/002406.html
http://lists.infradead.org/pipermail/libnl/2018-September/002411.html
---
lib/route/link/macvlan.c | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/lib/route/link/macvlan.c b/lib/route/link/macvlan.c
index ac90d0b..dbcea44 100644
--- a/lib/route/link/macvlan.c
+++ b/lib/route/link/macvlan.c
@@ -108,7 +108,7 @@ static int macvlan_parse(struct rtnl_link *link, struct nlattr *data,
}
if (tb[IFLA_MACVLAN_FLAGS]) {
- mvi->mvi_mode = nla_get_u16(tb[IFLA_MACVLAN_FLAGS]);
+ mvi->mvi_flags = nla_get_u16(tb[IFLA_MACVLAN_FLAGS]);
mvi->mvi_mask |= MACVLAN_HAS_FLAGS;
}
@@ -158,7 +158,7 @@ static void macvlan_free(struct rtnl_link *link)
link->l_info = NULL;
}
-static void macvlan_dump(struct rtnl_link *link, struct nl_dump_params *p)
+static void macvlan_dump_details(struct rtnl_link *link, struct nl_dump_params *p)
{
char buf[64];
uint32_t i;
@@ -166,23 +166,26 @@ static void macvlan_dump(struct rtnl_link *link, struct nl_dump_params *p)
if (mvi->mvi_mask & MACVLAN_HAS_MODE) {
rtnl_link_macvlan_mode2str(mvi->mvi_mode, buf, sizeof(buf));
- nl_dump(p, "%s-mode %s", link->l_info_ops->io_name, buf);
+ nl_dump(p, " %s-mode %s", link->l_info_ops->io_name, buf);
}
if (mvi->mvi_mask & MACVLAN_HAS_FLAGS) {
rtnl_link_macvlan_flags2str(mvi->mvi_flags, buf, sizeof(buf));
- nl_dump(p, "%s-flags %s", link->l_info_ops->io_name, buf);
+ nl_dump(p, " %s-flags %s", link->l_info_ops->io_name, buf);
}
if (mvi->mvi_mask & MACVLAN_HAS_MACADDR) {
- nl_dump(p, "macvlan-count %u", (unsigned) mvi->mvi_maccount);
+ nl_dump(p, " macvlan-count %u", (unsigned) mvi->mvi_maccount);
+
+ if (mvi->mvi_maccount)
+ nl_dump(p, " macvlan-sourcemac");
for (i = 0; i < mvi->mvi_maccount; i++) {
- nl_dump(p, "macvlan-sourcemac %s",
- nl_addr2str(mvi->mvi_macaddr[i], buf,
+ nl_dump(p, " %s", nl_addr2str(mvi->mvi_macaddr[i], buf,
sizeof(buf)));
}
}
+ nl_dump(p, "\n");
}
static int macvlan_clone(struct rtnl_link *dst, struct rtnl_link *src)
@@ -258,8 +261,7 @@ static struct rtnl_link_info_ops macvlan_info_ops = {
.io_alloc = macvlan_alloc,
.io_parse = macvlan_parse,
.io_dump = {
- [NL_DUMP_LINE] = macvlan_dump,
- [NL_DUMP_DETAILS] = macvlan_dump,
+ [NL_DUMP_DETAILS] = macvlan_dump_details,
},
.io_clone = macvlan_clone,
.io_put_attrs = macvlan_put_attrs,
@@ -271,8 +273,7 @@ static struct rtnl_link_info_ops macvtap_info_ops = {
.io_alloc = macvlan_alloc,
.io_parse = macvlan_parse,
.io_dump = {
- [NL_DUMP_LINE] = macvlan_dump,
- [NL_DUMP_DETAILS] = macvlan_dump,
+ [NL_DUMP_DETAILS] = macvlan_dump_details,
},
.io_clone = macvlan_clone,
.io_put_attrs = macvlan_put_attrs,
--
1.8.3.1

View File

@ -1,27 +0,0 @@
From 250a7c9ae91a726dfe33174f5281505add5cdbaa Mon Sep 17 00:00:00 2001
From: Tobias Jungel <tobias.jungel@bisdn.de>
Date: Tue, 17 Apr 2018 13:49:23 +0200
Subject: [PATCH 49/76] nl-neigh-list: free allocated items
---
src/nl-neigh-list.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/nl-neigh-list.c b/src/nl-neigh-list.c
index ba4ade8..1581e17 100644
--- a/src/nl-neigh-list.c
+++ b/src/nl-neigh-list.c
@@ -87,5 +87,10 @@ int main(int argc, char *argv[])
nl_cache_dump_filter(neigh_cache, &params, OBJ_CAST(neigh));
+ rtnl_neigh_put(neigh);
+ nl_cache_put(neigh_cache);
+ nl_cache_put(link_cache);
+ nl_socket_free(sock);
+
return 0;
}
--
1.8.3.1

View File

@ -1,34 +0,0 @@
From 123dc07bcc3f402a500edf370d2000e171c91b34 Mon Sep 17 00:00:00 2001
From: Patrick Havelange <patrick.havelange@tessares.net>
Date: Fri, 27 Jul 2018 14:39:35 +0200
Subject: [PATCH 74/76] nla_ok: fix overrun in attribute iteration.
A detailed explanation is provided in the original Linux kernel commit that
fixes the bug: 1045b03e07d85f3545118510a587035536030c1c
Valgrind spotted the issue when the remaining was negative.
This bug was triggering application crashes.
Signed-off-by: Patrick Havelange <patrick.havelange@tessares.net>
https://github.com/thom311/libnl/pull/199
---
lib/attr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/attr.c b/lib/attr.c
index 0928630..1ddc007 100644
--- a/lib/attr.c
+++ b/lib/attr.c
@@ -147,7 +147,7 @@ int nla_len(const struct nlattr *nla)
*/
int nla_ok(const struct nlattr *nla, int remaining)
{
- return remaining >= sizeof(*nla) &&
+ return remaining >= (int) sizeof(*nla) &&
nla->nla_len >= sizeof(*nla) &&
nla->nla_len <= remaining;
}
--
1.8.3.1

View File

@ -1,75 +0,0 @@
From 1ac40683a879a602dbf8c42372677fb94f958a7d Mon Sep 17 00:00:00 2001
From: Ilya Pronin <ipronin@twitter.com>
Date: Thu, 23 Aug 2018 16:12:25 -0700
Subject: [PATCH 73/76] route/cls: fix potential memory leak
rtnl_act_append() cannot add more than TCA_ACT_MAX_PRIO actions to the
same list. Because of that rtnl_basic_add_action() and
rtnl_u32_add_action() should not increment the reference counter of the
given action until it is successfully added to the filter's list.
Signed-off-by: Ilya Pronin <ipronin@twitter.com>
Fixes: e5d9b828f6ec64fd77854578fbf1c33f214f3ac4
https://github.com/thom311/libnl/pull/201
---
lib/route/cls/basic.c | 6 +++++-
lib/route/cls/u32.c | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/lib/route/cls/basic.c b/lib/route/cls/basic.c
index 912ded6..3581c60 100644
--- a/lib/route/cls/basic.c
+++ b/lib/route/cls/basic.c
@@ -220,6 +220,7 @@ struct rtnl_ematch_tree *rtnl_basic_get_ematch(struct rtnl_cls *cls)
int rtnl_basic_add_action(struct rtnl_cls *cls, struct rtnl_act *act)
{
struct rtnl_basic *b;
+ int err;
if (!act)
return 0;
@@ -228,9 +229,12 @@ int rtnl_basic_add_action(struct rtnl_cls *cls, struct rtnl_act *act)
return -NLE_NOMEM;
b->b_mask |= BASIC_ATTR_ACTION;
+ if ((err = rtnl_act_append(&b->b_act, act)))
+ return err;
+
/* In case user frees it */
rtnl_act_get(act);
- return rtnl_act_append(&b->b_act, act);
+ return 0;
}
struct rtnl_act* rtnl_basic_get_action(struct rtnl_cls *cls)
diff --git a/lib/route/cls/u32.c b/lib/route/cls/u32.c
index 0078888..f06bc24 100644
--- a/lib/route/cls/u32.c
+++ b/lib/route/cls/u32.c
@@ -526,6 +526,7 @@ int rtnl_u32_set_cls_terminal(struct rtnl_cls *cls)
int rtnl_u32_add_action(struct rtnl_cls *cls, struct rtnl_act *act)
{
struct rtnl_u32 *u;
+ int err;
if (!act)
return 0;
@@ -534,9 +535,12 @@ int rtnl_u32_add_action(struct rtnl_cls *cls, struct rtnl_act *act)
return -NLE_NOMEM;
u->cu_mask |= U32_ATTR_ACTION;
+ if ((err = rtnl_act_append(&u->cu_act, act)))
+ return err;
+
/* In case user frees it */
rtnl_act_get(act);
- return rtnl_act_append(&u->cu_act, act);
+ return 0;
}
struct rtnl_act* rtnl_u32_get_action(struct rtnl_cls *cls)
--
1.8.3.1

View File

@ -1,121 +0,0 @@
From 1228a65963956300bd0466437530b975e0eaeec5 Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Mon, 6 Nov 2017 15:04:14 +0100
Subject: [PATCH 08/76] route: fix handling old_nh in rtnl_route_parse() and
avoid leak
The previous code would miss to release old_nh in the error
path.
Also, it relied on the present netlink attributes to have old_nh
initialized. Don't do that.
Also, fixup error codes by using "goto errout_nomem" where appropriate
and keep @err as returned from rtnl_route_set_metric().
---
lib/route/route_obj.c | 28 ++++++++++++++++++++--------
1 file changed, 20 insertions(+), 8 deletions(-)
diff --git a/lib/route/route_obj.c b/lib/route/route_obj.c
index 8ae6b89..bc62408 100644
--- a/lib/route/route_obj.c
+++ b/lib/route/route_obj.c
@@ -1125,10 +1125,8 @@ int rtnl_route_parse(struct nlmsghdr *nlh, struct rtnl_route **result)
int err, family;
route = rtnl_route_alloc();
- if (!route) {
- err = -NLE_NOMEM;
- goto errout;
- }
+ if (!route)
+ goto errout_nomem;
route->ce_msgtype = nlh->nlmsg_type;
@@ -1213,7 +1211,9 @@ int rtnl_route_parse(struct nlmsghdr *nlh, struct rtnl_route **result)
for (i = 1; i <= RTAX_MAX; i++) {
if (mtb[i] && nla_len(mtb[i]) >= sizeof(uint32_t)) {
uint32_t m = nla_get_u32(mtb[i]);
- if (rtnl_route_set_metric(route, i, m) < 0)
+
+ err = rtnl_route_set_metric(route, i, m);
+ if (err < 0)
goto errout;
}
}
@@ -1231,14 +1231,14 @@ int rtnl_route_parse(struct nlmsghdr *nlh, struct rtnl_route **result)
if (tb[RTA_OIF]) {
if (!old_nh && !(old_nh = rtnl_route_nh_alloc()))
- goto errout;
+ goto errout_nomem;
rtnl_route_nh_set_ifindex(old_nh, nla_get_u32(tb[RTA_OIF]));
}
if (tb[RTA_GATEWAY]) {
if (!old_nh && !(old_nh = rtnl_route_nh_alloc()))
- goto errout;
+ goto errout_nomem;
if (!(addr = nl_addr_alloc_attr(tb[RTA_GATEWAY], family)))
goto errout_nomem;
@@ -1249,7 +1249,7 @@ int rtnl_route_parse(struct nlmsghdr *nlh, struct rtnl_route **result)
if (tb[RTA_FLOW]) {
if (!old_nh && !(old_nh = rtnl_route_nh_alloc()))
- goto errout;
+ goto errout_nomem;
rtnl_route_nh_set_realms(old_nh, nla_get_u32(tb[RTA_FLOW]));
}
@@ -1257,6 +1257,9 @@ int rtnl_route_parse(struct nlmsghdr *nlh, struct rtnl_route **result)
if (tb[RTA_NEWDST]) {
struct nl_addr *addr;
+ if (!old_nh && !(old_nh = rtnl_route_nh_alloc()))
+ goto errout_nomem;
+
addr = nl_addr_alloc_attr(tb[RTA_NEWDST], route->rt_family);
if (!addr)
goto errout_nomem;
@@ -1271,6 +1274,9 @@ int rtnl_route_parse(struct nlmsghdr *nlh, struct rtnl_route **result)
int alen = nla_len(tb[RTA_VIA]) - offsetof(struct rtvia, rtvia_addr);
struct rtvia *via = nla_data(tb[RTA_VIA]);
+ if (!old_nh && !(old_nh = rtnl_route_nh_alloc()))
+ goto errout_nomem;
+
addr = nl_addr_build(via->rtvia_family, via->rtvia_addr, alen);
if (!addr)
goto errout_nomem;
@@ -1287,6 +1293,9 @@ int rtnl_route_parse(struct nlmsghdr *nlh, struct rtnl_route **result)
}
if (tb[RTA_ENCAP] && tb[RTA_ENCAP_TYPE]) {
+ if (!old_nh && !(old_nh = rtnl_route_nh_alloc()))
+ goto errout_nomem;
+
err = nh_encap_parse_msg(tb[RTA_ENCAP],
tb[RTA_ENCAP_TYPE], old_nh);
if (err)
@@ -1319,12 +1328,15 @@ int rtnl_route_parse(struct nlmsghdr *nlh, struct rtnl_route **result)
rtnl_route_nh_free(old_nh);
}
+ old_nh = NULL;
}
*result = route;
return 0;
errout:
+ if (old_nh)
+ rtnl_route_nh_free(old_nh);
rtnl_route_put(route);
return err;
--
1.8.3.1

View File

@ -1,45 +0,0 @@
From 4e2f5dfa6484a90d8c01f5d5f9c46dddab8d86e9 Mon Sep 17 00:00:00 2001
From: Tuetuopay <tuetuopay@me.com>
Date: Mon, 9 Apr 2018 16:21:41 +0200
Subject: [PATCH 41/76] route/link: fix sequence number handling in
rtnl_link_change()
When rtnl_link_change() fails with -NLE_OPNOTSUPP, it retries
with RTM_SETLINK operation. However, it also needs to re-adjust
the sequence number. Otherwise, the second request might fail
with NLE_SEQ_MISMATCH, although it actually succeeded.
[thaller@redhat.com: changed commit message]
https://github.com/thom311/libnl/issues/179
https://github.com/thom311/libnl/pull/184
---
lib/route/link.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lib/route/link.c b/lib/route/link.c
index de3c393..40165e5 100644
--- a/lib/route/link.c
+++ b/lib/route/link.c
@@ -1772,6 +1772,10 @@ errout:
* @note The link name can only be changed if the link has been put
* in opertional down state. (~IF_UP)
*
+ * @note On versions up to 3.4.0, \c NLE_SEQ_MISMATCH would be returned if the
+ * kernel does not supports \c RTM_NEWLINK. It is advised to ignore the
+ * error code if you cannot upgrade the library.
+ *
* @return 0 on success or a negative error code.
*/
int rtnl_link_change(struct nl_sock *sk, struct rtnl_link *orig,
@@ -1792,6 +1796,7 @@ retry:
err = wait_for_ack(sk);
if (err == -NLE_OPNOTSUPP && msg->nm_nlh->nlmsg_type == RTM_NEWLINK) {
msg->nm_nlh->nlmsg_type = RTM_SETLINK;
+ msg->nm_nlh->nlmsg_seq = NL_AUTO_SEQ;
goto retry;
}
--
1.8.3.1

View File

@ -1,32 +0,0 @@
From cd5f6f842905b83d8c49f3eacb17273997036552 Mon Sep 17 00:00:00 2001
From: Tuetuopay <tuetuopay@me.com>
Date: Tue, 15 May 2018 14:11:20 +0200
Subject: [PATCH 53/76] route/link/vxlan: Fix IPv4 set_local resetting ce_mask
rtnl_link_vxlan_set_local() removes the bit for the other IP version in
ce_mask. A missing flag inversion in the v4 part made this removal
reset all bits to 0 except the v6 one, screwing all link configuration.
Fixes: 2e68fb5b02304fa6a3e6429c4fdabb084e61b501
https://github.com/thom311/libnl/pull/192
---
lib/route/link/vxlan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/route/link/vxlan.c b/lib/route/link/vxlan.c
index 9e578ec..686ac31 100644
--- a/lib/route/link/vxlan.c
+++ b/lib/route/link/vxlan.c
@@ -889,7 +889,7 @@ int rtnl_link_vxlan_set_local(struct rtnl_link *link, struct nl_addr *addr)
memcpy(&vxi->vxi_local, nl_addr_get_binary_addr(addr),
sizeof(vxi->vxi_local));
vxi->ce_mask |= VXLAN_ATTR_LOCAL;
- vxi->ce_mask &= VXLAN_ATTR_LOCAL6;
+ vxi->ce_mask &= ~VXLAN_ATTR_LOCAL6;
} else if ((nl_addr_get_family(addr) == AF_INET6) &&
(nl_addr_get_len(addr) == sizeof(vxi->vxi_local6))) {
memcpy(&vxi->vxi_local6, nl_addr_get_binary_addr(addr),
--
1.8.3.1

View File

@ -1,48 +0,0 @@
From be550df10993c89e9367a860d5060c632ed9afbf Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Mon, 23 Oct 2017 10:54:10 +0200
Subject: [PATCH 07/76] route/vlan: add capability to indicate heap overflow
fix in rtnl_link_vlan_set_egress_map()
Without this fix/capablity, adding more then 4 mappings in
rtnl_link_vlan_set_egress_map() overflows the heap.
---
include/netlink/utils.h | 8 ++++++++
lib/utils.c | 2 +-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/include/netlink/utils.h b/include/netlink/utils.h
index 10e76ce..dc22c9d 100644
--- a/include/netlink/utils.h
+++ b/include/netlink/utils.h
@@ -286,6 +286,14 @@ enum {
NL_CAPABILITY_VERSION_3_4_0 = 28,
#define NL_CAPABILITY_VERSION_3_4_0 NL_CAPABILITY_VERSION_3_4_0
+ /**
+ * Fixed memory corruption in rtnl_link_vlan_set_egress_map(). Previously, if you tried
+ * to add more then 4 mappings, a buffer overflow occured. Also fixed nl_object_clone()
+ * for VLAN links.
+ */
+ NL_CAPABILITY_ROUTE_FIX_VLAN_SET_EGRESS_MAP = 29,
+#define NL_CAPABILITY_ROUTE_FIX_VLAN_SET_EGRESS_MAP NL_CAPABILITY_ROUTE_FIX_VLAN_SET_EGRESS_MAP
+
__NL_CAPABILITY_MAX,
NL_CAPABILITY_MAX = (__NL_CAPABILITY_MAX - 1),
#define NL_CAPABILITY_MAX NL_CAPABILITY_MAX
diff --git a/lib/utils.c b/lib/utils.c
index 544feda..eefe802 100644
--- a/lib/utils.c
+++ b/lib/utils.c
@@ -1221,7 +1221,7 @@ int nl_has_capability (int capability)
NL_CAPABILITY_XFRM_SP_SEC_CTX_LEN,
NL_CAPABILITY_VERSION_3_3_0,
NL_CAPABILITY_VERSION_3_4_0,
- 0,
+ NL_CAPABILITY_ROUTE_FIX_VLAN_SET_EGRESS_MAP,
0,
0,
0),
--
1.8.3.1

View File

@ -1,58 +0,0 @@
From f9d68741065182f4c75a17426246f12a4aeb3c56 Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Mon, 23 Oct 2017 11:35:32 +0200
Subject: [PATCH 05/76] route/vlan: fix cloning vlan link in vlan_clone()
We need to copy the entire source struct over
from source to destination.
The only thing that needs special handling is
to deep-clone the vi_egress_qos buffer.
Fixes: a7469ce758fac3631df6ce72eb3f89150070e7f8
---
lib/route/link/vlan.c | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/lib/route/link/vlan.c b/lib/route/link/vlan.c
index 477c9af..23fdf66 100644
--- a/lib/route/link/vlan.c
+++ b/lib/route/link/vlan.c
@@ -264,19 +264,28 @@ static int vlan_clone(struct rtnl_link *dst, struct rtnl_link *src)
{
struct vlan_info *vdst, *vsrc = src->l_info;
int err;
+ struct vlan_map *p = NULL;
dst->l_info = NULL;
if ((err = rtnl_link_set_type(dst, "vlan")) < 0)
return err;
vdst = dst->l_info;
- vdst->vi_egress_qos = calloc(vsrc->vi_egress_size,
- sizeof(struct vlan_map));
- if (!vdst->vi_egress_qos)
- return -NLE_NOMEM;
+ if (vsrc->vi_negress) {
+ p = calloc(vsrc->vi_negress,
+ sizeof(struct vlan_map));
+ if (!p)
+ return -NLE_NOMEM;
+ }
- memcpy(vdst->vi_egress_qos, vsrc->vi_egress_qos,
- vsrc->vi_egress_size * sizeof(struct vlan_map));
+ *vdst = *vsrc;
+
+ if (vsrc->vi_negress) {
+ vdst->vi_egress_size = vsrc->vi_negress;
+ vdst->vi_egress_qos = p;
+ memcpy(vdst->vi_egress_qos, vsrc->vi_egress_qos,
+ vsrc->vi_negress * sizeof(struct vlan_map));
+ }
return 0;
}
--
1.8.3.1

View File

@ -1,35 +0,0 @@
From 6dfb40acd9b0b421b587f26840dfc072211976c2 Mon Sep 17 00:00:00 2001
From: Sebastian Bixl <sebastianbixl@gmx.de>
Date: Sun, 15 Oct 2017 22:34:01 +0200
Subject: [PATCH 04/76] route/vlan: fix memory corruption in
rtnl_link_vlan_set_egress_map
If you set more than four entries for the vlan egress map a memory
corruption occurs because the reallocation does not reserve memory
for more than four.
Fixes: a7469ce758fac3631df6ce72eb3f89150070e7f8
https://github.com/thom311/libnl/pull/155
[thaller@redhat.com: squashed commits and updated commit message]
---
lib/route/link/vlan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/route/link/vlan.c b/lib/route/link/vlan.c
index 118d5a0..477c9af 100644
--- a/lib/route/link/vlan.c
+++ b/lib/route/link/vlan.c
@@ -589,7 +589,7 @@ int rtnl_link_vlan_set_egress_map(struct rtnl_link *link, uint32_t from, int to)
int new_size = vi->vi_egress_size + 32;
void *ptr;
- ptr = realloc(vi->vi_egress_qos, new_size);
+ ptr = realloc(vi->vi_egress_qos, new_size * sizeof(struct vlan_map));
if (!ptr)
return -NLE_NOMEM;
--
1.8.3.1

View File

@ -1,26 +0,0 @@
From c3db1c47828628413a65786efabe46cffa366c7c Mon Sep 17 00:00:00 2001
From: Jonas Johansson <jonasj76@gmail.com>
Date: Mon, 12 Mar 2018 13:51:36 +0100
Subject: [PATCH 28/76] route/vrf: initalize clone destination with NULL in
vrf_clone()
Signed-off-by: Jonas Johansson <jonasj76@gmail.com>
---
lib/route/link/vrf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/route/link/vrf.c b/lib/route/link/vrf.c
index 84d2d8b..8b6b451 100644
--- a/lib/route/link/vrf.c
+++ b/lib/route/link/vrf.c
@@ -107,6 +107,7 @@ static int vrf_clone(struct rtnl_link *dst, struct rtnl_link *src)
struct vrf_info *vdst, *vsrc = src->l_info;
int err;
+ dst->l_info = NULL;
if ((err = rtnl_link_set_type(dst, "vrf")) < 0)
return err;
vdst = dst->l_info;
--
1.8.3.1

View File

@ -1,31 +1,22 @@
%define ver 3_5_0
Name: libnl3
Version: 3.4.0
Release: 7
Version: 3.5.0
Release: 4
Summary: Providing APIs to netlink protocol based Linux kernel interfaces
License: LGPLv2
URL: http://www.infradead.org/~tgr/libnl/
Source: http://www.infradead.org/~tgr/libnl/files/libnl-%{version}.tar.gz
Source1: http://www.infradead.org/~tgr/libnl/files/libnl-doc-%{version}.tar.gz
Source: https://github.com/thom311/libnl/releases/download/libnl%{uver}/libnl-%{version}.tar.gz
Patch6000: backport-lib-add-include-netlink-private-nl-auto-h-header.patch
Patch6001: backport-lib-use-proper-int-type-for-id-attributes-in-nl_object_identical.patch
Patch6002: backport-route-link-add-RTNL_LINK_REASM_OVERLAPS-stat.patch
Patch6003: backport-route-link-Check-for-null-pointer-in-macvlan.patch
Patch6004: backport-rtnl-link-fix-leaking-rtnl_link_af_ops-in-link_msg_parser.patch
Patch6005: backport-rtnl-route-fix-NLE_NOMEM-handling-in-parse_multipath.patch
Patch9000: solve-redefinition-of-struct-ipv6_mreq.patch
Patch6001: libnl3-route-vlan-fix-memory-corruption-in-rtnl_link_vlan_s.patch
Patch6002: libnl3-route-vlan-fix-cloning-vlan-link-in-vlan_clone.patch
Patch6003: libnl3-route-vlan-add-capability-to-indicate-heap-overflow-.patch
Patch6004: libnl3-route-fix-handling-old_nh-in-rtnl_route_parse-and-av.patch
Patch6005: libnl3-route-vrf-initalize-clone-destination-with-NULL-in-v.patch
Patch6006: libnl3-route-link-fix-sequence-number-handling-in-rtnl_link.patch
Patch6007: libnl3-nl-neigh-list-free-allocated-items.patch
Patch6008: libnl3-route-link-vxlan-Fix-IPv4-set_local-resetting-ce_mas.patch
Patch6009: libnl3-ipgre-Fix-wrong-array-size-initialization.patch
Patch6010: libnl3-ipvti-Fix-wrong-array-size-initialization.patch
Patch6011: libnl3-lib-tc-ensure-correct-error-code-in-rtnl_tc_msg_buil.patch
Patch6012: libnl3-lib-tc-fix-uninitalized-err-variable-in-rtnl_tc_msg_.patch
Patch6013: libnl3-route-cls-fix-potential-memory-leak.patch
Patch6014: libnl3-nla_ok-fix-overrun-in-attribute-iteration.patch
Patch6015: libnl3-link-macvlan-fixes.patch
BuildRequires: flex bison libtool autoconf automake swig
Requires: %{name} = %{version}-%{release}
Requires: %{name} = %{version}-%{release} %{name}-help
Provides: %{name}-cli
Obsoletes: %{name}-cli
@ -43,7 +34,10 @@ This package provides various libraries and headers for using libnl3
%package help
Summary: Document for libnl3
Requires: %{name} = %{version}-%{release}
Requires: %{name} = %{version}-%{release}
Provides: %{name}-doc = %{version}-%{release}
Obsoletes: %{name}-doc < %{version}-%{release}
%description help
This package contains libnl3 related documentations
@ -66,8 +60,6 @@ Python2 bindings for libnl3
%prep
%autosetup -n libnl-%{version} -p1
tar -xzf %SOURCE1
%build
autoreconf -vif
%configure --disable-static
@ -95,8 +87,7 @@ cd python
%{__python2} setup.py check
%{__python3} setup.py check
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%ldconfig_scriptlets
%files
%doc COPYING
@ -111,13 +102,6 @@ cd python
%{_libdir}/pkgconfig/*.pc
%files help
%doc libnl-doc-%{version}/*.html
%doc libnl-doc-%{version}/*.css
%doc libnl-doc-%{version}/stylesheets/*
%doc libnl-doc-%{version}/images/*
%doc libnl-doc-%{version}/images/icons/*
%doc libnl-doc-%{version}/images/icons/callouts/*
%doc libnl-doc-%{version}/api/*
%{_mandir}/man8/*
%files -n python3-libnl3
@ -129,5 +113,35 @@ cd python
%{python2_sitearch}/netlink-*.egg-info
%changelog
* Wed Mar 10 2021 zengwefeng <zwfeng@huawei.com> - 3.5.0-4
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:add missing check for NULL return from allocate_rfd
add include netlink private nl-auto-h header
use proper int type for id attributes
add RTNL_LINK_REASM_OVERLAPS stat
check for null pointer in macvlan
fix leaking in link msg parser
fix NLE_NOMEM handling in parse multipath
* Thu Oct 29 2020 gaihuiying <gaihuiying1@huawei.com> - 3.5.0-3
- Type:requirement
- CVE:NA
- SUG:NA
- DESC:add libnl3-help dependency for libnl3
* Tue Aug 18 2020 chenyaqiang <chenyaqiang@huawei.com> - 3.5.0-2
- rebuild for package build
* Sun Jan 12 2020 openEuler Buildteam <buildteam@openeuler.org> - 3.5.0-1
- update software to 3.5.0
* Wed Dec 25 2019 openEuler Buildteam <buildteam@openeuler.org> - 3.4.0-8
- Type:bugfix
- Id:NA
- SUG:NA
- DESC:provides libnl3-doc
* Sat Sep 7 2019 liyongqiang<liyongqiang10@huawei.com> - 3.4.0-7
- Package init