From c903e6f15d4ec67dfb84fa32ee330ae81a41d931 Mon Sep 17 00:00:00 2001 From: tangce Date: Tue, 9 Sep 2025 11:43:59 +0000 Subject: [PATCH] adjust seq of ipvlan_mode enum (cherry picked from commit 6c9a6b50d6ef7e38a533d1b69fa8471e39831ed3) --- ...oute-add-support-for-ipvlan-l2e-mode.patch | 114 +++++++++--------- iproute.spec | 8 +- 2 files changed, 65 insertions(+), 57 deletions(-) diff --git a/feature-iproute-add-support-for-ipvlan-l2e-mode.patch b/feature-iproute-add-support-for-ipvlan-l2e-mode.patch index 479c1e3..eb40f26 100644 --- a/feature-iproute-add-support-for-ipvlan-l2e-mode.patch +++ b/feature-iproute-add-support-for-ipvlan-l2e-mode.patch @@ -1,56 +1,58 @@ -From 3ea7f5ac296ee5c19459c2bf00fecf98f552a1c5 Mon Sep 17 00:00:00 2001 -From: Feilong Lin -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 1d4ed60..bddbdc7 100644 ---- a/include/uapi/linux/if_link.h -+++ b/include/uapi/linux/if_link.h -@@ -702,6 +702,7 @@ enum { - enum ipvlan_mode { - IPVLAN_MODE_L2 = 0, - IPVLAN_MODE_L3, -+ IPVLAN_MODE_L2E, - IPVLAN_MODE_L3S, - IPVLAN_MODE_MAX - }; -diff --git a/ip/iplink_ipvlan.c b/ip/iplink_ipvlan.c -index baae767..6de3138 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 | l3s | l2\n" - "FLAGS: bridge | private | vepa\n" - "(first values are the defaults if nothing is specified).\n", - lu->id); -@@ -47,8 +47,10 @@ static int ipvlan_parse_opt(struct link_util *lu, int argc, char **argv, - 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\", \"l2e\", or \"l3s\"\n"); - return -1; - } - addattr16(n, 1024, IFLA_IPVLAN_MODE, mode); -@@ -88,6 +90,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_L2E ? "l2e" : - mode == IPVLAN_MODE_L3S ? "l3s" : "unknown"; - - print_string(PRINT_ANY, "mode", " mode %s ", mode_str); --- -2.19.1 - +From 55ef341ff815660b9c236fb75a8365b127fbb798 Mon Sep 17 00:00:00 2001 +From: tangce +Date: Tue, 9 Sep 2025 01:31:51 +0000 +Subject: [PATCH] feature-iproute-add-support-for-ipvlan-l2e-mode + +--- + include/uapi/linux/if_link.h | 1 + + ip/iplink_ipvlan.c | 7 +++++-- + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h +index c2ca7a6..f98bdae 100644 +--- a/include/uapi/linux/if_link.h ++++ b/include/uapi/linux/if_link.h +@@ -740,6 +740,7 @@ 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 f29fa4f..743acd7 100644 +--- a/ip/iplink_ipvlan.c ++++ b/ip/iplink_ipvlan.c +@@ -19,7 +19,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 | l3s | l2\n" + "FLAGS: bridge | private | vepa\n" + "(first values are the defaults if nothing is specified).\n", + lu->id); +@@ -43,8 +43,10 @@ static int ipvlan_parse_opt(struct link_util *lu, int argc, char **argv, + 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\", \"l2e\", or \"l3s\"\n"); + return -1; + } + addattr16(n, 1024, IFLA_IPVLAN_MODE, mode); +@@ -84,6 +86,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_L2E ? "l2e" : + mode == IPVLAN_MODE_L3S ? "l3s" : "unknown"; + + print_string(PRINT_ANY, "mode", " mode %s ", mode_str); +-- +2.33.0 + diff --git a/iproute.spec b/iproute.spec index c8af2a9..a778c59 100644 --- a/iproute.spec +++ b/iproute.spec @@ -2,7 +2,7 @@ Name: iproute Version: 6.6.0 Epoch: 1 -Release: 6 +Release: 7 Summary: Linux network configuration utilities License: GPLv2+ and Public Domain URL: https://kernel.org/pub/linux/utils/net/iproute2/ @@ -99,6 +99,12 @@ install -m 0644 lib/libnetlink.a %{buildroot}%{_libdir}/libnetlink.a %{_mandir}/* %changelog +* Tue Sep 09 2025 tangce - 1:6.6.0-7 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:adjust seq of ipvlan_mode enum + * Tue Jul 15 2025 gaihuiying - 1:6.6.0-6 - Type:bugfix - ID:NA -- Gitee