update to 5.5.0

This commit is contained in:
seuzw 2020-05-12 14:47:49 +08:00
parent ab45a75063
commit 866b787294
7 changed files with 292 additions and 2 deletions

View File

@ -0,0 +1,25 @@
From e2e13e8d97f88895af7a9ef5fd5c8e792e1ea7ea Mon Sep 17 00:00:00 2001
From: Li Shang <shangli1@huawei.com>
Date: Wed, 4 Mar 2020 15:27:47 +0800
---
ip/iproute.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/ip/iproute.c b/ip/iproute.c
index 32bb52d..12fcd7d 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -1497,9 +1497,6 @@ static int iproute_modify(int cmd, unsigned int flags, int argc, char **argv)
argc--; argv++;
}
- if (!dst_ok)
- usage();
-
if (d) {
int idx = ll_name_to_index(d);
--
2.19.1

View File

@ -0,0 +1,61 @@
From 3ea7f5ac296ee5c19459c2bf00fecf98f552a1c5 Mon Sep 17 00:00:00 2001
From: Feilong Lin <linfeilong@huawei.com>
Date: Mon, 2 Mar 2020 20:52:06 +0800
---
include/uapi/linux/if_link.h | 2 +-
ip/iplink_ipvlan.c | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index d36919f..e0556fb 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -494,7 +494,7 @@ enum {
enum ipvlan_mode {
IPVLAN_MODE_L2 = 0,
IPVLAN_MODE_L3,
- IPVLAN_MODE_L3S,
+ IPVLAN_MODE_L2E,
IPVLAN_MODE_MAX
};
diff --git a/ip/iplink_ipvlan.c b/ip/iplink_ipvlan.c
index baae767..4c9d8e2 100644
--- a/ip/iplink_ipvlan.c
+++ b/ip/iplink_ipvlan.c
@@ -23,7 +23,7 @@ static void print_explain(struct link_util *lu, FILE *f)
fprintf(f,
"Usage: ... %s [ mode MODE ] [ FLAGS ]\n"
"\n"
- "MODE: l3 | l3s | l2\n"
+ "MODE: l3 | l2e | l2\n"
"FLAGS: bridge | private | vepa\n"
"(first values are the defaults if nothing is specified).\n",
lu->id);
@@ -45,10 +45,10 @@ static int ipvlan_parse_opt(struct link_util *lu, int argc, char **argv,
mode = IPVLAN_MODE_L2;
else if (strcmp(*argv, "l3") == 0)
mode = IPVLAN_MODE_L3;
- else if (strcmp(*argv, "l3s") == 0)
- mode = IPVLAN_MODE_L3S;
+ else if (strcmp(*argv, "l2e") == 0)
+ mode = IPVLAN_MODE_L2E;
else {
- fprintf(stderr, "Error: argument of \"mode\" must be either \"l2\", \"l3\" or \"l3s\"\n");
+ fprintf(stderr, "Error: argument of \"mode\" must be either \"l2\", \"l3\" or \"l2e\"\n");
return -1;
}
addattr16(n, 1024, IFLA_IPVLAN_MODE, mode);
@@ -88,7 +88,7 @@ static void ipvlan_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
__u16 mode = rta_getattr_u16(tb[IFLA_IPVLAN_MODE]);
const char *mode_str = mode == IPVLAN_MODE_L2 ? "l2" :
mode == IPVLAN_MODE_L3 ? "l3" :
- mode == IPVLAN_MODE_L3S ? "l3s" : "unknown";
+ mode == IPVLAN_MODE_L2E ? "l2e" : "unknown";
print_string(PRINT_ANY, "mode", " mode %s ", mode_str);
}
--
2.19.1

View File

@ -0,0 +1,108 @@
From 1513e8162aee3202b99f26fa6c734766b5658db9 Mon Sep 17 00:00:00 2001
From: Ying Lv <lvying6@huawei.com>
Date: Mon, 2 Mar 2020 18:08:54 +0800
---
ip/ip_common.h | 2 ++
ip/ipaddress.c | 2 +-
ip/ipnetns.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 54 insertions(+), 1 deletion(-)
diff --git a/ip/ip_common.h b/ip/ip_common.h
index 879287e..6d10e53 100644
--- a/ip/ip_common.h
+++ b/ip/ip_common.h
@@ -90,6 +90,8 @@ int iplink_ifla_xstats(int argc, char **argv);
int ip_link_list(req_filter_fn_t filter_fn, struct nlmsg_chain *linfo);
void free_nlmsg_chain(struct nlmsg_chain *info);
+int store_nlmsg(struct nlmsghdr *n, void *arg);
+
static inline int rtm_get_table(struct rtmsg *r, struct rtattr **tb)
{
__u32 table = r->rtm_table;
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index bc8f5ba..cb38db3 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -1519,7 +1519,7 @@ static int print_selected_addrinfo(struct ifinfomsg *ifi,
}
-static int store_nlmsg(struct nlmsghdr *n, void *arg)
+int store_nlmsg(struct nlmsghdr *n, void *arg)
{
struct nlmsg_chain *lchain = (struct nlmsg_chain *)arg;
struct nlmsg_list *h;
diff --git a/ip/ipnetns.c b/ip/ipnetns.c
index fedc3db..e36ca51 100644
--- a/ip/ipnetns.c
+++ b/ip/ipnetns.c
@@ -754,6 +754,51 @@ static int netns_identify(int argc, char **argv)
return rc;
}
+static int check_netns_numbers(char *name) {
+ char net_path[MAXPATHLEN];
+ struct rtnl_handle rth = { .fd = -1 };
+ struct nlmsg_chain linfo = { NULL, NULL};
+ struct nlmsg_list *l;
+ int count = 0;
+ int netns;
+
+ snprintf(net_path, sizeof(net_path), "%s/%s", NETNS_RUN_DIR, name);
+ netns = open(net_path, O_RDONLY | O_CLOEXEC);
+ if (netns < 0) {
+ fprintf(stderr, "Cannot open network namespace \"%s\": %s\n",
+ name, strerror(errno));
+ exit(1);
+ }
+
+ if (setns(netns, CLONE_NEWNET) < 0) {
+ fprintf(stderr, "seting the network namespace \"%s\" failed: %s\n",
+ name, strerror(errno));
+ exit(1);
+ }
+
+ if (rtnl_open(&rth, 0) < 0)
+ exit(1);
+
+ if (rtnl_linkdump_req(&rth, AF_PACKET) < 0) {
+ fprintf(stderr, "Cannot send dump request");
+ exit(1);
+ }
+
+ if (rtnl_dump_filter(&rth, store_nlmsg, &linfo) < 0) {
+ fprintf(stderr, "Dump terminated\n");
+ exit(1);
+ }
+
+ for (l = linfo.head; l; l = l->next) {
+ count++;
+ }
+ free_nlmsg_chain(&linfo);
+
+ rtnl_close(&rth);
+ close(netns);
+ return count;
+}
+
static int on_netns_del(char *nsname, void *arg)
{
char netns_path[PATH_MAX];
@@ -775,6 +820,12 @@ static int netns_delete(int argc, char **argv)
return -1;
}
+ if (check_netns_numbers(argv[0]) > 1) {
+ fprintf(stderr, "Cannot delete network namespace, there are some NICs"
+ " in %s namespace\n", argv[0]);
+ return -1;
+ }
+
if (do_all)
return netns_foreach(on_netns_del, NULL);
--
2.19.1

View File

@ -0,0 +1,61 @@
From dff568963505f9f340a9da5151f1a022650e1498 Mon Sep 17 00:00:00 2001
From: wangli <wangli221@huawei.com>
Date: Tue, 3 Mar 2020 18:55:29 +0800
Subject: [PATCH] peer_notify_delay renamed to peer_notif_delay
---
ip/iplink_bond.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/ip/iplink_bond.c b/ip/iplink_bond.c
index 585b6be..fb62c95 100644
--- a/ip/iplink_bond.c
+++ b/ip/iplink_bond.c
@@ -120,7 +120,7 @@ static void print_explain(FILE *f)
"Usage: ... bond [ mode BONDMODE ] [ active_slave SLAVE_DEV ]\n"
" [ clear_active_slave ] [ miimon MIIMON ]\n"
" [ updelay UPDELAY ] [ downdelay DOWNDELAY ]\n"
- " [ peer_notify_delay DELAY ]\n"
+ " [ peer_notif_delay DELAY ]\n"
" [ use_carrier USE_CARRIER ]\n"
" [ arp_interval ARP_INTERVAL ]\n"
" [ arp_validate ARP_VALIDATE ]\n"
@@ -166,7 +166,7 @@ static int bond_parse_opt(struct link_util *lu, int argc, char **argv,
__u8 xmit_hash_policy, num_peer_notif, all_slaves_active;
__u8 lacp_rate, ad_select, tlb_dynamic_lb;
__u16 ad_user_port_key, ad_actor_sys_prio;
- __u32 miimon, updelay, downdelay, peer_notify_delay, arp_interval, arp_validate;
+ __u32 miimon, updelay, downdelay, peer_notif_delay, arp_interval, arp_validate;
__u32 arp_all_targets, resend_igmp, min_links, lp_interval;
__u32 packets_per_slave;
unsigned int ifindex;
@@ -201,11 +201,11 @@ static int bond_parse_opt(struct link_util *lu, int argc, char **argv,
if (get_u32(&downdelay, *argv, 0))
invarg("invalid downdelay", *argv);
addattr32(n, 1024, IFLA_BOND_DOWNDELAY, downdelay);
- } else if (matches(*argv, "peer_notify_delay") == 0) {
+ } else if (matches(*argv, "peer_notif_delay") == 0) {
NEXT_ARG();
- if (get_u32(&peer_notify_delay, *argv, 0))
- invarg("invalid peer_notify_delay", *argv);
- addattr32(n, 1024, IFLA_BOND_PEER_NOTIF_DELAY, peer_notify_delay);
+ if (get_u32(&peer_notif_delay, *argv, 0))
+ invarg("invalid peer_notif_delay", *argv);
+ addattr32(n, 1024, IFLA_BOND_PEER_NOTIF_DELAY, peer_notif_delay);
} else if (matches(*argv, "use_carrier") == 0) {
NEXT_ARG();
if (get_u8(&use_carrier, *argv, 0))
@@ -418,8 +418,8 @@ static void bond_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
if (tb[IFLA_BOND_PEER_NOTIF_DELAY])
print_uint(PRINT_ANY,
- "peer_notify_delay",
- "peer_notify_delay %u ",
+ "peer_notif_delay",
+ "peer_notif_delay %u ",
rta_getattr_u32(tb[IFLA_BOND_PEER_NOTIF_DELAY]));
if (tb[IFLA_BOND_USE_CARRIER])
--
2.19.1

View File

@ -1,6 +1,6 @@
Name: iproute
Version: 5.4.0
Release: 2
Version: 5.5.0
Release: 1
Summary: Linux network configuration utilities
License: GPLv2+ and Public Domain
URL: https://kernel.org/pub/linux/utils/net/iproute2/
@ -9,6 +9,11 @@ Source0: https://mirrors.edge.kernel.org/pub/linux/utils/net/iproute2/iproute2-%
Patch1: bugfix-iproute2-3.10.0-fix-maddr-show.patch
Patch2: bugfix-iproute2-change-proc-to-ipnetnsproc-which-is-private.patch
Patch9002: feature-iproute-limit-operation-ip-netns-del.patch
Patch9003: feature-iproute-add-support-for-ipvlan-l2e-mode.patch
Patch9004: feature-peer_notify_delay-renamed-to-peer_notif_delay.patch
Patch9005: bugfix-iproute-support-assume-default-route.patch
BuildRequires: gcc bison elfutils-libelf-devel flex iptables-devel libcap-devel
BuildRequires: libdb-devel libmnl-devel libselinux-devel pkgconfig git
@ -73,6 +78,36 @@ install -m 0644 lib/libnetlink.a %{buildroot}%{_libdir}/libnetlink.a
%{_mandir}/*
%changelog
* Fri Apr 17 2020 liaichun<liaichun@huawei.com> - 5.5.0-1
- Type:bugfix
- ID:NA
- SUG:restart
- DESC:update to 5.5.0-1
* Sat Mar 21 2020 liaichun<liaichun@huawei.com> - 5.4.0-6
- Type:bugfix
- ID:NA
- SUG:restart
- DESC:fix some err information
* Wed Mar 4 2020 liuzhikang<liuzhikang3@huawei.com> - 5.4.0-5
- Type:bugfix
- ID:NA
- SUG:restart
- DESC:update patch
* Wed Mar 4 2020 wangli <wangli221@huawei.com> - 5.4.0-4
- Type:bugfix
- ID:NA
- SUG:restart
- DESC:peer_notify_delay renamed to peer_notif_delay
* Mon Mar 2 2020 liuzhikang<liuzhikang3@huawei.com> - 5.4.0-3
- Type:bugfix
- ID:NA
- SUG:restart
- DESC: update patch
* Mon Jan 20 2020 openEuler Buildteam <buildteam@openeuler.org> - 5.4.0-2
- fix maddr show and change proc to ipnetnsproc

Binary file not shown.

BIN
iproute2-5.5.0.tar.xz Normal file

Binary file not shown.