Projects
openEuler:Mainline
iproute
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 9
View file
_service:tar_scm:iproute.spec
Changed
@@ -1,8 +1,8 @@ #needsrootforbuild Name: iproute -Version: 6.1.0 +Version: 6.4.0 Epoch: 1 -Release: 6 +Release: 1 Summary: Linux network configuration utilities License: GPLv2+ and Public Domain URL: https://kernel.org/pub/linux/utils/net/iproute2/ @@ -10,7 +10,6 @@ Patch1: bugfix-iproute2-3.10.0-fix-maddr-show.patch Patch2: bugfix-iproute2-change-proc-to-ipnetnsproc-which-is-private.patch -Patch3: backport-testsuite-fix-testsuite-build-failure-when-iproute-b.patch Patch9000: feature-iproute-add-support-for-ipvlan-l2e-mode.patch Patch9001: bugfix-iproute2-cancel-some-test-cases.patch @@ -89,6 +88,12 @@ %{_mandir}/* %changelog +* Thu Jul 20 2023 gaoxingwang <gaoxingwang1@huawei.com> - 1:6.4.0-1 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:update to 6.4.0 + * Sat Feb 25 2023 jiangheng <jiangheng14@huawei.com> - 1:6.1.0-6 - Type:bugfix - ID:NA
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_rr.c
Deleted
@@ -1,119 +0,0 @@ -/* - * q_rr.c RR. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * - * Authors: PJ Waskiewicz, <peter.p.waskiewicz.jr@intel.com> - * Original Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> (from PRIO) - */ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <arpa/inet.h> -#include <string.h> - -#include "utils.h" -#include "tc_util.h" - -static void explain(void) -{ - fprintf(stderr, "Usage: ... rr bands NUMBER priomap P1 P2... multiqueue\n"); -} - - -static int rr_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n, const char *dev) -{ - int pmap_mode = 0; - int idx = 0; - struct tc_prio_qopt opt = {3, { 1, 2, 2, 2, 1, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 } }; - struct rtattr *nest; - unsigned char mq = 0; - - while (argc > 0) { - if (strcmp(*argv, "bands") == 0) { - if (pmap_mode) - explain(); - NEXT_ARG(); - if (get_integer(&opt.bands, *argv, 10)) { - fprintf(stderr, "Illegal \"bands\"\n"); - return -1; - } - } else if (strcmp(*argv, "priomap") == 0) { - if (pmap_mode) { - fprintf(stderr, "Error: duplicate priomap\n"); - return -1; - } - pmap_mode = 1; - } else if (strcmp(*argv, "help") == 0) { - explain(); - return -1; - } else if (strcmp(*argv, "multiqueue") == 0) { - mq = 1; - } else { - unsigned int band; - - if (!pmap_mode) { - fprintf(stderr, "What is \"%s\"?\n", *argv); - explain(); - return -1; - } - if (get_unsigned(&band, *argv, 10)) { - fprintf(stderr, "Illegal \"priomap\" element\n"); - return -1; - } - if (band > opt.bands) { - fprintf(stderr, "\"priomap\" element is out of bands\n"); - return -1; - } - if (idx > TC_PRIO_MAX) { - fprintf(stderr, "\"priomap\" index > TC_RR_MAX=%u\n", TC_PRIO_MAX); - return -1; - } - opt.priomapidx++ = band; - } - argc--; argv++; - } - - nest = addattr_nest_compat(n, 1024, TCA_OPTIONS, &opt, sizeof(opt)); - if (mq) - addattr_l(n, 1024, TCA_PRIO_MQ, NULL, 0); - addattr_nest_compat_end(n, nest); - return 0; -} - -static int rr_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt) -{ - int i; - struct tc_prio_qopt *qopt; - struct rtattr *tbTCA_PRIO_MAX + 1; - - if (opt == NULL) - return 0; - - if (parse_rtattr_nested_compat(tb, TCA_PRIO_MAX, opt, qopt, - sizeof(*qopt))) - return -1; - - fprintf(f, "bands %u priomap ", qopt->bands); - for (i = 0; i <= TC_PRIO_MAX; i++) - fprintf(f, " %d", qopt->priomapi); - - if (tbTCA_PRIO_MQ) - fprintf(f, " multiqueue: %s ", - rta_getattr_u8(tbTCA_PRIO_MQ) ? "on" : "off"); - - return 0; -} - -struct qdisc_util rr_qdisc_util = { - .id = "rr", - .parse_qopt = rr_parse_opt, - .print_qopt = rr_print_opt, -};
View file
_service:tar_scm:iproute2-6.4.0.tar.xz/CREDITS
Added
@@ -0,0 +1,30 @@ + This is at least a partial credits file of people that have + contributed to iproute2 over its history. + It is sorted by name and formatted to allow easy grepping + and beautification by scripts. The fields are: name (N), + email (E), web-address (W) + +N: Werner Almesberger +E: werner@almesberger.net +W: https://www.almesberger.net/ +D: Wrote original classifiers, qdiscs, etc. + +N: Stephen Hemminger +E: stephen@networkplumber.org +D: Took over iproute2 starting with 2.6 kernel + +N: Alexey Kuznetsov +E: kuznet@ms2.inr.ac.ru +D: Original author of iproute2 + +N: YOSHIFUJI Hideaki/ 吉藤英明 +E: yoshfuji@linux-ipv6.org +D: USAGI project - Linux IPv6 Development + +N: David S. Miller +E: davem@davemloft.net +D: Developed the kernel networking and routing system + +N: Jamal Hadi Salam +D: Original developer of TC classifier and action +E: hadi@cyberus.ca
View file
_service:tar_scm:iproute2-6.4.0.tar.xz/MAINTAINERS
Added
@@ -0,0 +1,52 @@ +Iproute2 Maintainers +==================== + +The file provides a set of names that are are able to help +review patches and answer questions. This is in addition to +the netdev@vger.kernel.org mailing list used for all iproute2 +and kernel networking. + +Descriptions of section entries: + + M: Maintainer's Full Name <address@domain> + T: Git tree location. + F: Files and directories with wildcard patterns. + A trailing slash includes all files and subdirectory files. + A wildcard includes all files but not subdirectories. + One pattern per line. Multiple F: lines acceptable. + +Main Branch +M: Stephen Hemminger <stephen@networkplumber.org> +T: git://git.kernel.org/pub/scm/network/iproute2/iproute2.git +L: netdev@vger.kernel.org + +Next Tree +M: David Ahern <dsahern@gmail.com> +T: git://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git +L: netdev@vger.kernel.org + +Ethernet Bridging - bridge +M: Roopa Prabhu <roopa@nvidia.com> +M: Nikolay Aleksandrov <razor@blackwall.org> +L: bridge@lists.linux-foundation.org (moderated for non-subscribers) +F: bridge/* + +Data Center Bridging - dcb +M: Petr Machata <me@pmachata.org> +F: dcb/* + +devlink +M: Jiri Pirko <jiri@resnulli.us> +F: devlink/* + +Remote DMA - rdma +M: Leon Romanovsky <leon@kernel.org> +F: rdma/* + +Transparent Inter-Process Communication - tipc +M: Jon Maloy <jmaloy@redhat.com> +F: tipc/* + +virtual Datapath Acceleration - vdpa +M: Parav Pandit <parav@nvidia.com> +F: vdpa/*
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/README -> _service:tar_scm:iproute2-6.4.0.tar.xz/README
Changed
@@ -38,5 +38,5 @@ Stephen Hemminger stephen@networkplumber.org -Alexey Kuznetsov -kuznet@ms2.inr.ac.ru +David Ahern +dsahern@gmail.com
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/bash-completion/tc -> _service:tar_scm:iproute2-6.4.0.tar.xz/bash-completion/tc
Changed
@@ -3,7 +3,7 @@ # Copyright 2016 Quentin Monnet <quentin.monnet@6wind.com> QDISC_KIND=' choke codel bfifo pfifo pfifo_head_drop fq fq_codel gred hhf \ - mqprio multiq netem pfifo_fast pie fq_pie red rr sfb sfq tbf atm \ + mqprio multiq netem pfifo_fast pie fq_pie red sfb sfq tbf atm \ cbq drr dsmark hfsc htb prio qfq ' FILTER_KIND=' basic bpf cgroup flow flower fw route rsvp tcindex u32 matchall ' ACTION_KIND=' gact mirred bpf sample ' @@ -339,7 +339,7 @@ bandwidth ecn harddrop' return 0 ;; - rr|prio) + prio) _tc_once_attr 'bands priomap multiqueue' return 0 ;;
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/bridge/br_common.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/bridge/br_common.h
Changed
@@ -6,7 +6,6 @@ #define MDB_RTR_RTA(r) \ ((struct rtattr *)(((char *)(r)) + RTA_ALIGN(sizeof(__u32)))) -void print_vlan_info(struct rtattr *tb, int ifindex); int print_linkinfo(struct nlmsghdr *n, void *arg); int print_mdb_mon(struct nlmsghdr *n, void *arg); int print_fdb(struct nlmsghdr *n, void *arg); @@ -14,7 +13,7 @@ int parse_stp_state(const char *arg); int print_vlan_rtm(struct nlmsghdr *n, void *arg, bool monitor, bool global_only); -int print_vnifilter_rtm(struct nlmsghdr *n, void *arg, bool monitor); +int print_vnifilter_rtm(struct nlmsghdr *n, void *arg); void br_print_router_port_stats(struct rtattr *pattr); void print_headers(FILE *fp, const char *label);
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/bridge/fdb.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/bridge/fdb.c
Changed
@@ -93,7 +93,7 @@ return 0; } -static void fdb_print_flags(FILE *fp, unsigned int flags) +static void fdb_print_flags(FILE *fp, unsigned int flags, __u32 ext_flags) { open_json_array(PRINT_JSON, is_json_context() ? "flags" : ""); @@ -116,6 +116,9 @@ if (flags & NTF_STICKY) print_string(PRINT_ANY, NULL, "%s ", "sticky"); + if (ext_flags & NTF_EXT_LOCKED) + print_string(PRINT_ANY, NULL, "%s ", "locked"); + close_json_array(PRINT_JSON, NULL); } @@ -144,6 +147,7 @@ struct ndmsg *r = NLMSG_DATA(n); int len = n->nlmsg_len; struct rtattr *tbNDA_MAX+1; + __u32 ext_flags = 0; __u16 vid = 0; if (n->nlmsg_type != RTM_NEWNEIGH && n->nlmsg_type != RTM_DELNEIGH) { @@ -170,6 +174,9 @@ parse_rtattr(tb, NDA_MAX, NDA_RTA(r), n->nlmsg_len - NLMSG_LENGTH(sizeof(*r))); + if (tbNDA_FLAGS_EXT) + ext_flags = rta_getattr_u32(tbNDA_FLAGS_EXT); + if (tbNDA_VLAN) vid = rta_getattr_u16(tbNDA_VLAN); @@ -268,7 +275,7 @@ if (show_stats && tbNDA_CACHEINFO) fdb_print_stats(fp, RTA_DATA(tbNDA_CACHEINFO)); - fdb_print_flags(fp, r->ndm_flags); + fdb_print_flags(fp, r->ndm_flags, ext_flags); if (tbNDA_MASTER)
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/bridge/link.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/bridge/link.c
Changed
@@ -165,6 +165,14 @@ if (prtbIFLA_BRPORT_NEIGH_SUPPRESS) print_on_off(PRINT_ANY, "neigh_suppress", "neigh_suppress %s ", rta_getattr_u8(prtbIFLA_BRPORT_NEIGH_SUPPRESS)); + if (prtbIFLA_BRPORT_NEIGH_VLAN_SUPPRESS) { + struct rtattr *at; + + at = prtbIFLA_BRPORT_NEIGH_VLAN_SUPPRESS; + print_on_off(PRINT_ANY, "neigh_vlan_suppress", + "neigh_vlan_suppress %s ", + rta_getattr_u8(at)); + } if (prtbIFLA_BRPORT_VLAN_TUNNEL) print_on_off(PRINT_ANY, "vlan_tunnel", "vlan_tunnel %s ", rta_getattr_u8(prtbIFLA_BRPORT_VLAN_TUNNEL)); @@ -184,6 +192,21 @@ if (prtbIFLA_BRPORT_LOCKED) print_on_off(PRINT_ANY, "locked", "locked %s ", rta_getattr_u8(prtbIFLA_BRPORT_LOCKED)); + if (prtbIFLA_BRPORT_MAB) + print_on_off(PRINT_ANY, "mab", "mab %s ", + rta_getattr_u8(prtbIFLA_BRPORT_MAB)); + if (prtbIFLA_BRPORT_MCAST_N_GROUPS) { + struct rtattr *at = prtbIFLA_BRPORT_MCAST_N_GROUPS; + + print_uint(PRINT_ANY, "mcast_n_groups", + "mcast_n_groups %u ", rta_getattr_u32(at)); + } + if (prtbIFLA_BRPORT_MCAST_MAX_GROUPS) { + struct rtattr *at = prtbIFLA_BRPORT_MCAST_MAX_GROUPS; + + print_uint(PRINT_ANY, "mcast_max_groups", + "mcast_max_groups %u ", rta_getattr_u32(at)); + } } else print_stp_state(rta_getattr_u8(attr)); } @@ -279,10 +302,13 @@ " mcast_flood {on | off} \n" " bcast_flood {on | off} \n" " mcast_to_unicast {on | off} \n" + " mcast_max_groups MAX_GROUPS \n" " neigh_suppress {on | off} \n" + " neigh_vlan_suppress {on | off} \n" " vlan_tunnel {on | off} \n" " isolated {on | off} \n" " locked {on | off} \n" + " mab {on | off} \n" " hwmode {vepa | veb} \n" " backup_port DEVICE nobackup_port \n" " self master \n" @@ -305,6 +331,7 @@ char *d = NULL; int backup_port_idx = -1; __s8 neigh_suppress = -1; + __s8 neigh_vlan_suppress = -1; __s8 learning = -1; __s8 learning_sync = -1; __s8 flood = -1; @@ -313,7 +340,9 @@ __s8 mcast_flood = -1; __s8 bcast_flood = -1; __s8 mcast_to_unicast = -1; + __s32 max_groups = -1; __s8 locked = -1; + __s8 macauth = -1; __s8 isolated = -1; __s8 hairpin = -1; __s8 bpdu_guard = -1; @@ -384,6 +413,10 @@ mcast_to_unicast = parse_on_off("mcast_to_unicast", *argv, &ret); if (ret) return ret; + } else if (strcmp(*argv, "mcast_max_groups") == 0) { + NEXT_ARG(); + if (get_s32(&max_groups, *argv, 0)) + invarg("invalid mcast_max_groups", *argv); } else if (strcmp(*argv, "cost") == 0) { NEXT_ARG(); cost = atoi(*argv); @@ -424,6 +457,12 @@ neigh_suppress = parse_on_off("neigh_suppress", *argv, &ret); if (ret) return ret; + } else if (strcmp(*argv, "neigh_vlan_suppress") == 0) { + NEXT_ARG(); + neigh_vlan_suppress = parse_on_off("neigh_vlan_suppress", + *argv, &ret); + if (ret) + return ret; } else if (strcmp(*argv, "vlan_tunnel") == 0) { NEXT_ARG(); vlan_tunnel = parse_on_off("vlan_tunnel", *argv, &ret); @@ -439,6 +478,11 @@ locked = parse_on_off("locked", *argv, &ret); if (ret) return ret; + } else if (strcmp(*argv, "mab") == 0) { + NEXT_ARG(); + macauth = parse_on_off("mab", *argv, &ret); + if (ret) + return ret; } else if (strcmp(*argv, "backup_port") == 0) { NEXT_ARG(); backup_port_idx = ll_name_to_index(*argv); @@ -495,6 +539,9 @@ if (mcast_to_unicast >= 0) addattr8(&req.n, sizeof(req), IFLA_BRPORT_MCAST_TO_UCAST, mcast_to_unicast); + if (max_groups >= 0) + addattr32(&req.n, sizeof(req), IFLA_BRPORT_MCAST_MAX_GROUPS, + max_groups); if (learning >= 0) addattr8(&req.n, sizeof(req), IFLA_BRPORT_LEARNING, learning); if (learning_sync >= 0) @@ -513,6 +560,9 @@ if (neigh_suppress != -1) addattr8(&req.n, sizeof(req), IFLA_BRPORT_NEIGH_SUPPRESS, neigh_suppress); + if (neigh_vlan_suppress != -1) + addattr8(&req.n, sizeof(req), IFLA_BRPORT_NEIGH_VLAN_SUPPRESS, + neigh_vlan_suppress); if (vlan_tunnel != -1) addattr8(&req.n, sizeof(req), IFLA_BRPORT_VLAN_TUNNEL, vlan_tunnel); @@ -522,6 +572,9 @@ if (locked >= 0) addattr8(&req.n, sizeof(req), IFLA_BRPORT_LOCKED, locked); + if (macauth >= 0) + addattr8(&req.n, sizeof(req), IFLA_BRPORT_MAB, macauth); + if (backup_port_idx != -1) addattr32(&req.n, sizeof(req), IFLA_BRPORT_BACKUP_PORT, backup_port_idx);
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/bridge/mdb.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/bridge/mdb.c
Changed
@@ -14,6 +14,7 @@ #include <linux/if_ether.h> #include <string.h> #include <arpa/inet.h> +#include <netdb.h> #include "libnetlink.h" #include "utils.h" @@ -31,7 +32,9 @@ static void usage(void) { fprintf(stderr, - "Usage: bridge mdb { add | del } dev DEV port PORT grp GROUP src SOURCE permanent | temp vid VID\n" + "Usage: bridge mdb { add | del | replace } dev DEV port PORT grp GROUP src SOURCE permanent | temp vid VID\n" + " filter_mode { include | exclude } source_list SOURCE_LIST proto PROTO dst IPADDR \n" + " dst_port DST_PORT vni VNI src_vni SRC_VNI via DEV \n" " bridge mdb {show} dev DEV vid VID \n"); exit(-1); } @@ -145,6 +148,21 @@ close_json_object(); } +static void print_dst(const struct rtattr *dst_attr) +{ + SPRINT_BUF(abuf); + int af = AF_INET; + const void *dst; + + if (RTA_PAYLOAD(dst_attr) == sizeof(struct in6_addr)) + af = AF_INET6; + + dst = (const void *)RTA_DATA(dst_attr); + print_color_string(PRINT_ANY, ifa_family_color(af), + "dst", " dst %s", + inet_ntop(af, dst, abuf, sizeof(abuf))); +} + static void print_mdb_entry(FILE *f, int ifindex, const struct br_mdb_entry *e, struct nlmsghdr *n, struct rtattr **tb) { @@ -220,7 +238,7 @@ __u8 rtprot = rta_getattr_u8(tbMDBA_MDB_EATTR_RTPROT); SPRINT_BUF(rtb); - print_string(PRINT_ANY, "protocol", " proto %s ", + print_string(PRINT_ANY, "protocol", " proto %s", rtnl_rtprot_n2a(rtprot, rtb, sizeof(rtb))); } } @@ -239,6 +257,29 @@ if (e->vid) print_uint(PRINT_ANY, "vid", " vid %u", e->vid); + if (tbMDBA_MDB_EATTR_DST) + print_dst(tbMDBA_MDB_EATTR_DST); + + if (tbMDBA_MDB_EATTR_DST_PORT) + print_uint(PRINT_ANY, "dst_port", " dst_port %u", + rta_getattr_u16(tbMDBA_MDB_EATTR_DST_PORT)); + + if (tbMDBA_MDB_EATTR_VNI) + print_uint(PRINT_ANY, "vni", " vni %u", + rta_getattr_u32(tbMDBA_MDB_EATTR_VNI)); + + if (tbMDBA_MDB_EATTR_SRC_VNI) + print_uint(PRINT_ANY, "src_vni", " src_vni %u", + rta_getattr_u32(tbMDBA_MDB_EATTR_SRC_VNI)); + + if (tbMDBA_MDB_EATTR_IFINDEX) { + unsigned int ifindex; + + ifindex = rta_getattr_u32(tbMDBA_MDB_EATTR_IFINDEX); + print_string(PRINT_ANY, "via", " via %s", + ll_index_to_name(ifindex)); + } + if (show_stats && tb && tbMDBA_MDB_EATTR_TIMER) { __u32 timer = rta_getattr_u32(tbMDBA_MDB_EATTR_TIMER); @@ -425,12 +466,14 @@ /* get mdb entries */ if (rtnl_mdbdump_req(&rth, PF_BRIDGE) < 0) { perror("Cannot send dump request"); + delete_json_obj(); return -1; } open_json_array(PRINT_JSON, "mdb"); if (rtnl_dump_filter(&rth, print_mdbs, stdout) < 0) { fprintf(stderr, "Dump terminated\n"); + delete_json_obj(); return -1; } close_json_array(PRINT_JSON, NULL); @@ -438,12 +481,14 @@ /* get router ports */ if (rtnl_mdbdump_req(&rth, PF_BRIDGE) < 0) { perror("Cannot send dump request"); + delete_json_obj(); return -1; } open_json_object("router"); if (rtnl_dump_filter(&rth, print_rtrs, stdout) < 0) { fprintf(stderr, "Dump terminated\n"); + delete_json_obj(); return -1; } close_json_object(); @@ -474,6 +519,171 @@ return -1; } +static int mdb_parse_src(struct nlmsghdr *n, int maxlen, const char *src) +{ + struct in6_addr src_ip6; + __be32 src_ip4; + + if (inet_pton(AF_INET, src, &src_ip4)) { + addattr32(n, maxlen, MDBE_ATTR_SOURCE, src_ip4); + return 0; + } + + if (inet_pton(AF_INET6, src, &src_ip6)) { + addattr_l(n, maxlen, MDBE_ATTR_SOURCE, &src_ip6, + sizeof(src_ip6)); + return 0; + } + + return -1; +} + +static int mdb_parse_mode(struct nlmsghdr *n, int maxlen, const char *mode) +{ + if (strcmp(mode, "include") == 0) { + addattr8(n, maxlen, MDBE_ATTR_GROUP_MODE, MCAST_INCLUDE); + return 0; + } + + if (strcmp(mode, "exclude") == 0) { + addattr8(n, maxlen, MDBE_ATTR_GROUP_MODE, MCAST_EXCLUDE); + return 0; + } + + return -1; +} + +static int mdb_parse_src_entry(struct nlmsghdr *n, int maxlen, char *src_entry) +{ + struct in6_addr src_ip6; + struct rtattr *nest; + __be32 src_ip4; + + nest = addattr_nest(n, maxlen, MDBE_SRC_LIST_ENTRY | NLA_F_NESTED); + + if (inet_pton(AF_INET, src_entry, &src_ip4)) + addattr32(n, maxlen, MDBE_SRCATTR_ADDRESS, src_ip4); + else if (inet_pton(AF_INET6, src_entry, &src_ip6)) + addattr_l(n, maxlen, MDBE_SRCATTR_ADDRESS, &src_ip6, + sizeof(src_ip6)); + else + return -1; + + addattr_nest_end(n, nest); + + return 0; +} + +static int mdb_parse_src_list(struct nlmsghdr *n, int maxlen, char *src_list) +{ + struct rtattr *nest; + char *sep; + + nest = addattr_nest(n, maxlen, MDBE_ATTR_SRC_LIST | NLA_F_NESTED); + + do { + sep = strchr(src_list, ','); + if (sep) + *sep = '\0'; + + if (mdb_parse_src_entry(n, maxlen, src_list)) { + fprintf(stderr, "Invalid source entry \"%s\" in source list\n", + src_list); + return -1; + } + + src_list = sep + 1; + } while (sep); + + addattr_nest_end(n, nest); + + return 0; +} + +static int mdb_parse_proto(struct nlmsghdr *n, int maxlen, const char *proto) +{ + __u32 proto_id; + int err; + + err = rtnl_rtprot_a2n(&proto_id, proto); + if (err) + return err; + + addattr8(n, maxlen, MDBE_ATTR_RTPROT, proto_id); + + return 0; +} + +static int mdb_parse_dst(struct nlmsghdr *n, int maxlen, const char *dst) +{ + struct in6_addr dst_ip6; + __be32 dst_ip4; + + if (inet_pton(AF_INET, dst, &dst_ip4)) { + addattr32(n, maxlen, MDBE_ATTR_DST, dst_ip4); + return 0; + } + + if (inet_pton(AF_INET6, dst, &dst_ip6)) { + addattr_l(n, maxlen, MDBE_ATTR_DST, &dst_ip6, + sizeof(dst_ip6)); + return 0; + } + + return -1; +} + +static int mdb_parse_dst_port(struct nlmsghdr *n, int maxlen, + const char *dst_port) +{ + unsigned long port; + char *endptr; + + port = strtoul(dst_port, &endptr, 0); + if (endptr && *endptr) { + struct servent *pse; + + pse = getservbyname(dst_port, "udp"); + if (!pse) + return -1; + port = ntohs(pse->s_port); + } else if (port > USHRT_MAX) { + return -1; + } + + addattr16(n, maxlen, MDBE_ATTR_DST_PORT, port); + + return 0; +} + +static int mdb_parse_vni(struct nlmsghdr *n, int maxlen, const char *vni, + int attr_type) +{ + unsigned long vni_num; + char *endptr; + + vni_num = strtoul(vni, &endptr, 0); + if ((endptr && *endptr) || vni_num == ULONG_MAX) + return -1; + + addattr32(n, maxlen, attr_type, vni_num); + + return 0; +} + +static int mdb_parse_dev(struct nlmsghdr *n, int maxlen, const char *dev) +{ + unsigned int ifindex; + + ifindex = ll_name_to_index(dev); + if (!ifindex) + return -1; + + addattr32(n, maxlen, MDBE_ATTR_IFINDEX, ifindex); + + return 0; +} + static int mdb_modify(int cmd, int flags, int argc, char **argv) { struct { @@ -486,8 +696,11 @@ .n.nlmsg_type = cmd, .bpm.family = PF_BRIDGE, }; - char *d = NULL, *p = NULL, *grp = NULL, *src = NULL; + char *d = NULL, *p = NULL, *grp = NULL, *src = NULL, *mode = NULL; + char *dst_port = NULL, *vni = NULL, *src_vni = NULL, *via = NULL; + char *src_list = NULL, *proto = NULL, *dst = NULL; struct br_mdb_entry entry = {}; + bool set_attrs = false; short vid = 0; while (argc > 0) { @@ -511,6 +724,39 @@ } else if (strcmp(*argv, "src") == 0) { NEXT_ARG(); src = *argv; + set_attrs = true; + } else if (strcmp(*argv, "filter_mode") == 0) { + NEXT_ARG(); + mode = *argv; + set_attrs = true; + } else if (strcmp(*argv, "source_list") == 0) { + NEXT_ARG(); + src_list = *argv; + set_attrs = true; + } else if (strcmp(*argv, "proto") == 0) { + NEXT_ARG(); + proto = *argv; + set_attrs = true; + } else if (strcmp(*argv, "dst") == 0) { + NEXT_ARG(); + dst = *argv; + set_attrs = true; + } else if (strcmp(*argv, "dst_port") == 0) { + NEXT_ARG(); + dst_port = *argv; + set_attrs = true; + } else if (strcmp(*argv, "vni") == 0) { + NEXT_ARG(); + vni = *argv; + set_attrs = true; + } else if (strcmp(*argv, "src_vni") == 0) { + NEXT_ARG(); + src_vni = *argv; + set_attrs = true; + } else if (strcmp(*argv, "via") == 0) { + NEXT_ARG(); + via = *argv; + set_attrs = true; } else { if (matches(*argv, "help") == 0) usage(); @@ -538,22 +784,60 @@ entry.vid = vid; addattr_l(&req.n, sizeof(req), MDBA_SET_ENTRY, &entry, sizeof(entry)); - if (src) { + if (set_attrs) { struct rtattr *nest = addattr_nest(&req.n, sizeof(req), MDBA_SET_ENTRY_ATTRS); - struct in6_addr src_ip6; - __be32 src_ip4; nest->rta_type |= NLA_F_NESTED; - if (!inet_pton(AF_INET, src, &src_ip4)) { - if (!inet_pton(AF_INET6, src, &src_ip6)) { - fprintf(stderr, "Invalid source address \"%s\"\n", src); - return -1; - } - addattr_l(&req.n, sizeof(req), MDBE_ATTR_SOURCE, &src_ip6, sizeof(src_ip6)); - } else { - addattr32(&req.n, sizeof(req), MDBE_ATTR_SOURCE, src_ip4); + + if (src && mdb_parse_src(&req.n, sizeof(req), src)) { + fprintf(stderr, "Invalid source address \"%s\"\n", src); + return -1; } + + if (mode && mdb_parse_mode(&req.n, sizeof(req), mode)) { + fprintf(stderr, "Invalid filter mode \"%s\"\n", mode); + return -1; + } + + if (src_list && mdb_parse_src_list(&req.n, sizeof(req), + src_list)) + return -1; + + if (proto && mdb_parse_proto(&req.n, sizeof(req), proto)) { + fprintf(stderr, "Invalid protocol value \"%s\"\n", + proto); + return -1; + } + + if (dst && mdb_parse_dst(&req.n, sizeof(req), dst)) { + fprintf(stderr, "Invalid underlay destination address \"%s\"\n", + dst); + return -1; + } + + if (dst_port && mdb_parse_dst_port(&req.n, sizeof(req), + dst_port)) { + fprintf(stderr, "Invalid destination port \"%s\"\n", dst_port); + return -1; + } + + if (vni && mdb_parse_vni(&req.n, sizeof(req), vni, + MDBE_ATTR_VNI)) { + fprintf(stderr, "Invalid destination VNI \"%s\"\n", + vni); + return -1; + } + + if (src_vni && mdb_parse_vni(&req.n, sizeof(req), src_vni, + MDBE_ATTR_SRC_VNI)) { + fprintf(stderr, "Invalid source VNI \"%s\"\n", src_vni); + return -1; + } + + if (via && mdb_parse_dev(&req.n, sizeof(req), via)) + return nodev(via); + addattr_nest_end(&req.n, nest); } @@ -571,6 +855,8 @@ if (argc > 0) { if (matches(*argv, "add") == 0) return mdb_modify(RTM_NEWMDB, NLM_F_CREATE|NLM_F_EXCL, argc-1, argv+1); + if (strcmp(*argv, "replace") == 0) + return mdb_modify(RTM_NEWMDB, NLM_F_CREATE|NLM_F_REPLACE, argc-1, argv+1); if (matches(*argv, "delete") == 0) return mdb_modify(RTM_DELMDB, 0, argc-1, argv+1);
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/bridge/monitor.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/bridge/monitor.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * brmonitor.c "bridge monitor" * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Stephen Hemminger <shemminger@vyatta.com> - * */ #include <stdio.h> @@ -63,7 +58,7 @@ case RTM_NEWTUNNEL: case RTM_DELTUNNEL: - return print_vnifilter_rtm(n, arg, true); + return print_vnifilter_rtm(n, arg); default: return 0;
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/bridge/vlan.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/bridge/vlan.c
Changed
@@ -18,6 +18,7 @@ static unsigned int filter_index, filter_vlan; static int vlan_rtm_cur_ifidx = -1; +static void print_vlan_info(struct rtattr *tb, int ifindex); enum vlan_show_subject { VLAN_SHOW_VLAN, @@ -37,6 +38,8 @@ " self master \n" " bridge vlan { set } vid VLAN_ID dev DEV state STP_STATE \n" " mcast_router MULTICAST_ROUTER \n" + " mcast_max_groups MAX_GROUPS \n" + " neigh_suppress {on | off} \n" " bridge vlan { show } dev DEV vid VLAN_ID \n" " bridge vlan { tunnelshow } dev DEV vid VLAN_ID \n" " bridge vlan global { set } vid VLAN_ID dev DEV\n" @@ -344,6 +347,27 @@ addattr8(&req.n, sizeof(req), BRIDGE_VLANDB_ENTRY_MCAST_ROUTER, mcast_router); + } else if (strcmp(*argv, "mcast_max_groups") == 0) { + __u32 max_groups; + + NEXT_ARG(); + if (get_u32(&max_groups, *argv, 0)) + invarg("invalid mcast_max_groups", *argv); + addattr32(&req.n, sizeof(req), + BRIDGE_VLANDB_ENTRY_MCAST_MAX_GROUPS, + max_groups); + } else if (strcmp(*argv, "neigh_suppress") == 0) { + bool neigh_suppress; + int ret; + + NEXT_ARG(); + neigh_suppress = parse_on_off("neigh_suppress", *argv, + &ret); + if (ret) + return ret; + addattr8(&req.n, sizeof(req), + BRIDGE_VLANDB_ENTRY_NEIGH_SUPPRESS, + neigh_suppress); } else { if (matches(*argv, "help") == 0) NEXT_ARG(); @@ -1021,6 +1045,21 @@ print_uint(PRINT_ANY, "mcast_router", "mcast_router %u ", rta_getattr_u8(vattr)); } + if (vtbBRIDGE_VLANDB_ENTRY_MCAST_N_GROUPS) { + vattr = vtbBRIDGE_VLANDB_ENTRY_MCAST_N_GROUPS; + print_uint(PRINT_ANY, "mcast_n_groups", "mcast_n_groups %u ", + rta_getattr_u32(vattr)); + } + if (vtbBRIDGE_VLANDB_ENTRY_MCAST_MAX_GROUPS) { + vattr = vtbBRIDGE_VLANDB_ENTRY_MCAST_MAX_GROUPS; + print_uint(PRINT_ANY, "mcast_max_groups", "mcast_max_groups %u ", + rta_getattr_u32(vattr)); + } + if (vtbBRIDGE_VLANDB_ENTRY_NEIGH_SUPPRESS) { + vattr = vtbBRIDGE_VLANDB_ENTRY_NEIGH_SUPPRESS; + print_on_off(PRINT_ANY, "neigh_suppress", "neigh_suppress %s ", + rta_getattr_u8(vattr)); + } print_nl(); if (show_stats) __print_one_vlan_stats(&vstats); @@ -1271,7 +1310,7 @@ return 0; } -void print_vlan_info(struct rtattr *tb, int ifindex) +static void print_vlan_info(struct rtattr *tb, int ifindex) { struct rtattr *i, *list = tb; int rem = RTA_PAYLOAD(list);
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/bridge/vni.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/bridge/vni.c
Changed
@@ -138,14 +138,8 @@ return -1; } - if (!vni && group_present) { - fprintf(stderr, "Group can only be specified with a vni\n"); - return -1; - } - - if (vni) - parse_vni_filter(vni, &req.n, sizeof(req), - (group_present ? &daddr : NULL)); + parse_vni_filter(vni, &req.n, sizeof(req), + (group_present ? &daddr : NULL)); req.tmsg.ifindex = ll_name_to_index(d); if (req.tmsg.ifindex == 0) { @@ -303,7 +297,7 @@ print_string(PRINT_FP, NULL, "%s", _SL_); } -int print_vnifilter_rtm(struct nlmsghdr *n, void *arg, bool monitor) +int print_vnifilter_rtm(struct nlmsghdr *n, void *arg) { struct tunnel_msg *tmsg = NLMSG_DATA(n); int len = n->nlmsg_len; @@ -364,7 +358,7 @@ static int print_vnifilter_rtm_filter(struct nlmsghdr *n, void *arg) { - return print_vnifilter_rtm(n, arg, false); + return print_vnifilter_rtm(n, arg); } static int vni_show(int argc, char **argv)
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/configure -> _service:tar_scm:iproute2-6.4.0.tar.xz/configure
Changed
@@ -214,7 +214,6 @@ cat >$TMPDIR/name_to_handle_at_test.c <<EOF #define _GNU_SOURCE #include <sys/types.h> -#include <sys/stat.h> #include <fcntl.h> int main(int argc, char **argv) {
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/dcb/Makefile -> _service:tar_scm:iproute2-6.4.0.tar.xz/dcb/Makefile
Changed
@@ -7,7 +7,8 @@ dcb_dcbx.o \ dcb_ets.o \ dcb_maxrate.o \ - dcb_pfc.o + dcb_pfc.o \ + dcb_apptrust.o TARGETS += dcb LDLIBS += -lm
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/dcb/dcb.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/dcb/dcb.c
Changed
@@ -72,7 +72,7 @@ ga->payload = mnl_attr_get_payload(attr); ga->payload_len = mnl_attr_get_payload_len(attr); - return MNL_CB_STOP; + return MNL_CB_OK; } static int dcb_get_attribute_attr_cb(const struct nlattr *attr, void *data) @@ -126,7 +126,7 @@ return MNL_CB_ERROR; } - return MNL_CB_STOP; + return MNL_CB_OK; } static int dcb_set_attribute_cb(const struct nlmsghdr *nlh, void *data) @@ -470,7 +470,7 @@ fprintf(stderr, "Usage: dcb OPTIONS OBJECT { COMMAND | help }\n" " dcb -f | --force { -b | --batch } filename -n | --netns netnsname\n" - "where OBJECT := { app | buffer | dcbx | ets | maxrate | pfc }\n" + "where OBJECT := { app | apptrust | buffer | dcbx | ets | maxrate | pfc }\n" " OPTIONS := -V | --Version | -i | --iec | -j | --json\n" " | -N | --Numeric | -p | --pretty\n" " | -s | --statistics | -v | --verbose\n"); @@ -483,6 +483,8 @@ return 0; } else if (matches(*argv, "app") == 0) { return dcb_cmd_app(dcb, argc - 1, argv + 1); + } else if (strcmp(*argv, "apptrust") == 0) { + return dcb_cmd_apptrust(dcb, argc - 1, argv + 1); } else if (matches(*argv, "buffer") == 0) { return dcb_cmd_buffer(dcb, argc - 1, argv + 1); } else if (matches(*argv, "dcbx") == 0) {
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/dcb/dcb.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/dcb/dcb.h
Changed
@@ -57,6 +57,13 @@ /* dcb_app.c */ int dcb_cmd_app(struct dcb *dcb, int argc, char **argv); +enum ieee_attrs_app dcb_app_attr_type_get(__u8 selector); +bool dcb_app_attr_type_validate(enum ieee_attrs_app type); +bool dcb_app_selector_validate(enum ieee_attrs_app type, __u8 selector); + +/* dcb_apptrust.c */ + +int dcb_cmd_apptrust(struct dcb *dcb, int argc, char **argv); /* dcb_buffer.c */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/dcb/dcb_app.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/dcb/dcb_app.c
Changed
@@ -10,6 +10,18 @@ #include "utils.h" #include "rt_names.h" +#define DCB_APP_PCP_MAX 15 + +static const char *const pcp_namesDCB_APP_PCP_MAX + 1 = { + "0nd", "1nd", "2nd", "3nd", "4nd", "5nd", "6nd", "7nd", + "0de", "1de", "2de", "3de", "4de", "5de", "6de", "7de" +}; + +static const char *const ieee_attrs_app_names__DCB_ATTR_IEEE_APP_MAX = { + DCB_ATTR_IEEE_APP = "DCB_ATTR_IEEE_APP", + DCB_ATTR_DCB_APP = "DCB_ATTR_DCB_APP" +}; + static void dcb_app_help_add(void) { fprintf(stderr, @@ -20,11 +32,13 @@ " dgram-port-prio PORT:PRIO \n" " port-prio PORT:PRIO \n" " dscp-prio INTEGER:PRIO \n" + " pcp-prio PCP:PRIO \n" "\n" " where PRIO := { 0 .. 7 }\n" " ET := { 0x600 .. 0xffff }\n" " PORT := { 1 .. 65535 }\n" " DSCP := { 0 .. 63 }\n" + " PCP := { 0(nd/de) .. 7(nd/de) }\n" "\n" ); } @@ -39,6 +53,7 @@ " dgram-port-prio \n" " port-prio \n" " dscp-prio \n" + " pcp-prio \n" "\n" ); } @@ -58,6 +73,38 @@ size_t n_apps; }; +enum ieee_attrs_app dcb_app_attr_type_get(__u8 selector) +{ + switch (selector) { + case IEEE_8021QAZ_APP_SEL_ETHERTYPE: + case IEEE_8021QAZ_APP_SEL_STREAM: + case IEEE_8021QAZ_APP_SEL_DGRAM: + case IEEE_8021QAZ_APP_SEL_ANY: + case IEEE_8021QAZ_APP_SEL_DSCP: + return DCB_ATTR_IEEE_APP; + case DCB_APP_SEL_PCP: + return DCB_ATTR_DCB_APP; + default: + return DCB_ATTR_IEEE_APP_UNSPEC; + } +} + +bool dcb_app_attr_type_validate(enum ieee_attrs_app type) +{ + switch (type) { + case DCB_ATTR_IEEE_APP: + case DCB_ATTR_DCB_APP: + return true; + default: + return false; + } +} + +bool dcb_app_selector_validate(enum ieee_attrs_app type, __u8 selector) +{ + return dcb_app_attr_type_get(selector) == type; +} + static void dcb_app_table_fini(struct dcb_app_table *tab) { free(tab->apps); @@ -213,6 +260,32 @@ dcb_app_parse_mapping_cb, data); } +static int dcb_app_parse_pcp(__u32 *key, const char *arg) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(pcp_names); i++) { + if (pcp_namesi && strcmp(arg, pcp_namesi) == 0) { + *key = i; + return 0; + } + } + + return -EINVAL; +} + +static int dcb_app_parse_mapping_pcp_prio(__u32 key, char *value, void *data) +{ + __u8 prio; + + if (get_u8(&prio, value, 0)) + return -EINVAL; + + return dcb_parse_mapping("PCP", key, DCB_APP_PCP_MAX, + "PRIO", prio, IEEE_8021QAZ_MAX_TCS - 1, + dcb_app_parse_mapping_cb, data); +} + static int dcb_app_parse_dscp(__u32 *key, const char *arg) { if (parse_mapping_num_all(key, arg) == 0) @@ -309,6 +382,11 @@ return app->selector == IEEE_8021QAZ_APP_SEL_DSCP; } +static bool dcb_app_is_pcp(const struct dcb_app *app) +{ + return app->selector == DCB_APP_SEL_PCP; +} + static bool dcb_app_is_stream_port(const struct dcb_app *app) { return app->selector == IEEE_8021QAZ_APP_SEL_STREAM; @@ -344,6 +422,15 @@ return print_uint(PRINT_ANY, NULL, "%d:", protocol); } +static int dcb_app_print_key_pcp(__u16 protocol) +{ + /* Print in numerical form, if protocol value is out-of-range */ + if (protocol > DCB_APP_PCP_MAX) + return print_uint(PRINT_ANY, NULL, "%d:", protocol); + + return print_string(PRINT_ANY, NULL, "%s:", pcp_namesprotocol); +} + static void dcb_app_print_filtered(const struct dcb_app_table *tab, bool (*filter)(const struct dcb_app *), int (*print_key)(__u16 protocol), @@ -382,6 +469,15 @@ "ethtype_prio", "ethtype-prio"); } +static void dcb_app_print_pcp_prio(const struct dcb *dcb, + const struct dcb_app_table *tab) +{ + dcb_app_print_filtered(tab, dcb_app_is_pcp, + dcb->numeric ? dcb_app_print_key_dec + : dcb_app_print_key_pcp, + "pcp_prio", "pcp-prio"); +} + static void dcb_app_print_dscp_prio(const struct dcb *dcb, const struct dcb_app_table *tab) { @@ -439,26 +535,41 @@ dcb_app_print_stream_port_prio(tab); dcb_app_print_dgram_port_prio(tab); dcb_app_print_port_prio(tab); + dcb_app_print_pcp_prio(dcb, tab); } static int dcb_app_get_table_attr_cb(const struct nlattr *attr, void *data) { struct dcb_app_table *tab = data; struct dcb_app *app; + uint16_t type; int ret; - if (mnl_attr_get_type(attr) != DCB_ATTR_IEEE_APP) { - fprintf(stderr, "Unknown attribute in DCB_ATTR_IEEE_APP_TABLE: %d\n", - mnl_attr_get_type(attr)); + type = mnl_attr_get_type(attr); + + if (!dcb_app_attr_type_validate(type)) { + fprintf(stderr, + "Unknown attribute in DCB_ATTR_IEEE_APP_TABLE: %d\n", + type); return MNL_CB_OK; } if (mnl_attr_get_payload_len(attr) < sizeof(struct dcb_app)) { - fprintf(stderr, "DCB_ATTR_IEEE_APP payload expected to have size %zd, not %d\n", - sizeof(struct dcb_app), mnl_attr_get_payload_len(attr)); + fprintf(stderr, + "%s payload expected to have size %zd, not %d\n", + ieee_attrs_app_namestype, sizeof(struct dcb_app), + mnl_attr_get_payload_len(attr)); return MNL_CB_OK; } app = mnl_attr_get_payload(attr); + + /* Check that selector is encapsulated in the right attribute */ + if (!dcb_app_selector_validate(type, app->selector)) { + fprintf(stderr, "Wrong selector for type: %s\n", + ieee_attrs_app_namestype); + return MNL_CB_OK; + } + ret = dcb_app_table_push(tab, app); if (ret != 0) return MNL_CB_ERROR; @@ -491,6 +602,7 @@ static int dcb_app_add_del_cb(struct dcb *dcb, struct nlmsghdr *nlh, void *data) { struct dcb_app_add_del *add_del = data; + enum ieee_attrs_app type; struct nlattr *nest; size_t i; @@ -498,9 +610,10 @@ for (i = 0; i < add_del->tab->n_apps; i++) { const struct dcb_app *app = &add_del->tab->appsi; + type = dcb_app_attr_type_get(app->selector); if (add_del->filter == NULL || add_del->filter(app)) - mnl_attr_put(nlh, DCB_ATTR_IEEE_APP, sizeof(*app), app); + mnl_attr_put(nlh, type, sizeof(*app), app); } mnl_attr_nest_end(nlh, nest); @@ -577,6 +690,12 @@ ret = parse_mapping(&argc, &argv, false, &dcb_app_parse_mapping_port_prio, &pm); + } else if (strcmp(*argv, "pcp-prio") == 0) { + NEXT_ARG(); + pm.selector = DCB_APP_SEL_PCP; + ret = parse_mapping_gen(&argc, &argv, &dcb_app_parse_pcp, + &dcb_app_parse_mapping_pcp_prio, + &pm); } else { fprintf(stderr, "What is \"%s\"?\n", *argv); dcb_app_help_add(); @@ -656,6 +775,8 @@ dcb_app_print_port_prio(&tab); } else if (matches(*argv, "default-prio") == 0) { dcb_app_print_default_prio(&tab); + } else if (strcmp(*argv, "pcp-prio") == 0) { + dcb_app_print_pcp_prio(dcb, &tab); } else { fprintf(stderr, "What is \"%s\"?\n", *argv); dcb_app_help_show_flush(); @@ -705,6 +826,11 @@ &dcb_app_is_dscp); if (ret != 0) goto out; + } else if (strcmp(*argv, "pcp-prio") == 0) { + ret = dcb_app_add_del(dcb, dev, DCB_CMD_IEEE_DEL, &tab, + &dcb_app_is_pcp); + if (ret != 0) + goto out; } else { fprintf(stderr, "What is \"%s\"?\n", *argv); dcb_app_help_show_flush();
View file
_service:tar_scm:iproute2-6.4.0.tar.xz/dcb/dcb_apptrust.c
Added
@@ -0,0 +1,307 @@ +// SPDX-License-Identifier: GPL-2.0+ + +#include <errno.h> +#include <linux/dcbnl.h> + +#include "dcb.h" +#include "utils.h" + +static void dcb_apptrust_help_set(void) +{ + fprintf(stderr, + "Usage: dcb apptrust set dev STRING\n" + " order ethtype | stream-port | dgram-port | port | dscp | pcp \n" + "\n"); +} + +static void dcb_apptrust_help_show(void) +{ + fprintf(stderr, "Usage: dcb apptrust show dev STRING\n" + " order \n" + "\n"); +} + +static void dcb_apptrust_help(void) +{ + fprintf(stderr, "Usage: dcb apptrust help\n" + "\n"); + dcb_apptrust_help_show(); + dcb_apptrust_help_set(); +} + +static const char *const selector_names = { + IEEE_8021QAZ_APP_SEL_ETHERTYPE = "ethtype", + IEEE_8021QAZ_APP_SEL_STREAM = "stream-port", + IEEE_8021QAZ_APP_SEL_DGRAM = "dgram-port", + IEEE_8021QAZ_APP_SEL_ANY = "port", + IEEE_8021QAZ_APP_SEL_DSCP = "dscp", + DCB_APP_SEL_PCP = "pcp", +}; + +struct dcb_apptrust_table { + __u8 selectorsIEEE_8021QAZ_APP_SEL_MAX + 1; + int nselectors; +}; + +static bool dcb_apptrust_contains(const struct dcb_apptrust_table *table, + __u8 selector) +{ + int i; + + for (i = 0; i < table->nselectors; i++) + if (table->selectorsi == selector) + return true; + + return false; +} + +static void dcb_apptrust_print_order(const struct dcb_apptrust_table *table) +{ + const char *str; + __u8 selector; + int i; + + open_json_array(PRINT_JSON, "order"); + print_string(PRINT_FP, NULL, "order: ", NULL); + + for (i = 0; i < table->nselectors; i++) { + selector = table->selectorsi; + str = selector_namesselector; + print_string(PRINT_ANY, NULL, "%s ", str); + } + print_nl(); + + close_json_array(PRINT_JSON, "order"); +} + +static void dcb_apptrust_print(const struct dcb_apptrust_table *table) +{ + dcb_apptrust_print_order(table); + print_nl(); +} + +static int dcb_apptrust_get_cb(const struct nlattr *attr, void *data) +{ + struct dcb_apptrust_table *table = data; + uint16_t type; + __u8 selector; + + type = mnl_attr_get_type(attr); + + if (!dcb_app_attr_type_validate(type)) { + fprintf(stderr, + "Unknown attribute in DCB_ATTR_IEEE_APP_TRUST_TABLE: %d\n", + type); + return MNL_CB_OK; + } + + if (mnl_attr_get_payload_len(attr) < 1) { + fprintf(stderr, + "DCB_ATTR_IEEE_APP_TRUST payload expected to have size %zd, not %d\n", + sizeof(struct dcb_app), mnl_attr_get_payload_len(attr)); + return MNL_CB_OK; + } + + selector = mnl_attr_get_u8(attr); + + /* Check that selector is encapsulated in the right attribute */ + if (!dcb_app_selector_validate(type, selector)) { + fprintf(stderr, "Wrong type for selector: %s\n", + selector_namesselector); + return MNL_CB_OK; + } + + table->selectorstable->nselectors++ = selector; + + return MNL_CB_OK; +} + +static int dcb_apptrust_get(struct dcb *dcb, const char *dev, + struct dcb_apptrust_table *table) +{ + uint16_t payload_len; + void *payload; + int ret; + + ret = dcb_get_attribute_va(dcb, dev, DCB_ATTR_DCB_APP_TRUST_TABLE, + &payload, &payload_len); + if (ret != 0) + return ret; + + ret = mnl_attr_parse_payload(payload, payload_len, dcb_apptrust_get_cb, + table); + if (ret != MNL_CB_OK) + return -EINVAL; + + return 0; +} + +static int dcb_apptrust_set_cb(struct dcb *dcb, struct nlmsghdr *nlh, + void *data) +{ + const struct dcb_apptrust_table *table = data; + enum ieee_attrs_app type; + struct nlattr *nest; + int i; + + nest = mnl_attr_nest_start(nlh, DCB_ATTR_DCB_APP_TRUST_TABLE); + + for (i = 0; i < table->nselectors; i++) { + type = dcb_app_attr_type_get(table->selectorsi); + mnl_attr_put_u8(nlh, type, table->selectorsi); + } + + mnl_attr_nest_end(nlh, nest); + + return 0; +} + +static int dcb_apptrust_set(struct dcb *dcb, const char *dev, + const struct dcb_apptrust_table *table) +{ + return dcb_set_attribute_va(dcb, DCB_CMD_IEEE_SET, dev, + &dcb_apptrust_set_cb, (void *)table); +} + +static __u8 dcb_apptrust_parse_selector(const char *selector, int *err) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(selector_names); i++) { + if (selector_namesi && + strcmp(selector, selector_namesi) == 0) { + *err = 0; + return i; + } + } + + *err = -EINVAL; + return 0; +} + +static int dcb_apptrust_parse_selector_list(int *argcp, char ***argvp, + struct dcb_apptrust_table *table) +{ + int argc = *argcp, err; + char **argv = *argvp; + __u8 selector; + + /* No trusted selectors ? */ + if (argc == 0) + goto out; + + while (argc > 0) { + selector = dcb_apptrust_parse_selector(*argv, &err); + if (err < 0) + goto out; + + if (table->nselectors > IEEE_8021QAZ_APP_SEL_MAX) + return -ERANGE; + + if (dcb_apptrust_contains(table, selector)) { + fprintf(stderr, "Duplicate selector: %s\n", + selector_namesselector); + return -EINVAL; + } + + table->selectorstable->nselectors++ = selector; + + NEXT_ARG_FWD(); + } + +out: + *argcp = argc; + *argvp = argv; + + return 0; +} + +static int dcb_cmd_apptrust_set(struct dcb *dcb, const char *dev, int argc, + char **argv) +{ + struct dcb_apptrust_table table = { 0 }; + int ret; + + if (!argc) { + dcb_apptrust_help_set(); + return 0; + } + + do { + if (strcmp(*argv, "help") == 0) { + dcb_apptrust_help_set(); + return 0; + } else if (strcmp(*argv, "order") == 0) { + NEXT_ARG_FWD(); + ret = dcb_apptrust_parse_selector_list(&argc, &argv, + &table); + if (ret < 0) { + fprintf(stderr, "Invalid list of selectors\n"); + return -EINVAL; + } + } else { + fprintf(stderr, "What is \"%s\"?\n", *argv); + dcb_apptrust_help_set(); + return -EINVAL; + } + } while (argc > 0); + + return dcb_apptrust_set(dcb, dev, &table); +} + +static int dcb_cmd_apptrust_show(struct dcb *dcb, const char *dev, int argc, + char **argv) +{ + struct dcb_apptrust_table table = { 0 }; + int ret; + + ret = dcb_apptrust_get(dcb, dev, &table); + if (ret) + return ret; + + open_json_object(NULL); + + if (!argc) { + dcb_apptrust_print(&table); + goto out; + } + + do { + if (strcmp(*argv, "help") == 0) { + dcb_apptrust_help_show(); + return 0; + } else if (strcmp(*argv, "order") == 0) { + dcb_apptrust_print_order(&table); + } else { + fprintf(stderr, "What is \"%s\"?\n", *argv); + dcb_apptrust_help_show(); + return -EINVAL; + } + + NEXT_ARG_FWD(); + } while (argc > 0); + +out: + close_json_object(); + return 0; +} + +int dcb_cmd_apptrust(struct dcb *dcb, int argc, char **argv) +{ + if (!argc || strcmp(*argv, "help") == 0) { + dcb_apptrust_help(); + return 0; + } else if (strcmp(*argv, "show") == 0) { + NEXT_ARG_FWD(); + return dcb_cmd_parse_dev(dcb, argc, argv, dcb_cmd_apptrust_show, + dcb_apptrust_help_show); + } else if (strcmp(*argv, "set") == 0) { + NEXT_ARG_FWD(); + return dcb_cmd_parse_dev(dcb, argc, argv, dcb_cmd_apptrust_set, + dcb_apptrust_help_set); + } else { + fprintf(stderr, "What is \"%s\"?\n", *argv); + dcb_apptrust_help(); + return -EINVAL; + } +}
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/devlink/devlink.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/devlink/devlink.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * devlink.c Devlink tool * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Jiri Pirko <jiri@mellanox.com> */ @@ -43,6 +39,8 @@ #include "json_print.h" #include "utils.h" #include "namespace.h" +#include "libnetlink.h" +#include "../ip/ip_common.h" #define ESWITCH_MODE_LEGACY "legacy" #define ESWITCH_MODE_SWITCHDEV "switchdev" @@ -207,6 +205,14 @@ char *ifname; }; +static void ifname_map_free(struct ifname_map *ifname_map) +{ + free(ifname_map->ifname); + free(ifname_map->dev_name); + free(ifname_map->bus_name); + free(ifname_map); +} + static struct ifname_map *ifname_map_alloc(const char *bus_name, const char *dev_name, uint32_t port_index, @@ -223,21 +229,22 @@ ifname_map->ifname = strdup(ifname); if (!ifname_map->bus_name || !ifname_map->dev_name || !ifname_map->ifname) { - free(ifname_map->ifname); - free(ifname_map->dev_name); - free(ifname_map->bus_name); - free(ifname_map); + ifname_map_free(ifname_map); return NULL; } return ifname_map; } -static void ifname_map_free(struct ifname_map *ifname_map) +static int ifname_map_update(struct ifname_map *ifname_map, const char *ifname) { + char *new_ifname; + + new_ifname = strdup(ifname); + if (!new_ifname) + return -ENOMEM; free(ifname_map->ifname); - free(ifname_map->dev_name); - free(ifname_map->bus_name); - free(ifname_map); + ifname_map->ifname = new_ifname; + return 0; } #define DL_OPT_HANDLE BIT(0) @@ -295,6 +302,9 @@ #define DL_OPT_LINECARD BIT(52) #define DL_OPT_LINECARD_TYPE BIT(53) #define DL_OPT_SELFTESTS BIT(54) +#define DL_OPT_PORT_FN_RATE_TX_PRIORITY BIT(55) +#define DL_OPT_PORT_FN_RATE_TX_WEIGHT BIT(56) +#define DL_OPT_PORT_FN_CAPS BIT(57) struct dl_opts { uint64_t present; /* flags of present items */ @@ -353,11 +363,14 @@ uint16_t rate_type; uint64_t rate_tx_share; uint64_t rate_tx_max; + uint32_t rate_tx_priority; + uint32_t rate_tx_weight; char *rate_node_name; const char *rate_parent_node; uint32_t linecard_index; const char *linecard_type; bool selftests_optDEVLINK_ATTR_SELFTEST_ID_MAX + 1; + struct nla_bitfield32 port_fn_caps; }; struct dl { @@ -774,16 +787,110 @@ return MNL_CB_OK; } +static int ifname_map_add(struct dl *dl, const char *ifname, + const char *bus_name, const char *dev_name, + uint32_t port_index) +{ + struct ifname_map *ifname_map; + + ifname_map = ifname_map_alloc(bus_name, dev_name, port_index, ifname); + if (!ifname_map) + return -ENOMEM; + list_add(&ifname_map->list, &dl->ifname_map_list); + return 0; +} + +static void ifname_map_del(struct ifname_map *ifname_map) +{ + list_del(&ifname_map->list); + ifname_map_free(ifname_map); +} + +static int ifname_map_rtnl_port_parse(struct dl *dl, const char *ifname, + struct rtattr *nest) +{ + struct rtattr *tbDEVLINK_ATTR_MAX + 1; + const char *bus_name; + const char *dev_name; + uint32_t port_index; + + parse_rtattr_nested(tb, DEVLINK_ATTR_MAX, nest); + if (!tbDEVLINK_ATTR_BUS_NAME || !tbDEVLINK_ATTR_DEV_NAME || + !tbDEVLINK_ATTR_PORT_INDEX) + return -ENOENT; + + bus_name = rta_getattr_str(tbDEVLINK_ATTR_BUS_NAME); + dev_name = rta_getattr_str(tbDEVLINK_ATTR_DEV_NAME); + port_index = rta_getattr_u32(tbDEVLINK_ATTR_PORT_INDEX); + return ifname_map_add(dl, ifname, bus_name, dev_name, port_index); +} + +static int ifname_map_rtnl_init(struct dl *dl, const char *ifname) +{ + struct iplink_req req = { + .n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)), + .n.nlmsg_flags = NLM_F_REQUEST, + .n.nlmsg_type = RTM_GETLINK, + .i.ifi_family = AF_UNSPEC, + }; + struct rtattr *tbIFLA_MAX + 1; + struct rtnl_handle rth; + struct ifinfomsg *ifi; + struct nlmsghdr *n; + int len; + int err; + + if (rtnl_open(&rth, 0) < 0) { + pr_err("Cannot open rtnetlink\n"); + return -EINVAL; + } + + addattr_l(&req.n, sizeof(req), + !check_ifname(ifname) ? IFLA_IFNAME : IFLA_ALT_IFNAME, + ifname, strlen(ifname) + 1); + + if (rtnl_talk(&rth, &req.n, &n) < 0) { + err = -EINVAL; + goto out; + } + + if (n->nlmsg_type != RTM_NEWLINK) { + err = -EINVAL; + goto out; + } + + ifi = NLMSG_DATA(n); + len = n->nlmsg_len; + + len -= NLMSG_LENGTH(sizeof(*ifi)); + if (len < 0) { + err = -EINVAL; + goto out; + } + + parse_rtattr_flags(tb, IFLA_MAX, IFLA_RTA(ifi), len, NLA_F_NESTED); + if (!tbIFLA_DEVLINK_PORT) { + err = -EOPNOTSUPP; + goto out; + } + + err = ifname_map_rtnl_port_parse(dl, ifname, tbIFLA_DEVLINK_PORT); + +out: + rtnl_close(&rth); + return err; +} + static int ifname_map_cb(const struct nlmsghdr *nlh, void *data) { struct nlattr *tbDEVLINK_ATTR_MAX + 1 = {}; struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh); struct dl *dl = data; - struct ifname_map *ifname_map; const char *bus_name; const char *dev_name; uint32_t port_index; const char *port_ifname; + int err; mnl_attr_parse(nlh, sizeof(*genl), attr_cb, tb); if (!tbDEVLINK_ATTR_BUS_NAME || !tbDEVLINK_ATTR_DEV_NAME || @@ -797,11 +904,9 @@ dev_name = mnl_attr_get_str(tbDEVLINK_ATTR_DEV_NAME); port_index = mnl_attr_get_u32(tbDEVLINK_ATTR_PORT_INDEX); port_ifname = mnl_attr_get_str(tbDEVLINK_ATTR_PORT_NETDEV_NAME); - ifname_map = ifname_map_alloc(bus_name, dev_name, - port_index, port_ifname); - if (!ifname_map) + err = ifname_map_add(dl, port_ifname, bus_name, dev_name, port_index); + if (err) return MNL_CB_ERROR; - list_add(&ifname_map->list, &dl->ifname_map_list); return MNL_CB_OK; } @@ -812,8 +917,7 @@ list_for_each_entry_safe(ifname_map, tmp, &dl->ifname_map_list, list) { - list_del(&ifname_map->list); - ifname_map_free(ifname_map); + ifname_map_del(ifname_map); } } @@ -822,30 +926,45 @@ INIT_LIST_HEAD(&dl->ifname_map_list); } -static int ifname_map_load(struct dl *dl) +static int ifname_map_load(struct dl *dl, const char *ifname) { + struct mnlu_gen_socket nlg_map; struct nlmsghdr *nlh; int err; - nlh = mnlu_gen_socket_cmd_prepare(&dl->nlg, DEVLINK_CMD_PORT_GET, + if (ifname) { + err = ifname_map_rtnl_init(dl, ifname); + if (!err) + return 0; + /* In case kernel does not support devlink port info passed over + * RT netlink, fall-back to ports dump. + */ + } + + err = mnlu_gen_socket_open(&nlg_map, DEVLINK_GENL_NAME, + DEVLINK_GENL_VERSION); + if (err) + return err; + + nlh = mnlu_gen_socket_cmd_prepare(&nlg_map, DEVLINK_CMD_PORT_GET, NLM_F_REQUEST | NLM_F_ACK | NLM_F_DUMP); - err = mnlu_gen_socket_sndrcv(&dl->nlg, nlh, ifname_map_cb, dl); - if (err) { + err = mnlu_gen_socket_sndrcv(&nlg_map, nlh, ifname_map_cb, dl); + if (err) ifname_map_fini(dl); - return err; - } - return 0; + + mnlu_gen_socket_close(&nlg_map); + return err; } -static int ifname_map_check_load(struct dl *dl) +static int ifname_map_check_load(struct dl *dl, const char *ifname) { int err; if (dl->map_loaded) return 0; - err = ifname_map_load(dl); + err = ifname_map_load(dl, ifname); if (err) { pr_err("Failed to create index map\n"); return err; @@ -862,7 +981,7 @@ struct ifname_map *ifname_map; int err; - err = ifname_map_check_load(dl); + err = ifname_map_check_load(dl, ifname); if (err) return err; @@ -879,13 +998,13 @@ static int ifname_map_rev_lookup(struct dl *dl, const char *bus_name, const char *dev_name, uint32_t port_index, - char **p_ifname) + const char **p_ifname) { struct ifname_map *ifname_map; int err; - err = ifname_map_check_load(dl); + err = ifname_map_check_load(dl, NULL); if (err) return err; @@ -893,6 +1012,12 @@ if (strcmp(bus_name, ifname_map->bus_name) == 0 && strcmp(dev_name, ifname_map->dev_name) == 0 && port_index == ifname_map->port_index) { + /* In case non-NULL ifname is passed, update the + * looked-up entry. + */ + if (*p_ifname) + return ifname_map_update(ifname_map, *p_ifname); + *p_ifname = ifname_map->ifname; return 0; } @@ -1841,7 +1966,7 @@ dl_arg_inc(dl); err = dl_argv_str(dl, §ionstr); - if(err) + if (err) return err; err = flash_overwrite_section_get(sectionstr, &opts->overwrite_mask); @@ -2067,6 +2192,20 @@ if (err) return err; o_found |= DL_OPT_PORT_FN_RATE_TX_MAX; + } else if (dl_argv_match(dl, "tx_priority") && + (o_all & DL_OPT_PORT_FN_RATE_TX_PRIORITY)) { + dl_arg_inc(dl); + err = dl_argv_uint32_t(dl, &opts->rate_tx_priority); + if (err) + return err; + o_found |= DL_OPT_PORT_FN_RATE_TX_PRIORITY; + } else if (dl_argv_match(dl, "tx_weight") && + (o_all & DL_OPT_PORT_FN_RATE_TX_WEIGHT)) { + dl_arg_inc(dl); + err = dl_argv_uint32_t(dl, &opts->rate_tx_weight); + if (err) + return err; + o_found |= DL_OPT_PORT_FN_RATE_TX_WEIGHT; } else if (dl_argv_match(dl, "parent") && (o_all & DL_OPT_PORT_FN_RATE_PARENT)) { dl_arg_inc(dl); @@ -2098,6 +2237,30 @@ dl_arg_inc(dl); opts->linecard_type = ""; o_found |= DL_OPT_LINECARD_TYPE; + } else if (dl_argv_match(dl, "roce") && + (o_all & DL_OPT_PORT_FN_CAPS)) { + bool roce; + + dl_arg_inc(dl); + err = dl_argv_bool(dl, &roce); + if (err) + return err; + opts->port_fn_caps.selector |= DEVLINK_PORT_FN_CAP_ROCE; + if (roce) + opts->port_fn_caps.value |= DEVLINK_PORT_FN_CAP_ROCE; + o_found |= DL_OPT_PORT_FN_CAPS; + } else if (dl_argv_match(dl, "migratable") && + (o_all & DL_OPT_PORT_FN_CAPS)) { + bool mig; + + dl_arg_inc(dl); + err = dl_argv_bool(dl, &mig); + if (err) + return err; + opts->port_fn_caps.selector |= DEVLINK_PORT_FN_CAP_MIGRATABLE; + if (mig) + opts->port_fn_caps.value |= DEVLINK_PORT_FN_CAP_MIGRATABLE; + o_found |= DL_OPT_PORT_FN_CAPS; } else { pr_err("Unknown option \"%s\"\n", dl_argv(dl)); return -EINVAL; @@ -2128,6 +2291,10 @@ if (opts->present & DL_OPT_PORT_FUNCTION_STATE) mnl_attr_put_u8(nlh, DEVLINK_PORT_FN_ATTR_STATE, opts->port_fn_state); + if (opts->present & DL_OPT_PORT_FN_CAPS) + mnl_attr_put(nlh, DEVLINK_PORT_FN_ATTR_CAPS, + sizeof(opts->port_fn_caps), &opts->port_fn_caps); + mnl_attr_nest_end(nlh, nest); } @@ -2318,7 +2485,8 @@ if (opts->present & DL_OPT_TRAP_POLICER_BURST) mnl_attr_put_u64(nlh, DEVLINK_ATTR_TRAP_POLICER_BURST, opts->trap_policer_burst); - if (opts->present & (DL_OPT_PORT_FUNCTION_HW_ADDR | DL_OPT_PORT_FUNCTION_STATE)) + if (opts->present & (DL_OPT_PORT_FUNCTION_HW_ADDR | DL_OPT_PORT_FUNCTION_STATE | + DL_OPT_PORT_FN_CAPS)) dl_function_attr_put(nlh, opts); if (opts->present & DL_OPT_PORT_FLAVOUR) mnl_attr_put_u16(nlh, DEVLINK_ATTR_PORT_FLAVOUR, opts->port_flavour); @@ -2335,6 +2503,12 @@ if (opts->present & DL_OPT_PORT_FN_RATE_TX_SHARE) mnl_attr_put_u64(nlh, DEVLINK_ATTR_RATE_TX_SHARE, opts->rate_tx_share); + if (opts->present & DL_OPT_PORT_FN_RATE_TX_PRIORITY) + mnl_attr_put_u32(nlh, DEVLINK_ATTR_RATE_TX_PRIORITY, + opts->rate_tx_priority); + if (opts->present & DL_OPT_PORT_FN_RATE_TX_WEIGHT) + mnl_attr_put_u32(nlh, DEVLINK_ATTR_RATE_TX_WEIGHT, + opts->rate_tx_weight); if (opts->present & DL_OPT_PORT_FN_RATE_TX_MAX) mnl_attr_put_u64(nlh, DEVLINK_ATTR_RATE_TX_MAX, opts->rate_tx_max); @@ -2589,11 +2763,10 @@ static void __pr_out_port_handle_start(struct dl *dl, const char *bus_name, const char *dev_name, - uint32_t port_index, bool try_nice, - bool array) + uint32_t port_index, const char *ifname, + bool try_nice, bool array) { static char buf64; - char *ifname = NULL; if (dl->no_nice_names || !try_nice || ifname_map_rev_lookup(dl, bus_name, dev_name, @@ -2638,8 +2811,10 @@ } } -static void pr_out_port_handle_start(struct dl *dl, struct nlattr **tb, bool try_nice) +static void __pr_out_port_handle_start_tb(struct dl *dl, struct nlattr **tb, + bool try_nice, bool array) { + const char *ifname = NULL; const char *bus_name; const char *dev_name; uint32_t port_index; @@ -2647,19 +2822,20 @@ bus_name = mnl_attr_get_str(tbDEVLINK_ATTR_BUS_NAME); dev_name = mnl_attr_get_str(tbDEVLINK_ATTR_DEV_NAME); port_index = mnl_attr_get_u32(tbDEVLINK_ATTR_PORT_INDEX); - __pr_out_port_handle_start(dl, bus_name, dev_name, port_index, try_nice, false); + if (tbDEVLINK_ATTR_PORT_NETDEV_NAME) + ifname = mnl_attr_get_str(tbDEVLINK_ATTR_PORT_NETDEV_NAME); + __pr_out_port_handle_start(dl, bus_name, dev_name, port_index, + ifname, try_nice, array); } -static void pr_out_port_handle_start_arr(struct dl *dl, struct nlattr **tb, bool try_nice) +static void pr_out_port_handle_start(struct dl *dl, struct nlattr **tb, bool try_nice) { - const char *bus_name; - const char *dev_name; - uint32_t port_index; + __pr_out_port_handle_start_tb(dl, tb, try_nice, false); +} - bus_name = mnl_attr_get_str(tbDEVLINK_ATTR_BUS_NAME); - dev_name = mnl_attr_get_str(tbDEVLINK_ATTR_DEV_NAME); - port_index = mnl_attr_get_u32(tbDEVLINK_ATTR_PORT_INDEX); - __pr_out_port_handle_start(dl, bus_name, dev_name, port_index, try_nice, true); +static void pr_out_port_handle_start_arr(struct dl *dl, struct nlattr **tb, bool try_nice) +{ + __pr_out_port_handle_start_tb(dl, tb, try_nice, true); } static void pr_out_port_handle_end(struct dl *dl) @@ -4362,6 +4538,7 @@ pr_err(" devlink port split DEV/PORT_INDEX count COUNT\n"); pr_err(" devlink port unsplit DEV/PORT_INDEX\n"); pr_err(" devlink port function set DEV/PORT_INDEX hw_addr ADDR state { active | inactive } \n"); + pr_err(" roce { enable | disable } migratable { enable | disable } \n"); pr_err(" devlink port function rate { help | show | add | del | set }\n"); pr_err(" devlink port param set DEV/PORT_INDEX name PARAMETER value VALUE cmode { permanent | driverinit | runtime }\n"); pr_err(" devlink port param show DEV/PORT_INDEX name PARAMETER\n"); @@ -4475,6 +4652,19 @@ print_string(PRINT_ANY, "opstate", " opstate %s", port_fn_opstate(state)); } + if (tbDEVLINK_PORT_FN_ATTR_CAPS) { + struct nla_bitfield32 *port_fn_caps = + mnl_attr_get_payload(tbDEVLINK_PORT_FN_ATTR_CAPS); + + if (port_fn_caps->selector & DEVLINK_PORT_FN_CAP_ROCE) + print_string(PRINT_ANY, "roce", " roce %s", + port_fn_caps->value & DEVLINK_PORT_FN_CAP_ROCE ? + "enable" : "disable"); + if (port_fn_caps->selector & DEVLINK_PORT_FN_CAP_MIGRATABLE) + print_string(PRINT_ANY, "migratable", " migratable %s", + port_fn_caps->value & DEVLINK_PORT_FN_CAP_MIGRATABLE ? + "enable" : "disable"); + } if (!dl->json_output) __pr_out_indent_dec(); @@ -4669,6 +4859,7 @@ static void cmd_port_function_help(void) { pr_err("Usage: devlink port function set DEV/PORT_INDEX hw_addr ADDR state STATE \n"); + pr_err(" roce { enable | disable } migratable { enable | disable } \n"); pr_err(" devlink port function rate { help | show | add | del | set }\n"); } @@ -4682,7 +4873,8 @@ return 0; } err = dl_argv_parse(dl, DL_OPT_HANDLEP, - DL_OPT_PORT_FUNCTION_HW_ADDR | DL_OPT_PORT_FUNCTION_STATE); + DL_OPT_PORT_FUNCTION_HW_ADDR | DL_OPT_PORT_FUNCTION_STATE | + DL_OPT_PORT_FN_CAPS); if (err) return err; @@ -4955,6 +5147,20 @@ print_rate(dl->use_iec, PRINT_ANY, "tx_max", " tx_max %s", rate); } + if (tbDEVLINK_ATTR_RATE_TX_PRIORITY) { + uint32_t priority = + mnl_attr_get_u32(tbDEVLINK_ATTR_RATE_TX_PRIORITY); + if (priority) + print_uint(PRINT_ANY, "tx_priority", + " tx_priority %u", priority); + } + if (tbDEVLINK_ATTR_RATE_TX_WEIGHT) { + uint32_t weight = + mnl_attr_get_u32(tbDEVLINK_ATTR_RATE_TX_WEIGHT); + if (weight) + print_uint(PRINT_ANY, "tx_weight", + " tx_weight %u", weight); + } if (tbDEVLINK_ATTR_RATE_PARENT_NODE_NAME) { const char *parent = mnl_attr_get_str(tbDEVLINK_ATTR_RATE_PARENT_NODE_NAME); @@ -4986,11 +5192,12 @@ pr_err("Usage: devlink port function rate help\n"); pr_err(" devlink port function rate show DEV/{ PORT_INDEX | NODE_NAME } \n"); pr_err(" devlink port function rate add DEV/NODE_NAME\n"); - pr_err(" tx_share VAL tx_max VAL { parent NODE_NAME | noparent } \n"); + pr_err(" tx_share VAL tx_max VAL tx_priority N tx_weight N { parent NODE_NAME | noparent } \n"); pr_err(" devlink port function rate del DEV/NODE_NAME\n"); pr_err(" devlink port function rate set DEV/{ PORT_INDEX | NODE_NAME }\n"); - pr_err(" tx_share VAL tx_max VAL { parent NODE_NAME | noparent } \n\n"); + pr_err(" tx_share VAL tx_max VAL tx_priority N tx_weight N { parent NODE_NAME | noparent } \n\n"); pr_err(" VAL - float or integer value in units of bits or bytes per second (bit|bps)\n"); + pr_err(" N - integer representing priority/weight of the node among siblings\n"); pr_err(" and SI (k-, m-, g-, t-) or IEC (ki-, mi-, gi-, ti-) case-insensitive prefix.\n"); pr_err(" Bare number, means bits per second, is possible.\n\n"); pr_err(" For details refer to devlink-rate(8) man page.\n"); @@ -5050,6 +5257,8 @@ err = dl_argv_parse(dl, DL_OPT_PORT_FN_RATE_NODE_NAME, DL_OPT_PORT_FN_RATE_TX_SHARE | DL_OPT_PORT_FN_RATE_TX_MAX | + DL_OPT_PORT_FN_RATE_TX_PRIORITY | + DL_OPT_PORT_FN_RATE_TX_WEIGHT | DL_OPT_PORT_FN_RATE_PARENT); if (err) return err; @@ -5104,6 +5313,12 @@ if (tbDEVLINK_ATTR_RATE_TX_MAX) opts->rate_tx_max = mnl_attr_get_u64(tbDEVLINK_ATTR_RATE_TX_MAX); + if (tbDEVLINK_ATTR_RATE_TX_PRIORITY) + opts->rate_tx_priority = + mnl_attr_get_u32(tbDEVLINK_ATTR_RATE_TX_PRIORITY); + if (tbDEVLINK_ATTR_RATE_TX_WEIGHT) + opts->rate_tx_weight = + mnl_attr_get_u32(tbDEVLINK_ATTR_RATE_TX_WEIGHT); return MNL_CB_OK; } @@ -5117,6 +5332,8 @@ DL_OPT_PORT_FN_RATE_NODE_NAME, DL_OPT_PORT_FN_RATE_TX_SHARE | DL_OPT_PORT_FN_RATE_TX_MAX | + DL_OPT_PORT_FN_RATE_TX_PRIORITY | + DL_OPT_PORT_FN_RATE_TX_WEIGHT | DL_OPT_PORT_FN_RATE_PARENT); if (err) return err; @@ -6011,7 +6228,8 @@ list_for_each_entry(occ_port, &occ_show->port_list, list) { __pr_out_port_handle_start(dl, opts->bus_name, opts->dev_name, - occ_port->port_index, true, false); + occ_port->port_index, NULL, + true, false); pr_out_occ_show_port(dl, occ_port); pr_out_port_handle_end(dl); } @@ -6522,6 +6740,7 @@ return MNL_CB_ERROR; pr_out_mon_header(genl->cmd); pr_out_trap_policer(dl, tb, false); + pr_out_mon_footer(); break; case DEVLINK_CMD_LINECARD_GET: /* fall through */ case DEVLINK_CMD_LINECARD_SET: /* fall through */ @@ -8555,8 +8774,8 @@ int err; err = dl_argv_parse(dl, DL_OPT_HANDLE_REGION | DL_OPT_REGION_ADDRESS | - DL_OPT_REGION_LENGTH | DL_OPT_REGION_SNAPSHOT_ID, - 0); + DL_OPT_REGION_LENGTH, + DL_OPT_REGION_SNAPSHOT_ID); if (err) return err; @@ -8565,6 +8784,10 @@ dl_opts_put(nlh, dl); + /* If user didn't provide a snapshot id, perform a direct read */ + if (!(dl->opts.present & DL_OPT_REGION_SNAPSHOT_ID)) + mnl_attr_put(nlh, DEVLINK_ATTR_REGION_DIRECT, 0, NULL); + pr_out_section_start(dl, "read"); err = mnlu_gen_socket_sndrcv(&dl->nlg, nlh, cmd_region_read_cb, dl); pr_out_section_end(dl);
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/devlink/mnlg.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/devlink/mnlg.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * mnlg.c Generic Netlink helpers for libmnl * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Jiri Pirko <jiri@mellanox.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/devlink/mnlg.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/devlink/mnlg.h
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * mnlg.h Generic Netlink helpers for libmnl * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Jiri Pirko <jiri@mellanox.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/genl/ctrl.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/genl/ctrl.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * ctrl.c generic netlink controller * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: J Hadi Salim (hadi@cyberus.ca) * Johannes Berg (johannes@sipsolutions.net) */ @@ -61,7 +57,7 @@ fprintf(fp, "\n"); } -static int print_ctrl_cmds(FILE *fp, struct rtattr *arg, __u32 ctrl_ver) +static int print_ctrl_cmds(FILE *fp, struct rtattr *arg) { struct rtattr *tbCTRL_ATTR_OP_MAX + 1; @@ -74,7 +70,7 @@ fprintf(fp, " ID-0x%x ",*id); } /* we are only gonna do this for newer version of the controller */ - if (tbCTRL_ATTR_OP_FLAGS && ctrl_ver >= 0x2) { + if (tbCTRL_ATTR_OP_FLAGS) { __u32 *fl = RTA_DATA(tbCTRL_ATTR_OP_FLAGS); print_ctrl_cmd_flags(fp, *fl); } @@ -82,7 +78,7 @@ } -static int print_ctrl_grp(FILE *fp, struct rtattr *arg, __u32 ctrl_ver) +static int print_ctrl_grp(FILE *fp, struct rtattr *arg) { struct rtattr *tbCTRL_ATTR_MCAST_GRP_MAX + 1; @@ -113,7 +109,6 @@ int len = n->nlmsg_len; struct rtattr *attrs; FILE *fp = (FILE *) arg; - __u32 ctrl_v = 0x1; if (n->nlmsg_type != GENL_ID_CTRL) { fprintf(stderr, "Not a controller message, nlmsg_len=%d " @@ -152,7 +147,6 @@ if (tbCTRL_ATTR_VERSION) { __u32 *v = RTA_DATA(tbCTRL_ATTR_VERSION); fprintf(fp, " Version: 0x%x ",*v); - ctrl_v = *v; } if (tbCTRL_ATTR_HDRSIZE) { __u32 *h = RTA_DATA(tbCTRL_ATTR_HDRSIZE); @@ -202,7 +196,7 @@ for (i = 0; i < GENL_MAX_FAM_OPS; i++) { if (tb2i) { fprintf(fp, "\t\t#%d: ", i); - if (0 > print_ctrl_cmds(fp, tb2i, ctrl_v)) { + if (0 > print_ctrl_cmds(fp, tb2i)) { fprintf(fp, "Error printing command\n"); } /* for next command */ @@ -225,7 +219,7 @@ for (i = 0; i < GENL_MAX_FAM_GRPS; i++) { if (tb2i) { fprintf(fp, "\t\t#%d: ", i); - if (0 > print_ctrl_grp(fp, tb2i, ctrl_v)) + if (0 > print_ctrl_grp(fp, tb2i)) fprintf(fp, "Error printing group\n"); /* for next group */ fprintf(fp,"\n");
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/genl/genl.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/genl/genl.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * genl.c "genl" utility frontend. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Jamal Hadi Salim - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/json_print.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/json_print.h
Changed
@@ -101,6 +101,15 @@ return print_color_rate(use_iec, t, COLOR_NONE, key, fmt, rate); } +int print_color_bool_opt(enum output_type type, enum color_attr color, + const char *key, bool value, bool show); + +static inline int print_bool_opt(enum output_type type, + const char *key, bool value, bool show) +{ + return print_color_bool_opt(type, COLOR_NONE, key, value, show); +} + /* A backdoor to the size formatter. Please use print_size() instead. */ char *sprint_size(__u32 sz, char *buf);
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/libnetlink.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/libnetlink.h
Changed
@@ -177,9 +177,6 @@ int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, struct nlmsghdr **answer) __attribute__((warn_unused_result)); -int rtnl_talk_iov(struct rtnl_handle *rtnl, struct iovec *iovec, size_t iovlen, - struct nlmsghdr **answer) - __attribute__((warn_unused_result)); int rtnl_talk_suppress_rtnl_errmsg(struct rtnl_handle *rtnl, struct nlmsghdr *n, struct nlmsghdr **answer) __attribute__((warn_unused_result));
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/rt_names.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/rt_names.h
Changed
@@ -5,6 +5,7 @@ #include <asm/types.h> const char *rtnl_rtprot_n2a(int id, char *buf, int len); +const char *rtnl_addrprot_n2a(__u8 id, char *buf, int len); const char *rtnl_rtscope_n2a(int id, char *buf, int len); const char *rtnl_rttable_n2a(__u32 id, char *buf, int len); const char *rtnl_rtrealm_n2a(int id, char *buf, int len); @@ -13,6 +14,7 @@ const char *rtnl_group_n2a(int id, char *buf, int len); int rtnl_rtprot_a2n(__u32 *id, const char *arg); +int rtnl_addrprot_a2n(__u8 *id, const char *arg); int rtnl_rtscope_a2n(__u32 *id, const char *arg); int rtnl_rttable_a2n(__u32 *id, const char *arg); int rtnl_rtrealm_a2n(__u32 *id, const char *arg);
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/atmdev.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/atmdev.h
Changed
@@ -101,10 +101,6 @@ /* use backend to make new if */ #define ATM_ADDPARTY _IOW('a', ATMIOC_SPECIAL+4,struct atm_iobuf) /* add party to p2mp call */ -#ifdef CONFIG_COMPAT -/* It actually takes struct sockaddr_atmsvc, not struct atm_iobuf */ -#define COMPAT_ATM_ADDPARTY _IOW('a', ATMIOC_SPECIAL+4,struct compat_atm_iobuf) -#endif #define ATM_DROPPARTY _IOW('a', ATMIOC_SPECIAL+5,int) /* drop party from p2mp call */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/bpf.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/bpf.h
Changed
@@ -922,7 +922,14 @@ BPF_MAP_TYPE_CPUMAP, BPF_MAP_TYPE_XSKMAP, BPF_MAP_TYPE_SOCKHASH, - BPF_MAP_TYPE_CGROUP_STORAGE, + BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED, + /* BPF_MAP_TYPE_CGROUP_STORAGE is available to bpf programs attaching + * to a cgroup. The newer BPF_MAP_TYPE_CGRP_STORAGE is available to + * both cgroup-attached and other progs and supports all functionality + * provided by BPF_MAP_TYPE_CGROUP_STORAGE. So mark + * BPF_MAP_TYPE_CGROUP_STORAGE deprecated. + */ + BPF_MAP_TYPE_CGROUP_STORAGE = BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED, BPF_MAP_TYPE_REUSEPORT_SOCKARRAY, BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE, BPF_MAP_TYPE_QUEUE, @@ -935,6 +942,7 @@ BPF_MAP_TYPE_TASK_STORAGE, BPF_MAP_TYPE_BLOOM_FILTER, BPF_MAP_TYPE_USER_RINGBUF, + BPF_MAP_TYPE_CGRP_STORAGE, }; /* Note that tracing related programs such as @@ -978,6 +986,7 @@ BPF_PROG_TYPE_LSM, BPF_PROG_TYPE_SK_LOOKUP, BPF_PROG_TYPE_SYSCALL, /* a program that can execute syscalls */ + BPF_PROG_TYPE_NETFILTER, }; enum bpf_attach_type { @@ -1025,6 +1034,8 @@ BPF_PERF_EVENT, BPF_TRACE_KPROBE_MULTI, BPF_LSM_CGROUP, + BPF_STRUCT_OPS, + BPF_NETFILTER, __MAX_BPF_ATTACH_TYPE }; @@ -1041,6 +1052,7 @@ BPF_LINK_TYPE_PERF_EVENT = 7, BPF_LINK_TYPE_KPROBE_MULTI = 8, BPF_LINK_TYPE_STRUCT_OPS = 9, + BPF_LINK_TYPE_NETFILTER = 10, MAX_BPF_LINK_TYPE, }; @@ -1100,7 +1112,7 @@ */ #define BPF_F_STRICT_ALIGNMENT (1U << 0) -/* If BPF_F_ANY_ALIGNMENT is used in BPF_PROF_LOAD command, the +/* If BPF_F_ANY_ALIGNMENT is used in BPF_PROG_LOAD command, the * verifier will allow any alignment whatsoever. On platforms * with strict alignment requirements for loads ands stores (such * as sparc and mips) the verifier validates that all loads and @@ -1148,6 +1160,11 @@ */ #define BPF_F_XDP_HAS_FRAGS (1U << 5) +/* If BPF_F_XDP_DEV_BOUND_ONLY is used in BPF_PROG_LOAD command, the loaded + * program becomes device-bound but can access XDP metadata. + */ +#define BPF_F_XDP_DEV_BOUND_ONLY (1U << 6) + /* link_create.kprobe_multi.flags used in LINK_CREATE command for * BPF_TRACE_KPROBE_MULTI attach type to create return probe. */ @@ -1253,6 +1270,9 @@ /* Create a map that is suitable to be an inner map with dynamic max entries */ BPF_F_INNER_MAP = (1U << 12), + +/* Create a map that will be registered/unregesitered by the backed bpf_link */ + BPF_F_LINK = (1U << 13), }; /* Flags for BPF_PROG_QUERY. */ @@ -1390,6 +1410,11 @@ __aligned_u64 fd_array; /* array of FDs */ __aligned_u64 core_relos; __u32 core_relo_rec_size; /* sizeof(struct bpf_core_relo) */ + /* output: actual total log contents size (including termintaing zero). + * It could be both larger than original log_size (if log was + * truncated), or smaller (if log buffer wasn't filled completely). + */ + __u32 log_true_size; }; struct { /* anonymous struct used by BPF_OBJ_* commands */ @@ -1475,6 +1500,11 @@ __u32 btf_size; __u32 btf_log_size; __u32 btf_log_level; + /* output: actual total log contents size (including termintaing zero). + * It could be both larger than original log_size (if log was + * truncated), or smaller (if log buffer wasn't filled completely). + */ + __u32 btf_log_true_size; }; struct { @@ -1494,7 +1524,10 @@ } task_fd_query; struct { /* struct used by BPF_LINK_CREATE command */ - __u32 prog_fd; /* eBPF program to attach */ + union { + __u32 prog_fd; /* eBPF program to attach */ + __u32 map_fd; /* struct_ops to attach */ + }; union { __u32 target_fd; /* object to attach to */ __u32 target_ifindex; /* target ifindex */ @@ -1530,17 +1563,34 @@ */ __u64 cookie; } tracing; + struct { + __u32 pf; + __u32 hooknum; + __s32 priority; + __u32 flags; + } netfilter; }; } link_create; struct { /* struct used by BPF_LINK_UPDATE command */ __u32 link_fd; /* link fd */ - /* new program fd to update link with */ - __u32 new_prog_fd; + union { + /* new program fd to update link with */ + __u32 new_prog_fd; + /* new struct_ops map fd to update link with */ + __u32 new_map_fd; + }; __u32 flags; /* extra flags */ - /* expected link's program fd; is specified only if - * BPF_F_REPLACE flag is set in flags */ - __u32 old_prog_fd; + union { + /* expected link's program fd; is specified only if + * BPF_F_REPLACE flag is set in flags. + */ + __u32 old_prog_fd; + /* expected link's map fd; is specified only + * if BPF_F_REPLACE flag is set. + */ + __u32 old_map_fd; + }; } link_update; struct { @@ -1634,17 +1684,17 @@ * Description * This helper is a "printk()-like" facility for debugging. It * prints a message defined by format *fmt* (of size *fmt_size*) - * to file *\/sys/kernel/debug/tracing/trace* from DebugFS, if + * to file *\/sys/kernel/tracing/trace* from TraceFS, if * available. It can take up to three additional **u64** * arguments (as an eBPF helpers, the total number of arguments is * limited to five). * * Each time the helper is called, it appends a line to the trace. - * Lines are discarded while *\/sys/kernel/debug/tracing/trace* is - * open, use *\/sys/kernel/debug/tracing/trace_pipe* to avoid this. + * Lines are discarded while *\/sys/kernel/tracing/trace* is + * open, use *\/sys/kernel/tracing/trace_pipe* to avoid this. * The format of the trace is customizable, and the exact output * one will get depends on the options set in - * *\/sys/kernel/debug/tracing/trace_options* (see also the + * *\/sys/kernel/tracing/trace_options* (see also the * *README* file under the same directory). However, it usually * defaults to something like: * @@ -1993,6 +2043,9 @@ * sending the packet. This flag was added for GRE * encapsulation, but might be used with other protocols * as well in the future. + * **BPF_F_NO_TUNNEL_KEY** + * Add a flag to tunnel metadata indicating that no tunnel + * key should be set in the resulting tunnel header. * * Here is a typical usage on the transmit path: * @@ -2576,14 +2629,19 @@ * * **SOL_SOCKET**, which supports the following *optname*\ s: * **SO_RCVBUF**, **SO_SNDBUF**, **SO_MAX_PACING_RATE**, * **SO_PRIORITY**, **SO_RCVLOWAT**, **SO_MARK**, - * **SO_BINDTODEVICE**, **SO_KEEPALIVE**. + * **SO_BINDTODEVICE**, **SO_KEEPALIVE**, **SO_REUSEADDR**, + * **SO_REUSEPORT**, **SO_BINDTOIFINDEX**, **SO_TXREHASH**. * * **IPPROTO_TCP**, which supports the following *optname*\ s: * **TCP_CONGESTION**, **TCP_BPF_IW**, * **TCP_BPF_SNDCWND_CLAMP**, **TCP_SAVE_SYN**, * **TCP_KEEPIDLE**, **TCP_KEEPINTVL**, **TCP_KEEPCNT**, - * **TCP_SYNCNT**, **TCP_USER_TIMEOUT**, **TCP_NOTSENT_LOWAT**. + * **TCP_SYNCNT**, **TCP_USER_TIMEOUT**, **TCP_NOTSENT_LOWAT**, + * **TCP_NODELAY**, **TCP_MAXSEG**, **TCP_WINDOW_CLAMP**, + * **TCP_THIN_LINEAR_TIMEOUTS**, **TCP_BPF_DELACK_MAX**, + * **TCP_BPF_RTO_MIN**. * * **IPPROTO_IP**, which supports *optname* **IP_TOS**. - * * **IPPROTO_IPV6**, which supports *optname* **IPV6_TCLASS**. + * * **IPPROTO_IPV6**, which supports the following *optname*\ s: + * **IPV6_TCLASS**, **IPV6_AUTOFLOWLABEL**. * Return * 0 on success, or a negative error in case of failure. * @@ -2631,6 +2689,11 @@ * Use with BPF_F_ADJ_ROOM_ENCAP_L2 flag to further specify the * L2 type as Ethernet. * + * * **BPF_F_ADJ_ROOM_DECAP_L3_IPV4**, + * **BPF_F_ADJ_ROOM_DECAP_L3_IPV6**: + * Indicate the new IP header version after decapsulating the outer + * IP header. Used when the inner and outer IP versions are different. + * * A call to this helper is susceptible to change the underlying * packet buffer. Therefore, at load time, all checks on pointers * previously done by the verifier are invalidated and must be @@ -2639,7 +2702,7 @@ * Return * 0 on success, or a negative error in case of failure. * - * long bpf_redirect_map(struct bpf_map *map, u32 key, u64 flags) + * long bpf_redirect_map(struct bpf_map *map, u64 key, u64 flags) * Description * Redirect the packet to the endpoint referenced by *map* at * index *key*. Depending on its type, this *map* can contain @@ -2775,7 +2838,7 @@ * * long bpf_perf_prog_read_value(struct bpf_perf_event_data *ctx, struct bpf_perf_event_value *buf, u32 buf_size) * Description - * For en eBPF program attached to a perf event, retrieve the + * For an eBPF program attached to a perf event, retrieve the * value of the event counter associated to *ctx* and store it in * the structure pointed by *buf* and of size *buf_size*. Enabled * and running times are also stored in the structure (see @@ -2800,12 +2863,10 @@ * and **BPF_CGROUP_INET6_CONNECT**. * * This helper actually implements a subset of **getsockopt()**. - * It supports the following *level*\ s: - * - * * **IPPROTO_TCP**, which supports *optname* - * **TCP_CONGESTION**. - * * **IPPROTO_IP**, which supports *optname* **IP_TOS**. - * * **IPPROTO_IPV6**, which supports *optname* **IPV6_TCLASS**. + * It supports the same set of *optname*\ s that is supported by + * the **bpf_setsockopt**\ () helper. The exceptions are + * **TCP_BPF_*** is **bpf_setsockopt**\ () only and + * **TCP_SAVED_SYN** is **bpf_getsockopt**\ () only. * Return * 0 on success, or a negative error in case of failure. * @@ -3110,6 +3171,11 @@ * **BPF_FIB_LOOKUP_OUTPUT** * Perform lookup from an egress perspective (default is * ingress). + * **BPF_FIB_LOOKUP_SKIP_NEIGH** + * Skip the neighbour table lookup. *params*->dmac + * and *params*->smac will not be set as output. A common + * use case is to call **bpf_redirect_neigh**\ () after + * doing **bpf_fib_lookup**\ (). * * *ctx* is either **struct xdp_md** for XDP programs or * **struct sk_buff** tc cls_act programs. @@ -4940,6 +5006,12 @@ * different maps if key/value layout matches across maps. * Every bpf_timer_set_callback() can have different callback_fn. * + * *flags* can be one of: + * + * **BPF_F_TIMER_ABS** + * Start the timer in absolute expire value instead of the + * default relative one. + * * Return * 0 on success. * **-EINVAL** if *timer* was not initialized with bpf_timer_init() earlier @@ -5282,7 +5354,7 @@ * Return * Nothing. Always succeeds. * - * long bpf_dynptr_read(void *dst, u32 len, struct bpf_dynptr *src, u32 offset, u64 flags) + * long bpf_dynptr_read(void *dst, u32 len, const struct bpf_dynptr *src, u32 offset, u64 flags) * Description * Read *len* bytes from *src* into *dst*, starting from *offset* * into *src*. @@ -5292,22 +5364,36 @@ * of *src*'s data, -EINVAL if *src* is an invalid dynptr or if * *flags* is not 0. * - * long bpf_dynptr_write(struct bpf_dynptr *dst, u32 offset, void *src, u32 len, u64 flags) + * long bpf_dynptr_write(const struct bpf_dynptr *dst, u32 offset, void *src, u32 len, u64 flags) * Description * Write *len* bytes from *src* into *dst*, starting from *offset* * into *dst*. - * *flags* is currently unused. + * + * *flags* must be 0 except for skb-type dynptrs. + * + * For skb-type dynptrs: + * * All data slices of the dynptr are automatically + * invalidated after **bpf_dynptr_write**\ (). This is + * because writing may pull the skb and change the + * underlying packet buffer. + * + * * For *flags*, please see the flags accepted by + * **bpf_skb_store_bytes**\ (). * Return * 0 on success, -E2BIG if *offset* + *len* exceeds the length * of *dst*'s data, -EINVAL if *dst* is an invalid dynptr or if *dst* - * is a read-only dynptr or if *flags* is not 0. + * is a read-only dynptr or if *flags* is not correct. For skb-type dynptrs, + * other errors correspond to errors returned by **bpf_skb_store_bytes**\ (). * - * void *bpf_dynptr_data(struct bpf_dynptr *ptr, u32 offset, u32 len) + * void *bpf_dynptr_data(const struct bpf_dynptr *ptr, u32 offset, u32 len) * Description * Get a pointer to the underlying dynptr data. * * *len* must be a statically known value. The returned data slice * is invalidated whenever the dynptr is invalidated. + * + * skb and xdp type dynptrs may not use bpf_dynptr_data. They should + * instead use bpf_dynptr_slice and bpf_dynptr_slice_rdwr. * Return * Pointer to the underlying dynptr data, NULL if the dynptr is * read-only, if the dynptr is invalid, or if the offset and length @@ -5403,7 +5489,7 @@ * Drain samples from the specified user ring buffer, and invoke * the provided callback for each such sample: * - * long (\*callback_fn)(struct bpf_dynptr \*dynptr, void \*ctx); + * long (\*callback_fn)(const struct bpf_dynptr \*dynptr, void \*ctx); * * If **callback_fn** returns 0, the helper will continue to try * and drain the next sample, up to a maximum of @@ -5435,226 +5521,272 @@ * **-E2BIG** if user-space has tried to publish a sample which is * larger than the size of the ring buffer, or which cannot fit * within a struct bpf_dynptr. + * + * void *bpf_cgrp_storage_get(struct bpf_map *map, struct cgroup *cgroup, void *value, u64 flags) + * Description + * Get a bpf_local_storage from the *cgroup*. + * + * Logically, it could be thought of as getting the value from + * a *map* with *cgroup* as the **key**. From this + * perspective, the usage is not much different from + * **bpf_map_lookup_elem**\ (*map*, **&**\ *cgroup*) except this + * helper enforces the key must be a cgroup struct and the map must also + * be a **BPF_MAP_TYPE_CGRP_STORAGE**. + * + * In reality, the local-storage value is embedded directly inside of the + * *cgroup* object itself, rather than being located in the + * **BPF_MAP_TYPE_CGRP_STORAGE** map. When the local-storage value is + * queried for some *map* on a *cgroup* object, the kernel will perform an + * O(n) iteration over all of the live local-storage values for that + * *cgroup* object until the local-storage value for the *map* is found. + * + * An optional *flags* (**BPF_LOCAL_STORAGE_GET_F_CREATE**) can be + * used such that a new bpf_local_storage will be + * created if one does not exist. *value* can be used + * together with **BPF_LOCAL_STORAGE_GET_F_CREATE** to specify + * the initial value of a bpf_local_storage. If *value* is + * **NULL**, the new bpf_local_storage will be zero initialized. + * Return + * A bpf_local_storage pointer is returned on success. + * + * **NULL** if not found or there was an error in adding + * a new bpf_local_storage. + * + * long bpf_cgrp_storage_delete(struct bpf_map *map, struct cgroup *cgroup) + * Description + * Delete a bpf_local_storage from a *cgroup*. + * Return + * 0 on success. + * + * **-ENOENT** if the bpf_local_storage cannot be found. */ -#define __BPF_FUNC_MAPPER(FN) \ - FN(unspec), \ - FN(map_lookup_elem), \ - FN(map_update_elem), \ - FN(map_delete_elem), \ - FN(probe_read), \ - FN(ktime_get_ns), \ - FN(trace_printk), \ - FN(get_prandom_u32), \ - FN(get_smp_processor_id), \ - FN(skb_store_bytes), \ - FN(l3_csum_replace), \ - FN(l4_csum_replace), \ - FN(tail_call), \ - FN(clone_redirect), \ - FN(get_current_pid_tgid), \ - FN(get_current_uid_gid), \ - FN(get_current_comm), \ - FN(get_cgroup_classid), \ - FN(skb_vlan_push), \ - FN(skb_vlan_pop), \ - FN(skb_get_tunnel_key), \ - FN(skb_set_tunnel_key), \ - FN(perf_event_read), \ - FN(redirect), \ - FN(get_route_realm), \ - FN(perf_event_output), \ - FN(skb_load_bytes), \ - FN(get_stackid), \ - FN(csum_diff), \ - FN(skb_get_tunnel_opt), \ - FN(skb_set_tunnel_opt), \ - FN(skb_change_proto), \ - FN(skb_change_type), \ - FN(skb_under_cgroup), \ - FN(get_hash_recalc), \ - FN(get_current_task), \ - FN(probe_write_user), \ - FN(current_task_under_cgroup), \ - FN(skb_change_tail), \ - FN(skb_pull_data), \ - FN(csum_update), \ - FN(set_hash_invalid), \ - FN(get_numa_node_id), \ - FN(skb_change_head), \ - FN(xdp_adjust_head), \ - FN(probe_read_str), \ - FN(get_socket_cookie), \ - FN(get_socket_uid), \ - FN(set_hash), \ - FN(setsockopt), \ - FN(skb_adjust_room), \ - FN(redirect_map), \ - FN(sk_redirect_map), \ - FN(sock_map_update), \ - FN(xdp_adjust_meta), \ - FN(perf_event_read_value), \ - FN(perf_prog_read_value), \ - FN(getsockopt), \ - FN(override_return), \ - FN(sock_ops_cb_flags_set), \ - FN(msg_redirect_map), \ - FN(msg_apply_bytes), \ - FN(msg_cork_bytes), \ - FN(msg_pull_data), \ - FN(bind), \ - FN(xdp_adjust_tail), \ - FN(skb_get_xfrm_state), \ - FN(get_stack), \ - FN(skb_load_bytes_relative), \ - FN(fib_lookup), \ - FN(sock_hash_update), \ - FN(msg_redirect_hash), \ - FN(sk_redirect_hash), \ - FN(lwt_push_encap), \ - FN(lwt_seg6_store_bytes), \ - FN(lwt_seg6_adjust_srh), \ - FN(lwt_seg6_action), \ - FN(rc_repeat), \ - FN(rc_keydown), \ - FN(skb_cgroup_id), \ - FN(get_current_cgroup_id), \ - FN(get_local_storage), \ - FN(sk_select_reuseport), \ - FN(skb_ancestor_cgroup_id), \ - FN(sk_lookup_tcp), \ - FN(sk_lookup_udp), \ - FN(sk_release), \ - FN(map_push_elem), \ - FN(map_pop_elem), \ - FN(map_peek_elem), \ - FN(msg_push_data), \ - FN(msg_pop_data), \ - FN(rc_pointer_rel), \ - FN(spin_lock), \ - FN(spin_unlock), \ - FN(sk_fullsock), \ - FN(tcp_sock), \ - FN(skb_ecn_set_ce), \ - FN(get_listener_sock), \ - FN(skc_lookup_tcp), \ - FN(tcp_check_syncookie), \ - FN(sysctl_get_name), \ - FN(sysctl_get_current_value), \ - FN(sysctl_get_new_value), \ - FN(sysctl_set_new_value), \ - FN(strtol), \ - FN(strtoul), \ - FN(sk_storage_get), \ - FN(sk_storage_delete), \ - FN(send_signal), \ - FN(tcp_gen_syncookie), \ - FN(skb_output), \ - FN(probe_read_user), \ - FN(probe_read_kernel), \ - FN(probe_read_user_str), \ - FN(probe_read_kernel_str), \ - FN(tcp_send_ack), \ - FN(send_signal_thread), \ - FN(jiffies64), \ - FN(read_branch_records), \ - FN(get_ns_current_pid_tgid), \ - FN(xdp_output), \ - FN(get_netns_cookie), \ - FN(get_current_ancestor_cgroup_id), \ - FN(sk_assign), \ - FN(ktime_get_boot_ns), \ - FN(seq_printf), \ - FN(seq_write), \ - FN(sk_cgroup_id), \ - FN(sk_ancestor_cgroup_id), \ - FN(ringbuf_output), \ - FN(ringbuf_reserve), \ - FN(ringbuf_submit), \ - FN(ringbuf_discard), \ - FN(ringbuf_query), \ - FN(csum_level), \ - FN(skc_to_tcp6_sock), \ - FN(skc_to_tcp_sock), \ - FN(skc_to_tcp_timewait_sock), \ - FN(skc_to_tcp_request_sock), \ - FN(skc_to_udp6_sock), \ - FN(get_task_stack), \ - FN(load_hdr_opt), \ - FN(store_hdr_opt), \ - FN(reserve_hdr_opt), \ - FN(inode_storage_get), \ - FN(inode_storage_delete), \ - FN(d_path), \ - FN(copy_from_user), \ - FN(snprintf_btf), \ - FN(seq_printf_btf), \ - FN(skb_cgroup_classid), \ - FN(redirect_neigh), \ - FN(per_cpu_ptr), \ - FN(this_cpu_ptr), \ - FN(redirect_peer), \ - FN(task_storage_get), \ - FN(task_storage_delete), \ - FN(get_current_task_btf), \ - FN(bprm_opts_set), \ - FN(ktime_get_coarse_ns), \ - FN(ima_inode_hash), \ - FN(sock_from_file), \ - FN(check_mtu), \ - FN(for_each_map_elem), \ - FN(snprintf), \ - FN(sys_bpf), \ - FN(btf_find_by_name_kind), \ - FN(sys_close), \ - FN(timer_init), \ - FN(timer_set_callback), \ - FN(timer_start), \ - FN(timer_cancel), \ - FN(get_func_ip), \ - FN(get_attach_cookie), \ - FN(task_pt_regs), \ - FN(get_branch_snapshot), \ - FN(trace_vprintk), \ - FN(skc_to_unix_sock), \ - FN(kallsyms_lookup_name), \ - FN(find_vma), \ - FN(loop), \ - FN(strncmp), \ - FN(get_func_arg), \ - FN(get_func_ret), \ - FN(get_func_arg_cnt), \ - FN(get_retval), \ - FN(set_retval), \ - FN(xdp_get_buff_len), \ - FN(xdp_load_bytes), \ - FN(xdp_store_bytes), \ - FN(copy_from_user_task), \ - FN(skb_set_tstamp), \ - FN(ima_file_hash), \ - FN(kptr_xchg), \ - FN(map_lookup_percpu_elem), \ - FN(skc_to_mptcp_sock), \ - FN(dynptr_from_mem), \ - FN(ringbuf_reserve_dynptr), \ - FN(ringbuf_submit_dynptr), \ - FN(ringbuf_discard_dynptr), \ - FN(dynptr_read), \ - FN(dynptr_write), \ - FN(dynptr_data), \ - FN(tcp_raw_gen_syncookie_ipv4), \ - FN(tcp_raw_gen_syncookie_ipv6), \ - FN(tcp_raw_check_syncookie_ipv4), \ - FN(tcp_raw_check_syncookie_ipv6), \ - FN(ktime_get_tai_ns), \ - FN(user_ringbuf_drain), \ +#define ___BPF_FUNC_MAPPER(FN, ctx...) \ + FN(unspec, 0, ##ctx) \ + FN(map_lookup_elem, 1, ##ctx) \ + FN(map_update_elem, 2, ##ctx) \ + FN(map_delete_elem, 3, ##ctx) \ + FN(probe_read, 4, ##ctx) \ + FN(ktime_get_ns, 5, ##ctx) \ + FN(trace_printk, 6, ##ctx) \ + FN(get_prandom_u32, 7, ##ctx) \ + FN(get_smp_processor_id, 8, ##ctx) \ + FN(skb_store_bytes, 9, ##ctx) \ + FN(l3_csum_replace, 10, ##ctx) \ + FN(l4_csum_replace, 11, ##ctx) \ + FN(tail_call, 12, ##ctx) \ + FN(clone_redirect, 13, ##ctx) \ + FN(get_current_pid_tgid, 14, ##ctx) \ + FN(get_current_uid_gid, 15, ##ctx) \ + FN(get_current_comm, 16, ##ctx) \ + FN(get_cgroup_classid, 17, ##ctx) \ + FN(skb_vlan_push, 18, ##ctx) \ + FN(skb_vlan_pop, 19, ##ctx) \ + FN(skb_get_tunnel_key, 20, ##ctx) \ + FN(skb_set_tunnel_key, 21, ##ctx) \ + FN(perf_event_read, 22, ##ctx) \ + FN(redirect, 23, ##ctx) \ + FN(get_route_realm, 24, ##ctx) \ + FN(perf_event_output, 25, ##ctx) \ + FN(skb_load_bytes, 26, ##ctx) \ + FN(get_stackid, 27, ##ctx) \ + FN(csum_diff, 28, ##ctx) \ + FN(skb_get_tunnel_opt, 29, ##ctx) \ + FN(skb_set_tunnel_opt, 30, ##ctx) \ + FN(skb_change_proto, 31, ##ctx) \ + FN(skb_change_type, 32, ##ctx) \ + FN(skb_under_cgroup, 33, ##ctx) \ + FN(get_hash_recalc, 34, ##ctx) \ + FN(get_current_task, 35, ##ctx) \ + FN(probe_write_user, 36, ##ctx) \ + FN(current_task_under_cgroup, 37, ##ctx) \ + FN(skb_change_tail, 38, ##ctx) \ + FN(skb_pull_data, 39, ##ctx) \ + FN(csum_update, 40, ##ctx) \ + FN(set_hash_invalid, 41, ##ctx) \ + FN(get_numa_node_id, 42, ##ctx) \ + FN(skb_change_head, 43, ##ctx) \ + FN(xdp_adjust_head, 44, ##ctx) \ + FN(probe_read_str, 45, ##ctx) \ + FN(get_socket_cookie, 46, ##ctx) \ + FN(get_socket_uid, 47, ##ctx) \ + FN(set_hash, 48, ##ctx) \ + FN(setsockopt, 49, ##ctx) \ + FN(skb_adjust_room, 50, ##ctx) \ + FN(redirect_map, 51, ##ctx) \ + FN(sk_redirect_map, 52, ##ctx) \ + FN(sock_map_update, 53, ##ctx) \ + FN(xdp_adjust_meta, 54, ##ctx) \ + FN(perf_event_read_value, 55, ##ctx) \ + FN(perf_prog_read_value, 56, ##ctx) \ + FN(getsockopt, 57, ##ctx) \ + FN(override_return, 58, ##ctx) \ + FN(sock_ops_cb_flags_set, 59, ##ctx) \ + FN(msg_redirect_map, 60, ##ctx) \ + FN(msg_apply_bytes, 61, ##ctx) \ + FN(msg_cork_bytes, 62, ##ctx) \ + FN(msg_pull_data, 63, ##ctx) \ + FN(bind, 64, ##ctx) \ + FN(xdp_adjust_tail, 65, ##ctx) \ + FN(skb_get_xfrm_state, 66, ##ctx) \ + FN(get_stack, 67, ##ctx) \ + FN(skb_load_bytes_relative, 68, ##ctx) \ + FN(fib_lookup, 69, ##ctx) \ + FN(sock_hash_update, 70, ##ctx) \ + FN(msg_redirect_hash, 71, ##ctx) \ + FN(sk_redirect_hash, 72, ##ctx) \ + FN(lwt_push_encap, 73, ##ctx) \ + FN(lwt_seg6_store_bytes, 74, ##ctx) \ + FN(lwt_seg6_adjust_srh, 75, ##ctx) \ + FN(lwt_seg6_action, 76, ##ctx) \ + FN(rc_repeat, 77, ##ctx) \ + FN(rc_keydown, 78, ##ctx) \ + FN(skb_cgroup_id, 79, ##ctx) \ + FN(get_current_cgroup_id, 80, ##ctx) \ + FN(get_local_storage, 81, ##ctx) \ + FN(sk_select_reuseport, 82, ##ctx) \ + FN(skb_ancestor_cgroup_id, 83, ##ctx) \ + FN(sk_lookup_tcp, 84, ##ctx) \ + FN(sk_lookup_udp, 85, ##ctx) \ + FN(sk_release, 86, ##ctx) \ + FN(map_push_elem, 87, ##ctx) \ + FN(map_pop_elem, 88, ##ctx) \ + FN(map_peek_elem, 89, ##ctx) \ + FN(msg_push_data, 90, ##ctx) \ + FN(msg_pop_data, 91, ##ctx) \ + FN(rc_pointer_rel, 92, ##ctx) \ + FN(spin_lock, 93, ##ctx) \ + FN(spin_unlock, 94, ##ctx) \ + FN(sk_fullsock, 95, ##ctx) \ + FN(tcp_sock, 96, ##ctx) \ + FN(skb_ecn_set_ce, 97, ##ctx) \ + FN(get_listener_sock, 98, ##ctx) \ + FN(skc_lookup_tcp, 99, ##ctx) \ + FN(tcp_check_syncookie, 100, ##ctx) \ + FN(sysctl_get_name, 101, ##ctx) \ + FN(sysctl_get_current_value, 102, ##ctx) \ + FN(sysctl_get_new_value, 103, ##ctx) \ + FN(sysctl_set_new_value, 104, ##ctx) \ + FN(strtol, 105, ##ctx) \ + FN(strtoul, 106, ##ctx) \ + FN(sk_storage_get, 107, ##ctx) \ + FN(sk_storage_delete, 108, ##ctx) \ + FN(send_signal, 109, ##ctx) \ + FN(tcp_gen_syncookie, 110, ##ctx) \ + FN(skb_output, 111, ##ctx) \ + FN(probe_read_user, 112, ##ctx) \ + FN(probe_read_kernel, 113, ##ctx) \ + FN(probe_read_user_str, 114, ##ctx) \ + FN(probe_read_kernel_str, 115, ##ctx) \ + FN(tcp_send_ack, 116, ##ctx) \ + FN(send_signal_thread, 117, ##ctx) \ + FN(jiffies64, 118, ##ctx) \ + FN(read_branch_records, 119, ##ctx) \ + FN(get_ns_current_pid_tgid, 120, ##ctx) \ + FN(xdp_output, 121, ##ctx) \ + FN(get_netns_cookie, 122, ##ctx) \ + FN(get_current_ancestor_cgroup_id, 123, ##ctx) \ + FN(sk_assign, 124, ##ctx) \ + FN(ktime_get_boot_ns, 125, ##ctx) \ + FN(seq_printf, 126, ##ctx) \ + FN(seq_write, 127, ##ctx) \ + FN(sk_cgroup_id, 128, ##ctx) \ + FN(sk_ancestor_cgroup_id, 129, ##ctx) \ + FN(ringbuf_output, 130, ##ctx) \ + FN(ringbuf_reserve, 131, ##ctx) \ + FN(ringbuf_submit, 132, ##ctx) \ + FN(ringbuf_discard, 133, ##ctx) \ + FN(ringbuf_query, 134, ##ctx) \ + FN(csum_level, 135, ##ctx) \ + FN(skc_to_tcp6_sock, 136, ##ctx) \ + FN(skc_to_tcp_sock, 137, ##ctx) \ + FN(skc_to_tcp_timewait_sock, 138, ##ctx) \ + FN(skc_to_tcp_request_sock, 139, ##ctx) \ + FN(skc_to_udp6_sock, 140, ##ctx) \ + FN(get_task_stack, 141, ##ctx) \ + FN(load_hdr_opt, 142, ##ctx) \ + FN(store_hdr_opt, 143, ##ctx) \ + FN(reserve_hdr_opt, 144, ##ctx) \ + FN(inode_storage_get, 145, ##ctx) \ + FN(inode_storage_delete, 146, ##ctx) \ + FN(d_path, 147, ##ctx) \ + FN(copy_from_user, 148, ##ctx) \ + FN(snprintf_btf, 149, ##ctx) \ + FN(seq_printf_btf, 150, ##ctx) \ + FN(skb_cgroup_classid, 151, ##ctx) \ + FN(redirect_neigh, 152, ##ctx) \ + FN(per_cpu_ptr, 153, ##ctx) \ + FN(this_cpu_ptr, 154, ##ctx) \ + FN(redirect_peer, 155, ##ctx) \ + FN(task_storage_get, 156, ##ctx) \ + FN(task_storage_delete, 157, ##ctx) \ + FN(get_current_task_btf, 158, ##ctx) \ + FN(bprm_opts_set, 159, ##ctx) \ + FN(ktime_get_coarse_ns, 160, ##ctx) \ + FN(ima_inode_hash, 161, ##ctx) \ + FN(sock_from_file, 162, ##ctx) \ + FN(check_mtu, 163, ##ctx) \ + FN(for_each_map_elem, 164, ##ctx) \ + FN(snprintf, 165, ##ctx) \ + FN(sys_bpf, 166, ##ctx) \ + FN(btf_find_by_name_kind, 167, ##ctx) \ + FN(sys_close, 168, ##ctx) \ + FN(timer_init, 169, ##ctx) \ + FN(timer_set_callback, 170, ##ctx) \ + FN(timer_start, 171, ##ctx) \ + FN(timer_cancel, 172, ##ctx) \ + FN(get_func_ip, 173, ##ctx) \ + FN(get_attach_cookie, 174, ##ctx) \ + FN(task_pt_regs, 175, ##ctx) \ + FN(get_branch_snapshot, 176, ##ctx) \ + FN(trace_vprintk, 177, ##ctx) \ + FN(skc_to_unix_sock, 178, ##ctx) \ + FN(kallsyms_lookup_name, 179, ##ctx) \ + FN(find_vma, 180, ##ctx) \ + FN(loop, 181, ##ctx) \ + FN(strncmp, 182, ##ctx) \ + FN(get_func_arg, 183, ##ctx) \ + FN(get_func_ret, 184, ##ctx) \ + FN(get_func_arg_cnt, 185, ##ctx) \ + FN(get_retval, 186, ##ctx) \ + FN(set_retval, 187, ##ctx) \ + FN(xdp_get_buff_len, 188, ##ctx) \ + FN(xdp_load_bytes, 189, ##ctx) \ + FN(xdp_store_bytes, 190, ##ctx) \ + FN(copy_from_user_task, 191, ##ctx) \ + FN(skb_set_tstamp, 192, ##ctx) \ + FN(ima_file_hash, 193, ##ctx) \ + FN(kptr_xchg, 194, ##ctx) \ + FN(map_lookup_percpu_elem, 195, ##ctx) \ + FN(skc_to_mptcp_sock, 196, ##ctx) \ + FN(dynptr_from_mem, 197, ##ctx) \ + FN(ringbuf_reserve_dynptr, 198, ##ctx) \ + FN(ringbuf_submit_dynptr, 199, ##ctx) \ + FN(ringbuf_discard_dynptr, 200, ##ctx) \ + FN(dynptr_read, 201, ##ctx) \ + FN(dynptr_write, 202, ##ctx) \ + FN(dynptr_data, 203, ##ctx) \ + FN(tcp_raw_gen_syncookie_ipv4, 204, ##ctx) \ + FN(tcp_raw_gen_syncookie_ipv6, 205, ##ctx) \ + FN(tcp_raw_check_syncookie_ipv4, 206, ##ctx) \ + FN(tcp_raw_check_syncookie_ipv6, 207, ##ctx) \ + FN(ktime_get_tai_ns, 208, ##ctx) \ + FN(user_ringbuf_drain, 209, ##ctx) \ + FN(cgrp_storage_get, 210, ##ctx) \ + FN(cgrp_storage_delete, 211, ##ctx) \ /* */ +/* backwards-compatibility macros for users of __BPF_FUNC_MAPPER that don't + * know or care about integer value that is now passed as second argument + */ +#define __BPF_FUNC_MAPPER_APPLY(name, value, FN) FN(name), +#define __BPF_FUNC_MAPPER(FN) ___BPF_FUNC_MAPPER(__BPF_FUNC_MAPPER_APPLY, FN) + /* integer value in 'imm' field of BPF_CALL instruction selects which helper * function eBPF program intends to call */ -#define __BPF_ENUM_FN(x) BPF_FUNC_ ## x +#define __BPF_ENUM_FN(x, y) BPF_FUNC_ ## x = y, enum bpf_func_id { - __BPF_FUNC_MAPPER(__BPF_ENUM_FN) + ___BPF_FUNC_MAPPER(__BPF_ENUM_FN) __BPF_FUNC_MAX_ID, }; #undef __BPF_ENUM_FN @@ -5707,6 +5839,7 @@ BPF_F_ZERO_CSUM_TX = (1ULL << 1), BPF_F_DONT_FRAGMENT = (1ULL << 2), BPF_F_SEQ_NUMBER = (1ULL << 3), + BPF_F_NO_TUNNEL_KEY = (1ULL << 4), }; /* BPF_FUNC_skb_get_tunnel_key flags. */ @@ -5746,6 +5879,8 @@ BPF_F_ADJ_ROOM_ENCAP_L4_UDP = (1ULL << 4), BPF_F_ADJ_ROOM_NO_CSUM_RESET = (1ULL << 5), BPF_F_ADJ_ROOM_ENCAP_L2_ETH = (1ULL << 6), + BPF_F_ADJ_ROOM_DECAP_L3_IPV4 = (1ULL << 7), + BPF_F_ADJ_ROOM_DECAP_L3_IPV6 = (1ULL << 8), }; enum { @@ -6281,6 +6416,15 @@ struct { __u32 ifindex; } xdp; + struct { + __u32 map_id; + } struct_ops; + struct { + __u32 pf; + __u32 hooknum; + __s32 priority; + __u32 flags; + } netfilter; }; } __attribute__((aligned(8))); @@ -6391,6 +6535,7 @@ * the outgoing header has not * been written yet. */ + __u64 skb_hwtstamp; }; /* Definitions for bpf_sock_ops_cb_flags */ @@ -6676,6 +6821,7 @@ enum { BPF_FIB_LOOKUP_DIRECT = (1U << 0), BPF_FIB_LOOKUP_OUTPUT = (1U << 1), + BPF_FIB_LOOKUP_SKIP_NEIGH = (1U << 2), }; enum { @@ -6833,6 +6979,31 @@ __u64 :64; } __attribute__((aligned(8))); +struct bpf_list_head { + __u64 :64; + __u64 :64; +} __attribute__((aligned(8))); + +struct bpf_list_node { + __u64 :64; + __u64 :64; +} __attribute__((aligned(8))); + +struct bpf_rb_root { + __u64 :64; + __u64 :64; +} __attribute__((aligned(8))); + +struct bpf_rb_node { + __u64 :64; + __u64 :64; + __u64 :64; +} __attribute__((aligned(8))); + +struct bpf_refcount { + __u32 :32; +} __attribute__((aligned(4))); + struct bpf_sysctl { __u32 write; /* Sysctl is being read (= 0) or written (= 1). * Allows 1,2,4-byte read, but no write. @@ -6982,4 +7153,21 @@ enum bpf_core_relo_kind kind; }; +/* + * Flags to control bpf_timer_start() behaviour. + * - BPF_F_TIMER_ABS: Timeout passed is absolute time, by default it is + * relative to current time. + */ +enum { + BPF_F_TIMER_ABS = (1ULL << 0), +}; + +/* BPF numbers iterator state */ +struct bpf_iter_num { + /* opaque iterator state; having __u64 here allows to preserve correct + * alignment requirements in vmlinux.h, generated from BTF + */ + __u64 __opaque1; +} __attribute__((aligned(8))); + #endif /* __LINUX_BPF_H__ */
View file
_service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/capability.h
Added
@@ -0,0 +1,430 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +/* + * This is <linux/capability.h> + * + * Andrew G. Morgan <morgan@kernel.org> + * Alexander Kjeldaas <astor@guardian.no> + * with help from Aleph1, Roland Buresund and Andrew Main. + * + * See here for the libcap library ("POSIX draft" compliance): + * + * ftp://www.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.6/ + */ + +#ifndef _LINUX_CAPABILITY_H +#define _LINUX_CAPABILITY_H + +#include <linux/types.h> + +/* User-level do most of the mapping between kernel and user + capabilities based on the version tag given by the kernel. The + kernel might be somewhat backwards compatible, but don't bet on + it. */ + +/* Note, cap_t, is defined by POSIX (draft) to be an "opaque" pointer to + a set of three capability sets. The transposition of 3*the + following structure to such a composite is better handled in a user + library since the draft standard requires the use of malloc/free + etc.. */ + +#define _LINUX_CAPABILITY_VERSION_1 0x19980330 +#define _LINUX_CAPABILITY_U32S_1 1 + +#define _LINUX_CAPABILITY_VERSION_2 0x20071026 /* deprecated - use v3 */ +#define _LINUX_CAPABILITY_U32S_2 2 + +#define _LINUX_CAPABILITY_VERSION_3 0x20080522 +#define _LINUX_CAPABILITY_U32S_3 2 + +typedef struct __user_cap_header_struct { + __u32 version; + int pid; +} *cap_user_header_t; + +typedef struct __user_cap_data_struct { + __u32 effective; + __u32 permitted; + __u32 inheritable; +} *cap_user_data_t; + + +#define VFS_CAP_REVISION_MASK 0xFF000000 +#define VFS_CAP_REVISION_SHIFT 24 +#define VFS_CAP_FLAGS_MASK ~VFS_CAP_REVISION_MASK +#define VFS_CAP_FLAGS_EFFECTIVE 0x000001 + +#define VFS_CAP_REVISION_1 0x01000000 +#define VFS_CAP_U32_1 1 +#define XATTR_CAPS_SZ_1 (sizeof(__le32)*(1 + 2*VFS_CAP_U32_1)) + +#define VFS_CAP_REVISION_2 0x02000000 +#define VFS_CAP_U32_2 2 +#define XATTR_CAPS_SZ_2 (sizeof(__le32)*(1 + 2*VFS_CAP_U32_2)) + +#define VFS_CAP_REVISION_3 0x03000000 +#define VFS_CAP_U32_3 2 +#define XATTR_CAPS_SZ_3 (sizeof(__le32)*(2 + 2*VFS_CAP_U32_3)) + +#define XATTR_CAPS_SZ XATTR_CAPS_SZ_3 +#define VFS_CAP_U32 VFS_CAP_U32_3 +#define VFS_CAP_REVISION VFS_CAP_REVISION_3 + +struct vfs_cap_data { + __le32 magic_etc; /* Little endian */ + struct { + __le32 permitted; /* Little endian */ + __le32 inheritable; /* Little endian */ + } dataVFS_CAP_U32; +}; + +/* + * same as vfs_cap_data but with a rootid at the end + */ +struct vfs_ns_cap_data { + __le32 magic_etc; + struct { + __le32 permitted; /* Little endian */ + __le32 inheritable; /* Little endian */ + } dataVFS_CAP_U32; + __le32 rootid; +}; + + +/* + * Backwardly compatible definition for source code - trapped in a + * 32-bit world. If you find you need this, please consider using + * libcap to untrap yourself... + */ +#define _LINUX_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_1 +#define _LINUX_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_1 + + + +/** + ** POSIX-draft defined capabilities. + **/ + +/* In a system with the _POSIX_CHOWN_RESTRICTED option defined, this + overrides the restriction of changing file ownership and group + ownership. */ + +#define CAP_CHOWN 0 + +/* Override all DAC access, including ACL execute access if + _POSIX_ACL is defined. Excluding DAC access covered by + CAP_LINUX_IMMUTABLE. */ + +#define CAP_DAC_OVERRIDE 1 + +/* Overrides all DAC restrictions regarding read and search on files + and directories, including ACL restrictions if _POSIX_ACL is + defined. Excluding DAC access covered by CAP_LINUX_IMMUTABLE. */ + +#define CAP_DAC_READ_SEARCH 2 + +/* Overrides all restrictions about allowed operations on files, where + file owner ID must be equal to the user ID, except where CAP_FSETID + is applicable. It doesn't override MAC and DAC restrictions. */ + +#define CAP_FOWNER 3 + +/* Overrides the following restrictions that the effective user ID + shall match the file owner ID when setting the S_ISUID and S_ISGID + bits on that file; that the effective group ID (or one of the + supplementary group IDs) shall match the file owner ID when setting + the S_ISGID bit on that file; that the S_ISUID and S_ISGID bits are + cleared on successful return from chown(2) (not implemented). */ + +#define CAP_FSETID 4 + +/* Overrides the restriction that the real or effective user ID of a + process sending a signal must match the real or effective user ID + of the process receiving the signal. */ + +#define CAP_KILL 5 + +/* Allows setgid(2) manipulation */ +/* Allows setgroups(2) */ +/* Allows forged gids on socket credentials passing. */ + +#define CAP_SETGID 6 + +/* Allows set*uid(2) manipulation (including fsuid). */ +/* Allows forged pids on socket credentials passing. */ + +#define CAP_SETUID 7 + + +/** + ** Linux-specific capabilities + **/ + +/* Without VFS support for capabilities: + * Transfer any capability in your permitted set to any pid, + * remove any capability in your permitted set from any pid + * With VFS support for capabilities (neither of above, but) + * Add any capability from current's capability bounding set + * to the current process' inheritable set + * Allow taking bits out of capability bounding set + * Allow modification of the securebits for a process + */ + +#define CAP_SETPCAP 8 + +/* Allow modification of S_IMMUTABLE and S_APPEND file attributes */ + +#define CAP_LINUX_IMMUTABLE 9 + +/* Allows binding to TCP/UDP sockets below 1024 */ +/* Allows binding to ATM VCIs below 32 */ + +#define CAP_NET_BIND_SERVICE 10 + +/* Allow broadcasting, listen to multicast */ + +#define CAP_NET_BROADCAST 11 + +/* Allow interface configuration */ +/* Allow administration of IP firewall, masquerading and accounting */ +/* Allow setting debug option on sockets */ +/* Allow modification of routing tables */ +/* Allow setting arbitrary process / process group ownership on + sockets */ +/* Allow binding to any address for transparent proxying (also via NET_RAW) */ +/* Allow setting TOS (type of service) */ +/* Allow setting promiscuous mode */ +/* Allow clearing driver statistics */ +/* Allow multicasting */ +/* Allow read/write of device-specific registers */ +/* Allow activation of ATM control sockets */ + +#define CAP_NET_ADMIN 12 + +/* Allow use of RAW sockets */ +/* Allow use of PACKET sockets */ +/* Allow binding to any address for transparent proxying (also via NET_ADMIN) */ + +#define CAP_NET_RAW 13 + +/* Allow locking of shared memory segments */ +/* Allow mlock and mlockall (which doesn't really have anything to do + with IPC) */ + +#define CAP_IPC_LOCK 14 + +/* Override IPC ownership checks */ + +#define CAP_IPC_OWNER 15 + +/* Insert and remove kernel modules - modify kernel without limit */ +#define CAP_SYS_MODULE 16 + +/* Allow ioperm/iopl access */ +/* Allow sending USB messages to any device via /dev/bus/usb */ + +#define CAP_SYS_RAWIO 17 + +/* Allow use of chroot() */ + +#define CAP_SYS_CHROOT 18 + +/* Allow ptrace() of any process */ + +#define CAP_SYS_PTRACE 19 + +/* Allow configuration of process accounting */ + +#define CAP_SYS_PACCT 20 + +/* Allow configuration of the secure attention key */ +/* Allow administration of the random device */ +/* Allow examination and configuration of disk quotas */ +/* Allow setting the domainname */ +/* Allow setting the hostname */ +/* Allow mount() and umount(), setting up new smb connection */ +/* Allow some autofs root ioctls */ +/* Allow nfsservctl */ +/* Allow VM86_REQUEST_IRQ */ +/* Allow to read/write pci config on alpha */ +/* Allow irix_prctl on mips (setstacksize) */ +/* Allow flushing all cache on m68k (sys_cacheflush) */ +/* Allow removing semaphores */ +/* Used instead of CAP_CHOWN to "chown" IPC message queues, semaphores + and shared memory */ +/* Allow locking/unlocking of shared memory segment */ +/* Allow turning swap on/off */ +/* Allow forged pids on socket credentials passing */ +/* Allow setting readahead and flushing buffers on block devices */ +/* Allow setting geometry in floppy driver */ +/* Allow turning DMA on/off in xd driver */ +/* Allow administration of md devices (mostly the above, but some + extra ioctls) */ +/* Allow tuning the ide driver */ +/* Allow access to the nvram device */ +/* Allow administration of apm_bios, serial and bttv (TV) device */ +/* Allow manufacturer commands in isdn CAPI support driver */ +/* Allow reading non-standardized portions of pci configuration space */ +/* Allow DDI debug ioctl on sbpcd driver */ +/* Allow setting up serial ports */ +/* Allow sending raw qic-117 commands */ +/* Allow enabling/disabling tagged queuing on SCSI controllers and sending + arbitrary SCSI commands */ +/* Allow setting encryption key on loopback filesystem */ +/* Allow setting zone reclaim policy */ +/* Allow everything under CAP_BPF and CAP_PERFMON for backward compatibility */ + +#define CAP_SYS_ADMIN 21 + +/* Allow use of reboot() */ + +#define CAP_SYS_BOOT 22 + +/* Allow raising priority and setting priority on other (different + UID) processes */ +/* Allow use of FIFO and round-robin (realtime) scheduling on own + processes and setting the scheduling algorithm used by another + process. */ +/* Allow setting cpu affinity on other processes */ +/* Allow setting realtime ioprio class */ +/* Allow setting ioprio class on other processes */ + +#define CAP_SYS_NICE 23 + +/* Override resource limits. Set resource limits. */ +/* Override quota limits. */ +/* Override reserved space on ext2 filesystem */ +/* Modify data journaling mode on ext3 filesystem (uses journaling + resources) */ +/* NOTE: ext2 honors fsuid when checking for resource overrides, so + you can override using fsuid too */ +/* Override size restrictions on IPC message queues */ +/* Allow more than 64hz interrupts from the real-time clock */ +/* Override max number of consoles on console allocation */ +/* Override max number of keymaps */ +/* Control memory reclaim behavior */ + +#define CAP_SYS_RESOURCE 24 + +/* Allow manipulation of system clock */ +/* Allow irix_stime on mips */ +/* Allow setting the real-time clock */ + +#define CAP_SYS_TIME 25 + +/* Allow configuration of tty devices */ +/* Allow vhangup() of tty */ + +#define CAP_SYS_TTY_CONFIG 26 + +/* Allow the privileged aspects of mknod() */ + +#define CAP_MKNOD 27 + +/* Allow taking of leases on files */ + +#define CAP_LEASE 28 + +/* Allow writing the audit log via unicast netlink socket */ + +#define CAP_AUDIT_WRITE 29 + +/* Allow configuration of audit via unicast netlink socket */ + +#define CAP_AUDIT_CONTROL 30 + +/* Set or remove capabilities on files. + Map uid=0 into a child user namespace. */ + +#define CAP_SETFCAP 31 + +/* Override MAC access. + The base kernel enforces no MAC policy. + An LSM may enforce a MAC policy, and if it does and it chooses + to implement capability based overrides of that policy, this is + the capability it should use to do so. */ + +#define CAP_MAC_OVERRIDE 32 + +/* Allow MAC configuration or state changes. + The base kernel requires no MAC configuration. + An LSM may enforce a MAC policy, and if it does and it chooses + to implement capability based checks on modifications to that + policy or the data required to maintain it, this is the + capability it should use to do so. */ + +#define CAP_MAC_ADMIN 33 + +/* Allow configuring the kernel's syslog (printk behaviour) */ + +#define CAP_SYSLOG 34 + +/* Allow triggering something that will wake the system */ + +#define CAP_WAKE_ALARM 35 + +/* Allow preventing system suspends */ + +#define CAP_BLOCK_SUSPEND 36 + +/* Allow reading the audit log via multicast netlink socket */ + +#define CAP_AUDIT_READ 37 + +/* + * Allow system performance and observability privileged operations + * using perf_events, i915_perf and other kernel subsystems + */ + +#define CAP_PERFMON 38 + +/* + * CAP_BPF allows the following BPF operations: + * - Creating all types of BPF maps + * - Advanced verifier features + * - Indirect variable access + * - Bounded loops + * - BPF to BPF function calls + * - Scalar precision tracking + * - Larger complexity limits + * - Dead code elimination + * - And potentially other features + * - Loading BPF Type Format (BTF) data + * - Retrieve xlated and JITed code of BPF programs + * - Use bpf_spin_lock() helper + * + * CAP_PERFMON relaxes the verifier checks further: + * - BPF progs can use of pointer-to-integer conversions + * - speculation attack hardening measures are bypassed + * - bpf_probe_read to read arbitrary kernel memory is allowed + * - bpf_trace_printk to print kernel memory is allowed + * + * CAP_SYS_ADMIN is required to use bpf_probe_write_user. + * + * CAP_SYS_ADMIN is required to iterate system wide loaded + * programs, maps, links, BTFs and convert their IDs to file descriptors. + * + * CAP_PERFMON and CAP_BPF are required to load tracing programs. + * CAP_NET_ADMIN and CAP_BPF are required to load networking programs. + */ +#define CAP_BPF 39 + + +/* Allow checkpoint/restore related operations */ +/* Allow PID selection during clone3() */ +/* Allow writing to ns_last_pid */ + +#define CAP_CHECKPOINT_RESTORE 40 + +#define CAP_LAST_CAP CAP_CHECKPOINT_RESTORE + +#define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP) + +/* + * Bit location of each capability (used by user-space library and kernel) + */ + +#define CAP_TO_INDEX(x) ((x) >> 5) /* 1 << 5 == bits in __u32 */ +#define CAP_TO_MASK(x) (1U << ((x) & 31)) /* mask for indexed __u32 */ + + +#endif /* _LINUX_CAPABILITY_H */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/const.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/const.h
Changed
@@ -28,7 +28,7 @@ #define _BITUL(x) (_UL(1) << (x)) #define _BITULL(x) (_ULL(1) << (x)) -#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1) +#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (__typeof__(x))(a) - 1) #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) #define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/dcbnl.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/dcbnl.h
Changed
@@ -218,6 +218,9 @@ #define IEEE_8021QAZ_APP_SEL_ANY 4 #define IEEE_8021QAZ_APP_SEL_DSCP 5 +/* Non-std selector values */ +#define DCB_APP_SEL_PCP 255 + /* This structure contains the IEEE 802.1Qaz APP managed object. This * object is also used for the CEE std as well. * @@ -247,6 +250,8 @@ __u16 protocol; }; +#define IEEE_8021QAZ_APP_SEL_MAX 255 + /** * struct dcb_peer_app_info - APP feature information sent by the peer * @@ -405,6 +410,8 @@ * @DCB_ATTR_IEEE_PEER_ETS: peer ETS configuration - get only * @DCB_ATTR_IEEE_PEER_PFC: peer PFC configuration - get only * @DCB_ATTR_IEEE_PEER_APP: peer APP tlv - get only + * @DCB_ATTR_DCB_APP_TRUST_TABLE: selector trust table + * @DCB_ATTR_DCB_REWR_TABLE: rewrite configuration */ enum ieee_attrs { DCB_ATTR_IEEE_UNSPEC, @@ -418,6 +425,8 @@ DCB_ATTR_IEEE_QCN, DCB_ATTR_IEEE_QCN_STATS, DCB_ATTR_DCB_BUFFER, + DCB_ATTR_DCB_APP_TRUST_TABLE, + DCB_ATTR_DCB_REWR_TABLE, __DCB_ATTR_IEEE_MAX }; #define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1) @@ -425,6 +434,7 @@ enum ieee_attrs_app { DCB_ATTR_IEEE_APP_UNSPEC, DCB_ATTR_IEEE_APP, + DCB_ATTR_DCB_APP, __DCB_ATTR_IEEE_APP_MAX }; #define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1)
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/devlink.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/devlink.h
Changed
@@ -607,6 +607,11 @@ DEVLINK_ATTR_SELFTESTS, /* nested */ + DEVLINK_ATTR_RATE_TX_PRIORITY, /* u32 */ + DEVLINK_ATTR_RATE_TX_WEIGHT, /* u32 */ + + DEVLINK_ATTR_REGION_DIRECT, /* flag */ + /* add new attributes above here, update the policy in devlink.c */ __DEVLINK_ATTR_MAX, @@ -653,11 +658,24 @@ DEVLINK_RESOURCE_UNIT_ENTRY, }; +enum devlink_port_fn_attr_cap { + DEVLINK_PORT_FN_ATTR_CAP_ROCE_BIT, + DEVLINK_PORT_FN_ATTR_CAP_MIGRATABLE_BIT, + + /* Add new caps above */ + __DEVLINK_PORT_FN_ATTR_CAPS_MAX, +}; + +#define DEVLINK_PORT_FN_CAP_ROCE _BITUL(DEVLINK_PORT_FN_ATTR_CAP_ROCE_BIT) +#define DEVLINK_PORT_FN_CAP_MIGRATABLE \ + _BITUL(DEVLINK_PORT_FN_ATTR_CAP_MIGRATABLE_BIT) + enum devlink_port_function_attr { DEVLINK_PORT_FUNCTION_ATTR_UNSPEC, DEVLINK_PORT_FUNCTION_ATTR_HW_ADDR, /* binary */ DEVLINK_PORT_FN_ATTR_STATE, /* u8 */ DEVLINK_PORT_FN_ATTR_OPSTATE, /* u8 */ + DEVLINK_PORT_FN_ATTR_CAPS, /* bitfield32 */ __DEVLINK_PORT_FUNCTION_ATTR_MAX, DEVLINK_PORT_FUNCTION_ATTR_MAX = __DEVLINK_PORT_FUNCTION_ATTR_MAX - 1
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/fou.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/fou.h
Changed
@@ -1,32 +1,37 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -/* fou.h - FOU Interface */ +/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */ +/* Do not edit directly, auto-generated from: */ +/* Documentation/netlink/specs/fou.yaml */ +/* YNL-GEN uapi header */ #ifndef _LINUX_FOU_H #define _LINUX_FOU_H -/* NETLINK_GENERIC related info - */ #define FOU_GENL_NAME "fou" -#define FOU_GENL_VERSION 0x1 +#define FOU_GENL_VERSION 1 enum { - FOU_ATTR_UNSPEC, - FOU_ATTR_PORT, /* u16 */ - FOU_ATTR_AF, /* u8 */ - FOU_ATTR_IPPROTO, /* u8 */ - FOU_ATTR_TYPE, /* u8 */ - FOU_ATTR_REMCSUM_NOPARTIAL, /* flag */ - FOU_ATTR_LOCAL_V4, /* u32 */ - FOU_ATTR_LOCAL_V6, /* in6_addr */ - FOU_ATTR_PEER_V4, /* u32 */ - FOU_ATTR_PEER_V6, /* in6_addr */ - FOU_ATTR_PEER_PORT, /* u16 */ - FOU_ATTR_IFINDEX, /* s32 */ - - __FOU_ATTR_MAX, + FOU_ENCAP_UNSPEC, + FOU_ENCAP_DIRECT, + FOU_ENCAP_GUE, }; -#define FOU_ATTR_MAX (__FOU_ATTR_MAX - 1) +enum { + FOU_ATTR_UNSPEC, + FOU_ATTR_PORT, + FOU_ATTR_AF, + FOU_ATTR_IPPROTO, + FOU_ATTR_TYPE, + FOU_ATTR_REMCSUM_NOPARTIAL, + FOU_ATTR_LOCAL_V4, + FOU_ATTR_LOCAL_V6, + FOU_ATTR_PEER_V4, + FOU_ATTR_PEER_V6, + FOU_ATTR_PEER_PORT, + FOU_ATTR_IFINDEX, + + __FOU_ATTR_MAX +}; +#define FOU_ATTR_MAX (__FOU_ATTR_MAX - 1) enum { FOU_CMD_UNSPEC, @@ -34,15 +39,8 @@ FOU_CMD_DEL, FOU_CMD_GET, - __FOU_CMD_MAX, + __FOU_CMD_MAX }; - -enum { - FOU_ENCAP_UNSPEC, - FOU_ENCAP_DIRECT, - FOU_ENCAP_GUE, -}; - -#define FOU_CMD_MAX (__FOU_CMD_MAX - 1) +#define FOU_CMD_MAX (__FOU_CMD_MAX - 1) #endif /* _LINUX_FOU_H */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/if_alg.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/if_alg.h
Changed
@@ -52,6 +52,7 @@ #define ALG_SET_AEAD_ASSOCLEN 4 #define ALG_SET_AEAD_AUTHSIZE 5 #define ALG_SET_DRBG_ENTROPY 6 +#define ALG_SET_KEY_BY_KEY_SERIAL 7 /* Operations */ #define ALG_OP_DECRYPT 0
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/if_bridge.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/if_bridge.h
Changed
@@ -523,6 +523,9 @@ BRIDGE_VLANDB_ENTRY_TUNNEL_INFO, BRIDGE_VLANDB_ENTRY_STATS, BRIDGE_VLANDB_ENTRY_MCAST_ROUTER, + BRIDGE_VLANDB_ENTRY_MCAST_N_GROUPS, + BRIDGE_VLANDB_ENTRY_MCAST_MAX_GROUPS, + BRIDGE_VLANDB_ENTRY_NEIGH_SUPPRESS, __BRIDGE_VLANDB_ENTRY_MAX, }; #define BRIDGE_VLANDB_ENTRY_MAX (__BRIDGE_VLANDB_ENTRY_MAX - 1) @@ -631,6 +634,11 @@ MDBA_MDB_EATTR_GROUP_MODE, MDBA_MDB_EATTR_SOURCE, MDBA_MDB_EATTR_RTPROT, + MDBA_MDB_EATTR_DST, + MDBA_MDB_EATTR_DST_PORT, + MDBA_MDB_EATTR_VNI, + MDBA_MDB_EATTR_IFINDEX, + MDBA_MDB_EATTR_SRC_VNI, __MDBA_MDB_EATTR_MAX }; #define MDBA_MDB_EATTR_MAX (__MDBA_MDB_EATTR_MAX - 1) @@ -723,10 +731,36 @@ enum { MDBE_ATTR_UNSPEC, MDBE_ATTR_SOURCE, + MDBE_ATTR_SRC_LIST, + MDBE_ATTR_GROUP_MODE, + MDBE_ATTR_RTPROT, + MDBE_ATTR_DST, + MDBE_ATTR_DST_PORT, + MDBE_ATTR_VNI, + MDBE_ATTR_IFINDEX, + MDBE_ATTR_SRC_VNI, __MDBE_ATTR_MAX, }; #define MDBE_ATTR_MAX (__MDBE_ATTR_MAX - 1) +/* per mdb entry source */ +enum { + MDBE_SRC_LIST_UNSPEC, + MDBE_SRC_LIST_ENTRY, + __MDBE_SRC_LIST_MAX, +}; +#define MDBE_SRC_LIST_MAX (__MDBE_SRC_LIST_MAX - 1) + +/* per mdb entry per source attributes + * these are embedded in MDBE_SRC_LIST_ENTRY + */ +enum { + MDBE_SRCATTR_UNSPEC, + MDBE_SRCATTR_ADDRESS, + __MDBE_SRCATTR_MAX, +}; +#define MDBE_SRCATTR_MAX (__MDBE_SRCATTR_MAX - 1) + /* Embedded inside LINK_XSTATS_TYPE_BRIDGE */ enum { BRIDGE_XSTATS_UNSPEC,
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/if_link.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/if_link.h
Changed
@@ -372,6 +372,11 @@ IFLA_TSO_MAX_SEGS, IFLA_ALLMULTI, /* Allmulti count: > 0 means acts ALLMULTI */ + IFLA_DEVLINK_PORT, + + IFLA_GSO_IPV4_MAX_SIZE, + IFLA_GRO_IPV4_MAX_SIZE, + __IFLA_MAX }; @@ -559,6 +564,10 @@ IFLA_BRPORT_MCAST_EHT_HOSTS_LIMIT, IFLA_BRPORT_MCAST_EHT_HOSTS_CNT, IFLA_BRPORT_LOCKED, + IFLA_BRPORT_MAB, + IFLA_BRPORT_MCAST_N_GROUPS, + IFLA_BRPORT_MCAST_MAX_GROUPS, + IFLA_BRPORT_NEIGH_VLAN_SUPPRESS, __IFLA_BRPORT_MAX }; #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1) @@ -625,6 +634,7 @@ IFLA_MACVLAN_MACADDR_COUNT, IFLA_MACVLAN_BC_QUEUE_LEN, IFLA_MACVLAN_BC_QUEUE_LEN_USED, + IFLA_MACVLAN_BC_CUTOFF, __IFLA_MACVLAN_MAX, };
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/if_packet.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/if_packet.h
Changed
@@ -59,6 +59,7 @@ #define PACKET_ROLLOVER_STATS 21 #define PACKET_FANOUT_DATA 22 #define PACKET_IGNORE_OUTGOING 23 +#define PACKET_VNET_HDR_SZ 24 #define PACKET_FANOUT_HASH 0 #define PACKET_FANOUT_LB 1 @@ -70,6 +71,7 @@ #define PACKET_FANOUT_EBPF 7 #define PACKET_FANOUT_FLAG_ROLLOVER 0x1000 #define PACKET_FANOUT_FLAG_UNIQUEID 0x2000 +#define PACKET_FANOUT_FLAG_IGNORE_OUTGOING 0x4000 #define PACKET_FANOUT_FLAG_DEFRAG 0x8000 struct tpacket_stats { @@ -114,6 +116,7 @@ #define TP_STATUS_BLK_TMO (1 << 5) #define TP_STATUS_VLAN_TPID_VALID (1 << 6) /* auxdata has valid tp_vlan_tpid */ #define TP_STATUS_CSUM_VALID (1 << 7) +#define TP_STATUS_GSO_TCP (1 << 8) /* Tx ring - header status */ #define TP_STATUS_AVAILABLE 0
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/if_tun.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/if_tun.h
Changed
@@ -90,6 +90,8 @@ #define TUN_F_TSO6 0x04 /* I can handle TSO for IPv6 packets */ #define TUN_F_TSO_ECN 0x08 /* I can handle TSO with ECN bits. */ #define TUN_F_UFO 0x10 /* I can handle UFO packets */ +#define TUN_F_USO4 0x20 /* I can handle USO for IPv4 packets */ +#define TUN_F_USO6 0x40 /* I can handle USO for IPv6 packets */ /* Protocol info prepended to the packets (when IFF_NO_PI is not set) */ #define TUN_PKT_STRIP 0x0001
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/in.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/in.h
Changed
@@ -162,6 +162,8 @@ #define MCAST_MSFILTER 48 #define IP_MULTICAST_ALL 49 #define IP_UNICAST_IF 50 +#define IP_LOCAL_PORT_RANGE 51 +#define IP_PROTOCOL 52 #define MCAST_EXCLUDE 0 #define MCAST_INCLUDE 1
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/ioam6.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/ioam6.h
Changed
@@ -127,7 +127,7 @@ #endif #define IOAM6_TRACE_DATA_SIZE_MAX 244 - __u8 data0; + __u8 data; } __attribute__((packed)); #endif /* _LINUX_IOAM6_H */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/ip.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/ip.h
Changed
@@ -18,6 +18,7 @@ #ifndef _LINUX_IP_H #define _LINUX_IP_H #include <linux/types.h> +#include <linux/stddef.h> #include <asm/byteorder.h> #define IPTOS_TOS_MASK 0x1E
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/mptcp.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/mptcp.h
Changed
@@ -158,6 +158,12 @@ * daddr4 | daddr6, sport, dport, backup, if_idx * , error * The priority of a subflow has changed. 'error' should not be set. + * + * MPTCP_EVENT_LISTENER_CREATED: family, sport, saddr4 | saddr6 + * A new PM listener is created. + * + * MPTCP_EVENT_LISTENER_CLOSED: family, sport, saddr4 | saddr6 + * A PM listener is closed. */ enum mptcp_event_type { MPTCP_EVENT_UNSPEC = 0, @@ -172,6 +178,9 @@ MPTCP_EVENT_SUB_CLOSED = 11, MPTCP_EVENT_SUB_PRIORITY = 13, + + MPTCP_EVENT_LISTENER_CREATED = 15, + MPTCP_EVENT_LISTENER_CLOSED = 16, }; enum mptcp_event_attr {
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/neighbour.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/neighbour.h
Changed
@@ -52,7 +52,8 @@ #define NTF_STICKY (1 << 6) #define NTF_ROUTER (1 << 7) /* Extended flags under NDA_FLAGS_EXT: */ -#define NTF_EXT_MANAGED (1 << 0) +#define NTF_EXT_MANAGED (1 << 0) +#define NTF_EXT_LOCKED (1 << 1) /* * Neighbor Cache Entry States. @@ -86,6 +87,11 @@ * NTF_EXT_MANAGED flagged neigbor entries are managed by the kernel on behalf * of a user space control plane, and automatically refreshed so that (if * possible) they remain in NUD_REACHABLE state. + * + * NTF_EXT_LOCKED flagged bridge FDB entries are entries generated by the + * bridge in response to a host trying to communicate via a locked bridge port + * with MAB enabled. Their purpose is to notify user space that a host requires + * authentication. */ struct nda_cacheinfo {
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/netfilter/ipset/ip_set.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/netfilter/ipset/ip_set.h
Changed
@@ -85,6 +85,7 @@ IPSET_ATTR_CADT_LINENO = IPSET_ATTR_LINENO, /* 9 */ IPSET_ATTR_MARK, /* 10 */ IPSET_ATTR_MARKMASK, /* 11 */ + IPSET_ATTR_BITMASK, /* 12 */ /* Reserve empty slots */ IPSET_ATTR_CADT_MAX = 16, /* Create-only specific attributes */ @@ -153,6 +154,7 @@ IPSET_ERR_COMMENT, IPSET_ERR_INVALID_MARKMASK, IPSET_ERR_SKBINFO, + IPSET_ERR_BITMASK_NETMASK_EXCL, /* Type specific error codes */ IPSET_ERR_TYPE_SPECIFIC = 4352,
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/pkt_sched.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/pkt_sched.h
Changed
@@ -719,6 +719,11 @@ #define __TC_MQPRIO_SHAPER_MAX (__TC_MQPRIO_SHAPER_MAX - 1) +enum { + TC_FP_EXPRESS = 1, + TC_FP_PREEMPTIBLE = 2, +}; + struct tc_mqprio_qopt { __u8 num_tc; __u8 prio_tc_mapTC_QOPT_BITMASK + 1; @@ -733,11 +738,22 @@ #define TC_MQPRIO_F_MAX_RATE 0x8 enum { + TCA_MQPRIO_TC_ENTRY_UNSPEC, + TCA_MQPRIO_TC_ENTRY_INDEX, /* u32 */ + TCA_MQPRIO_TC_ENTRY_FP, /* u32 */ + + /* add new constants above here */ + __TCA_MQPRIO_TC_ENTRY_CNT, + TCA_MQPRIO_TC_ENTRY_MAX = (__TCA_MQPRIO_TC_ENTRY_CNT - 1) +}; + +enum { TCA_MQPRIO_UNSPEC, TCA_MQPRIO_MODE, TCA_MQPRIO_SHAPER, TCA_MQPRIO_MIN_RATE64, TCA_MQPRIO_MAX_RATE64, + TCA_MQPRIO_TC_ENTRY, __TCA_MQPRIO_MAX, }; @@ -1236,6 +1252,7 @@ TCA_TAPRIO_TC_ENTRY_UNSPEC, TCA_TAPRIO_TC_ENTRY_INDEX, /* u32 */ TCA_TAPRIO_TC_ENTRY_MAX_SDU, /* u32 */ + TCA_TAPRIO_TC_ENTRY_FP, /* u32 */ /* add new constants above here */ __TCA_TAPRIO_TC_ENTRY_CNT,
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/rpl.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/rpl.h
Changed
@@ -37,8 +37,8 @@ #endif union { - struct in6_addr addr0; - __u8 data0; + __DECLARE_FLEX_ARRAY(struct in6_addr, addr); + __DECLARE_FLEX_ARRAY(__u8, data); } segments; } __attribute__((packed));
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/rtnetlink.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/rtnetlink.h
Changed
@@ -635,6 +635,7 @@ TCA_INGRESS_BLOCK, TCA_EGRESS_BLOCK, TCA_DUMP_FLAGS, + TCA_EXT_WARN_MSG, __TCA_MAX }; @@ -786,6 +787,7 @@ TCA_ROOT_FLAGS, TCA_ROOT_COUNT, TCA_ROOT_TIME_DELTA, /* in msecs */ + TCA_ROOT_EXT_WARN_MSG, __TCA_ROOT_MAX, #define TCA_ROOT_MAX (__TCA_ROOT_MAX - 1) };
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/sctp.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/sctp.h
Changed
@@ -1205,7 +1205,9 @@ SCTP_SS_DEFAULT = SCTP_SS_FCFS, SCTP_SS_PRIO, SCTP_SS_RR, - SCTP_SS_MAX = SCTP_SS_RR + SCTP_SS_FC, + SCTP_SS_WFQ, + SCTP_SS_MAX = SCTP_SS_WFQ }; /* Probe Interval socket option */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/snmp.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/snmp.h
Changed
@@ -95,6 +95,8 @@ ICMP_MIB_OUTADDRMASKS, /* OutAddrMasks */ ICMP_MIB_OUTADDRMASKREPS, /* OutAddrMaskReps */ ICMP_MIB_CSUMERRORS, /* InCsumErrors */ + ICMP_MIB_RATELIMITGLOBAL, /* OutRateLimitGlobal */ + ICMP_MIB_RATELIMITHOST, /* OutRateLimitHost */ __ICMP_MIB_MAX }; @@ -112,6 +114,7 @@ ICMP6_MIB_OUTMSGS, /* OutMsgs */ ICMP6_MIB_OUTERRORS, /* OutErrors */ ICMP6_MIB_CSUMERRORS, /* InCsumErrors */ + ICMP6_MIB_RATELIMITHOST, /* OutRateLimitHost */ __ICMP6_MIB_MAX }; @@ -292,6 +295,7 @@ LINUX_MIB_TCPDSACKIGNOREDDUBIOUS, /* TCPDSACKIgnoredDubious */ LINUX_MIB_TCPMIGRATEREQSUCCESS, /* TCPMigrateReqSuccess */ LINUX_MIB_TCPMIGRATEREQFAILURE, /* TCPMigrateReqFailure */ + LINUX_MIB_TCPPLBREHASH, /* TCPPLBRehash */ __LINUX_MIB_MAX };
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/tc_act/tc_ct.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/tc_act/tc_ct.h
Changed
@@ -22,6 +22,9 @@ TCA_CT_NAT_PORT_MIN, /* be16 */ TCA_CT_NAT_PORT_MAX, /* be16 */ TCA_CT_PAD, + TCA_CT_HELPER_NAME, /* string */ + TCA_CT_HELPER_FAMILY, /* u8 */ + TCA_CT_HELPER_PROTO, /* u8 */ __TCA_CT_MAX };
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/tc_act/tc_tunnel_key.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/tc_act/tc_tunnel_key.h
Changed
@@ -34,6 +34,7 @@ */ TCA_TUNNEL_KEY_ENC_TOS, /* u8 */ TCA_TUNNEL_KEY_ENC_TTL, /* u8 */ + TCA_TUNNEL_KEY_NO_FRAG, /* flag */ __TCA_TUNNEL_KEY_MAX, };
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/tcp.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/tcp.h
Changed
@@ -284,6 +284,11 @@ __u32 tcpi_snd_wnd; /* peer's advertised receive window after * scaling (bytes) */ + __u32 tcpi_rcv_wnd; /* local advertised receive window after + * scaling (bytes) + */ + + __u32 tcpi_rehash; /* PLB or timeout triggered rehash attempts */ }; /* netlink attributes types for SCM_TIMESTAMPING_OPT_STATS */ @@ -315,6 +320,7 @@ TCP_NLA_BYTES_NOTSENT, /* Bytes in write queue not yet sent */ TCP_NLA_EDT, /* Earliest departure time (CLOCK_MONOTONIC) */ TCP_NLA_TTL, /* TTL or hop limit of a packet received */ + TCP_NLA_REHASH, /* PLB and timeout triggered rehash attempts */ }; /* for TCP_MD5SIG socket option */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/virtio_config.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/virtio_config.h
Changed
@@ -98,6 +98,12 @@ #define VIRTIO_F_SR_IOV 37 /* + * This feature indicates that the driver passes extra data (besides + * identifying the virtqueue) in its device notifications. + */ +#define VIRTIO_F_NOTIFICATION_DATA 38 + +/* * This feature indicates that the driver can reset a queue individually. */ #define VIRTIO_F_RING_RESET 40
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/virtio_net.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/virtio_net.h
Changed
@@ -57,7 +57,11 @@ * Steering */ #define VIRTIO_NET_F_CTRL_MAC_ADDR 23 /* Set MAC address */ #define VIRTIO_NET_F_NOTF_COAL 53 /* Device supports notifications coalescing */ +#define VIRTIO_NET_F_GUEST_USO4 54 /* Guest can handle USOv4 in. */ +#define VIRTIO_NET_F_GUEST_USO6 55 /* Guest can handle USOv6 in. */ +#define VIRTIO_NET_F_HOST_USO 56 /* Host can handle USO in. */ #define VIRTIO_NET_F_HASH_REPORT 57 /* Supports hash report */ +#define VIRTIO_NET_F_GUEST_HDRLEN 59 /* Guest provides the exact hdr_len value. */ #define VIRTIO_NET_F_RSS 60 /* Supports RSS RX steering */ #define VIRTIO_NET_F_RSC_EXT 61 /* extended coalescing info */ #define VIRTIO_NET_F_STANDBY 62 /* Act as standby for another device @@ -130,6 +134,7 @@ #define VIRTIO_NET_HDR_GSO_TCPV4 1 /* GSO frame, IPv4 TCP (TSO) */ #define VIRTIO_NET_HDR_GSO_UDP 3 /* GSO frame, IPv4 UDP (UFO) */ #define VIRTIO_NET_HDR_GSO_TCPV6 4 /* GSO frame, IPv6 TCP */ +#define VIRTIO_NET_HDR_GSO_UDP_L4 5 /* GSO frame, IPv4& IPv6 UDP (USO) */ #define VIRTIO_NET_HDR_GSO_ECN 0x80 /* TCP has ECN set */ __u8 gso_type; __virtio16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/uapi/linux/xfrm.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/uapi/linux/xfrm.h
Changed
@@ -519,6 +519,12 @@ */ #define XFRM_OFFLOAD_IPV6 1 #define XFRM_OFFLOAD_INBOUND 2 +/* Two bits above are relevant for state path only, while + * offload is used for both policy and state flows. + * + * In policy offload mode, they are free and can be safely reused. + */ +#define XFRM_OFFLOAD_PACKET 4 struct xfrm_userpolicy_default { #define XFRM_USERPOLICY_UNSPEC 0
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/utils.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/utils.h
Changed
@@ -139,7 +139,6 @@ int get_addr_ila(__u64 *val, const char *arg); int read_prop(const char *dev, char *prop, long *value); -int get_hex(char c); int get_integer(int *val, const char *arg, int base); int get_unsigned(unsigned *val, const char *arg, int base); int get_time_rtt(unsigned *val, const char *arg, int *raw); @@ -284,6 +283,14 @@ _min1 < _min2 ? _min1 : _min2; }) #endif +#ifndef max +# define max(x, y) ({ \ + typeof(x) _max1 = (x); \ + typeof(y) _max2 = (y); \ + (void) (&_max1 == &_max2); \ + _max1 < _max2 ? _max2 : _max1; }) +#endif + #ifndef __check_format_string # define __check_format_string(pos_str, pos_args) \ __attribute__ ((format (printf, (pos_str), (pos_args)))) @@ -296,8 +303,6 @@ #define ntohll(x) ((1==ntohl(1)) ? (x) : ((uint64_t)ntohl((x) & 0xFFFFFFFF) << 32) | ntohl((x) >> 32)) extern int cmdlineno; -ssize_t getcmdline(char **line, size_t *len, FILE *in); -int makeargs(char *line, char *argv, int maxargs); char *int_to_str(int val, char *buf); int get_guid(__u64 *guid, const char *arg);
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/include/version.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/include/version.h
Changed
@@ -1,1 +1,1 @@ -static const char version = "6.1.0"; +static const char version = "6.4.0";
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/ip.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/ip.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * ip.c "ip" utility frontend. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/ip6tunnel.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/ip6tunnel.c
Changed
@@ -1,20 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Copyright (C)2006 USAGI/WIDE Project * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see <http://www.gnu.org/licenses>. - */ -/* * Author: * Masahide NAKAMURA @USAGI */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/ip_common.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/ip_common.h
Changed
@@ -28,6 +28,8 @@ char *kind; char *slave_kind; int target_nsid; + bool have_proto; + int proto; }; const char *get_ip_lib_dir(void); @@ -224,8 +226,6 @@ void print_rt_flags(FILE *fp, unsigned int flags); void print_rta_ifidx(FILE *fp, __u32 ifidx, const char *prefix); void __print_rta_gateway(FILE *fp, unsigned char family, const char *gateway); -void print_rta_gateway(FILE *fp, unsigned char family, - const struct rtattr *rta); void size_columns(unsigned int cols, unsigned int n, ...); void print_stats64(FILE *fp, struct rtnl_link_stats64 *s, const struct rtattr *carrier_changes, const char *what);
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/ipaddress.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/ipaddress.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * ipaddress.c "ip address". * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdarg.h> @@ -62,11 +57,13 @@ " ip address show dev IFNAME scope SCOPE-ID master DEVICE \n" " nomaster \n" " type TYPE to PREFIX FLAG-LIST \n" - " label LABEL up vrf NAME \n" + " label LABEL up vrf NAME \n" + " proto ADDRPROTO \n" " ip address {showdump|restore}\n" "IFADDR := PREFIX | ADDR peer PREFIX\n" " broadcast ADDR anycast ADDR \n" " label IFNAME scope SCOPE-ID metric METRIC \n" + " proto ADDRPROTO \n" "SCOPE-ID := host | link | global | NUMBER \n" "FLAG-LIST := FLAG-LIST FLAG\n" "FLAG := permanent | dynamic | secondary | primary |\n" @@ -75,7 +72,9 @@ "CONFFLAG-LIST := CONFFLAG-LIST CONFFLAG\n" "CONFFLAG := home | nodad | mngtmpaddr | noprefixroute | autojoin \n" "LIFETIME := valid_lft LFT preferred_lft LFT \n" - "LFT := forever | SECONDS\n"); + "LFT := forever | SECONDS\n" + "ADDRPROTO := NAME | NUMBER \n" + ); iplink_types_usage(); exit(-1); @@ -1208,7 +1207,7 @@ if (tbIFLA_ALLMULTI) print_uint(PRINT_ANY, "allmulti", - " allmulti %u ", + "allmulti %u ", rta_getattr_u32(tbIFLA_ALLMULTI)); if (tbIFLA_MIN_MTU) @@ -1269,6 +1268,18 @@ "gro_max_size %u ", rta_getattr_u32(tbIFLA_GRO_MAX_SIZE)); + if (tbIFLA_GSO_IPV4_MAX_SIZE) + print_uint(PRINT_ANY, + "gso_ipv4_max_size", + "gso_ipv4_max_size %u ", + rta_getattr_u32(tbIFLA_GSO_IPV4_MAX_SIZE)); + + if (tbIFLA_GRO_IPV4_MAX_SIZE) + print_uint(PRINT_ANY, + "gro_ipv4_max_size", + "gro_ipv4_max_size %u ", + rta_getattr_u32(tbIFLA_GRO_IPV4_MAX_SIZE)); + if (tbIFLA_PHYS_PORT_NAME) print_string(PRINT_ANY, "phys_port_name", @@ -1561,6 +1572,9 @@ if (filter.family && filter.family != ifa->ifa_family) return 0; + if (filter.have_proto && rta_tbIFA_PROTO && + filter.proto != rta_getattr_u8(rta_tbIFA_PROTO)) + return 0; if (ifa_label_match_rta(ifa->ifa_index, rta_tbIFA_LABEL)) return 0; @@ -1668,6 +1682,14 @@ print_ifa_flags(fp, ifa, ifa_flags); + if (rta_tbIFA_PROTO) { + __u8 proto = rta_getattr_u8(rta_tbIFA_PROTO); + + if (proto || is_json_context()) + print_string(PRINT_ANY, "protocol", "proto %s ", + rtnl_addrprot_n2a(proto, b1, sizeof(b1))); + } + if (rta_tbIFA_LABEL) print_string(PRINT_ANY, "label", @@ -2189,6 +2211,14 @@ } else { filter.kind = *argv; } + } else if (strcmp(*argv, "proto") == 0) { + __u8 proto; + + NEXT_ARG(); + if (get_u8(&proto, *argv, 0)) + invarg("\"proto\" value is invalid\n", *argv); + filter.have_proto = true; + filter.proto = proto; } else { if (strcmp(*argv, "dev") == 0) NEXT_ARG(); @@ -2513,6 +2543,13 @@ } else { ifa_flags |= flag_data->mask; } + } else if (strcmp(*argv, "proto") == 0) { + __u8 proto; + + NEXT_ARG(); + if (rtnl_addrprot_a2n(&proto, *argv)) + invarg("\"proto\" value is invalid\n", *argv); + addattr8(&req.n, sizeof(req), IFA_PROTO, proto); } else { if (strcmp(*argv, "local") == 0) NEXT_ARG();
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/ipaddrlabel.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/ipaddrlabel.c
Changed
@@ -1,26 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * ipaddrlabel.c "ip addrlabel" * * Copyright (C)2007 USAGI/WIDE Project * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see <http://www.gnu.org/licenses>. - * - * * Based on iprule.c. * * Authors: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> - * */ #include <stdio.h> @@ -127,6 +113,7 @@ new_json_obj(json); if (rtnl_dump_filter(&rth, print_addrlabel, stdout) < 0) { fprintf(stderr, "Dump terminated\n"); + delete_json_obj(); return 1; } delete_json_obj();
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/ipfou.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/ipfou.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * ipfou.c FOU (foo over UDP) support * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Tom Herbert <therbert@google.com> */ @@ -322,6 +318,7 @@ new_json_obj(json); if (rtnl_dump_filter(&genl_rth, print_fou_mapping, stdout) < 0) { fprintf(stderr, "Dump terminated\n"); + delete_json_obj(); return 1; } delete_json_obj();
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/ipila.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/ipila.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * ipila.c ILA (Identifier Locator Addressing) support * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Tom Herbert <tom@herbertland.com> */ @@ -154,6 +150,7 @@ new_json_obj(json); if (rtnl_dump_filter(&genl_rth, print_ila_mapping, stdout) < 0) { fprintf(stderr, "Dump terminated\n"); + delete_json_obj(); return 1; } delete_json_obj();
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/ipl2tp.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/ipl2tp.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * ipl2tp.c "ip l2tp" * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Original Author: James Chapman <jchapman@katalix.com> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/iplink.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/iplink.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * iplink.c "ip link". * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h> @@ -68,7 +63,7 @@ " mtu MTU index IDX \n" " numtxqueues QUEUE_COUNT \n" " numrxqueues QUEUE_COUNT \n" - " netns { PID | NAME } \n" + " netns { PID | NETNSNAME | NETNSFILE } \n" " type TYPE ARGS \n" "\n" " ip link delete { DEVICE | dev DEVICE | group DEVGROUP } type TYPE ARGS \n" @@ -93,7 +88,7 @@ " address LLADDR \n" " broadcast LLADDR \n" " mtu MTU \n" - " netns { PID | NAME } \n" + " netns { PID | NETNSNAME | NETNSFILE } \n" " link-netns NAME | link-netnsid ID \n" " alias NAME \n" " vf NUM mac LLADDR \n" @@ -119,8 +114,8 @@ " addrgenmode { eui64 | none | stable_secret | random } \n" " protodown { on | off } \n" " protodown_reason PREASON { on | off } \n" - " gso_max_size BYTES | gso_max_segs PACKETS \n" - " gro_max_size BYTES \n" + " gso_max_size BYTES gso_ipv4_max_size BYTES gso_max_segs PACKETS \n" + " gro_max_size BYTES gro_ipv4_max_size BYTES \n" "\n" " ip link show DEVICE | group GROUP up master DEV vrf NAME type TYPE\n" " nomaster\n" @@ -953,6 +948,24 @@ *argv); addattr32(&req->n, sizeof(*req), IFLA_GRO_MAX_SIZE, max_size); + } else if (strcmp(*argv, "gso_ipv4_max_size") == 0) { + unsigned int max_size; + + NEXT_ARG(); + if (get_unsigned(&max_size, *argv, 0)) + invarg("Invalid \"gso_ipv4_max_size\" value\n", + *argv); + addattr32(&req->n, sizeof(*req), + IFLA_GSO_IPV4_MAX_SIZE, max_size); + } else if (strcmp(*argv, "gro_ipv4_max_size") == 0) { + unsigned int max_size; + + NEXT_ARG(); + if (get_unsigned(&max_size, *argv, 0)) + invarg("Invalid \"gro_ipv4_max_size\" value\n", + *argv); + addattr32(&req->n, sizeof(*req), + IFLA_GRO_IPV4_MAX_SIZE, max_size); } else if (strcmp(*argv, "parentdev") == 0) { NEXT_ARG(); addattr_l(&req->n, sizeof(*req), IFLA_PARENT_DEV_NAME, @@ -1616,7 +1629,7 @@ if (!if_printed) { print_uint(PRINT_ANY, "ifindex", "%u:", ifindex); - print_color_string(PRINT_ANY, COLOR_IFNAME, + print_color_string(PRINT_ANY, COLOR_IFNAME, "ifname", "%s", ll_index_to_name(ifindex)); print_nl();
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/iplink_amt.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/iplink_amt.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * iplink_amt.c AMT device support * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Taehee Yoo <ap420073@gmail.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/iplink_batadv.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/iplink_batadv.c
Changed
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * iplink_batadv.c Batman-adv support *
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/iplink_bond.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/iplink_bond.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * iplink_bond.c Bonding device support * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Jiri Pirko <jiri@resnulli.us> * Scott Feldman <sfeldma@cumulusnetworks.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/iplink_bond_slave.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/iplink_bond_slave.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * iplink_bond_slave.c Bonding slave device support * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Jiri Pirko <jiri@resnulli.us> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/iplink_bridge.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/iplink_bridge.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * iplink_bridge.c Bridge device support * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Jiri Pirko <jiri@resnulli.us> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/iplink_bridge_slave.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/iplink_bridge_slave.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * iplink_bridge_slave.c Bridge slave device support * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Jiri Pirko <jiri@resnulli.us> */ @@ -41,9 +37,11 @@ " mcast_to_unicast {on | off} \n" " group_fwd_mask MASK \n" " neigh_suppress {on | off} \n" + " neigh_vlan_suppress {on | off} \n" " vlan_tunnel {on | off} \n" " isolated {on | off} \n" " locked {on | off} \n" + " mab {on | off} \n" " backup_port DEVICE nobackup_port \n" ); } @@ -264,6 +262,11 @@ print_on_off(PRINT_ANY, "neigh_suppress", "neigh_suppress %s ", rta_getattr_u8(tbIFLA_BRPORT_NEIGH_SUPPRESS)); + if (tbIFLA_BRPORT_NEIGH_VLAN_SUPPRESS) + print_on_off(PRINT_ANY, "neigh_vlan_suppress", + "neigh_vlan_suppress %s ", + rta_getattr_u8(tbIFLA_BRPORT_NEIGH_VLAN_SUPPRESS)); + if (tbIFLA_BRPORT_GROUP_FWD_MASK) { char convbuf256; __u16 fwd_mask; @@ -288,6 +291,10 @@ print_on_off(PRINT_ANY, "locked", "locked %s ", rta_getattr_u8(tbIFLA_BRPORT_LOCKED)); + if (tbIFLA_BRPORT_MAB) + print_on_off(PRINT_ANY, "mab", "mab %s ", + rta_getattr_u8(tbIFLA_BRPORT_MAB)); + if (tbIFLA_BRPORT_BACKUP_PORT) { int backup_p = rta_getattr_u32(tbIFLA_BRPORT_BACKUP_PORT); @@ -392,6 +399,10 @@ NEXT_ARG(); bridge_slave_parse_on_off("neigh_suppress", *argv, n, IFLA_BRPORT_NEIGH_SUPPRESS); + } else if (strcmp(*argv, "neigh_vlan_suppress") == 0) { + NEXT_ARG(); + bridge_slave_parse_on_off("neigh_vlan_suppress", *argv, + n, IFLA_BRPORT_NEIGH_VLAN_SUPPRESS); } else if (matches(*argv, "group_fwd_mask") == 0) { __u16 mask; @@ -411,6 +422,10 @@ NEXT_ARG(); bridge_slave_parse_on_off("locked", *argv, n, IFLA_BRPORT_LOCKED); + } else if (strcmp(*argv, "mab") == 0) { + NEXT_ARG(); + bridge_slave_parse_on_off("mab", *argv, n, + IFLA_BRPORT_MAB); } else if (matches(*argv, "backup_port") == 0) { int ifindex;
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/iplink_can.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/iplink_can.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * iplink_can.c CAN device support * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Wolfgang Grandegger <wg@grandegger.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/iplink_geneve.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/iplink_geneve.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * iplink_geneve.c GENEVE device support * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: John W. Linville <linville@tuxdriver.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/iplink_hsr.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/iplink_hsr.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * iplink_hsr.c HSR device support * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Arvid Brodin <arvid.brodin@alten.se> * * Based on iplink_vlan.c by Patrick McHardy <kaber@trash.net>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/iplink_ipoib.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/iplink_ipoib.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * iplink_ipoib.c IPoIB device support * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Or Gerlitz <ogerlitz@mellanox.com> * copied iflink_vlan.c authored by Patrick McHardy <kaber@trash.net> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/iplink_ipvlan.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/iplink_ipvlan.c
Changed
@@ -1,10 +1,6 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* iplink_ipvlan.c IPVLAN/IPVTAP device support * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Mahesh Bandewar <maheshb@google.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/iplink_macvlan.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/iplink_macvlan.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * iplink_macvlan.c macvlan/macvtap device support * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Patrick McHardy <kaber@trash.net> * Arnd Bergmann <arnd@arndb.de> */ @@ -30,13 +26,14 @@ static void print_explain(struct link_util *lu, FILE *f) { fprintf(f, - "Usage: ... %s mode MODE flag MODE_FLAG MODE_OPTS bcqueuelen BC_QUEUE_LEN\n" + "Usage: ... %s mode MODE flag MODE_FLAG MODE_OPTS bcqueuelen BC_QUEUE_LEN bclim BCLIM\n" "\n" "MODE: private | vepa | bridge | passthru | source\n" "MODE_FLAG: null | nopromisc | nodst\n" "MODE_OPTS: for mode \"source\":\n" "\tmacaddr { { add | del } <macaddr> | set <macaddr> <macaddr> ... | flush }\n" - "BC_QUEUE_LEN: Length of the rx queue for broadcast/multicast: 0-4294967295\n", + "BC_QUEUE_LEN: Length of the rx queue for broadcast/multicast: 0-4294967295\n" + "BCLIM: Threshold for broadcast queueing: 32-bit integer\n", lu->id ); } @@ -71,6 +68,12 @@ return -1; } +static int bclim_arg(const char *arg) +{ + fprintf(stderr, "Error: illegal value for \"bclim\": \"%s\"\n", arg); + return -1; +} + static int macvlan_parse_opt(struct link_util *lu, int argc, char **argv, struct nlmsghdr *n) { @@ -172,6 +175,15 @@ return bc_queue_len_arg(*argv); } addattr32(n, 1024, IFLA_MACVLAN_BC_QUEUE_LEN, bc_queue_len); + } else if (!strcmp(*argv, "bclim")) { + __s32 bclim; + NEXT_ARG(); + + if (get_s32(&bclim, *argv, 0)) { + return bclim_arg(*argv); + } + addattr_l(n, 1024, IFLA_MACVLAN_BC_CUTOFF, + &bclim, sizeof(bclim)); } else if (matches(*argv, "help") == 0) { explain(lu); return -1; @@ -249,6 +261,12 @@ print_luint(PRINT_ANY, "usedbcqueuelen", "usedbcqueuelen %lu ", bc_queue_len); } + if (tbIFLA_MACVLAN_BC_CUTOFF && + RTA_PAYLOAD(tbIFLA_MACVLAN_BC_CUTOFF) >= sizeof(__s32)) { + __s32 bclim = rta_getattr_s32(tbIFLA_MACVLAN_BC_CUTOFF); + print_int(PRINT_ANY, "bclim", "bclim %d ", bclim); + } + /* in source mode, there are more options to print */ if (mode != MACVLAN_MODE_SOURCE)
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/iplink_netdevsim.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/iplink_netdevsim.c
Changed
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #include <stdio.h> #include <stdlib.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/iplink_vlan.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/iplink_vlan.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * iplink_vlan.c VLAN device support * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Patrick McHardy <kaber@trash.net> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/iplink_vrf.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/iplink_vrf.c
Changed
@@ -1,10 +1,6 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* iplink_vrf.c VRF device support * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Shrijeet Mukherjee <shm@cumulusnetworks.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/iplink_vxcan.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/iplink_vxcan.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * iplink_vxcan.c vxcan device support (Virtual CAN Tunnel) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Author: Oliver Hartkopp <socketcan@hartkopp.net> * Based on: link_veth.c from Pavel Emelianov <xemul@openvz.org> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/iplink_vxlan.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/iplink_vxlan.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * iplink_vxlan.c VXLAN device support * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Stephen Hemminger <shemminger@vyatta.com */ @@ -23,6 +19,25 @@ #define VXLAN_ATTRSET(attrs, type) (((attrs) & (1L << (type))) != 0) +static const struct vxlan_bool_opt { + const char *key; + int type; + bool default_value; +} vxlan_opts = { + { "external", IFLA_VXLAN_COLLECT_METADATA, false }, + { "vnifilter", IFLA_VXLAN_VNIFILTER, false }, + { "learning", IFLA_VXLAN_LEARNING, true }, + { "proxy", IFLA_VXLAN_PROXY, false }, + { "rsc", IFLA_VXLAN_RSC, false }, + { "l2miss", IFLA_VXLAN_L2MISS, false }, + { "l3miss", IFLA_VXLAN_L3MISS, false }, + { "udp_csum", IFLA_VXLAN_UDP_CSUM, true }, + { "udp_zero_csum6_tx", IFLA_VXLAN_UDP_ZERO_CSUM6_TX, false }, + { "udp_zero_csum6_rx", IFLA_VXLAN_UDP_ZERO_CSUM6_RX, false }, + { "remcsum_tx", IFLA_VXLAN_REMCSUM_TX, false }, + { "remcsum_rx", IFLA_VXLAN_REMCSUM_RX, false }, +}; + static void print_explain(FILE *f) { fprintf(f, @@ -424,6 +439,7 @@ static void vxlan_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb) { + unsigned int i; __u8 ttl = 0; __u8 tos = 0; __u32 maxaddr; @@ -431,16 +447,6 @@ if (!tb) return; - if (tbIFLA_VXLAN_COLLECT_METADATA && - rta_getattr_u8(tbIFLA_VXLAN_COLLECT_METADATA)) { - print_bool(PRINT_ANY, "external", "external ", true); - } - - if (tbIFLA_VXLAN_VNIFILTER && - rta_getattr_u8(tbIFLA_VXLAN_VNIFILTER)) { - print_bool(PRINT_ANY, "vnifilter", "vnifilter", true); - } - if (tbIFLA_VXLAN_ID && RTA_PAYLOAD(tbIFLA_VXLAN_ID) >= sizeof(__u32)) { print_uint(PRINT_ANY, "id", "id %u ", rta_getattr_u32(tbIFLA_VXLAN_ID)); @@ -533,26 +539,6 @@ "dstport %u ", rta_getattr_be16(tbIFLA_VXLAN_PORT)); - if (tbIFLA_VXLAN_LEARNING) { - __u8 learning = rta_getattr_u8(tbIFLA_VXLAN_LEARNING); - - print_bool(PRINT_JSON, "learning", NULL, learning); - if (!learning) - print_bool(PRINT_FP, NULL, "nolearning ", true); - } - - if (tbIFLA_VXLAN_PROXY && rta_getattr_u8(tbIFLA_VXLAN_PROXY)) - print_bool(PRINT_ANY, "proxy", "proxy ", true); - - if (tbIFLA_VXLAN_RSC && rta_getattr_u8(tbIFLA_VXLAN_RSC)) - print_bool(PRINT_ANY, "rsc", "rsc ", true); - - if (tbIFLA_VXLAN_L2MISS && rta_getattr_u8(tbIFLA_VXLAN_L2MISS)) - print_bool(PRINT_ANY, "l2miss", "l2miss ", true); - - if (tbIFLA_VXLAN_L3MISS && rta_getattr_u8(tbIFLA_VXLAN_L3MISS)) - print_bool(PRINT_ANY, "l3miss", "l3miss ", true); - if (tbIFLA_VXLAN_TOS) tos = rta_getattr_u8(tbIFLA_VXLAN_TOS); if (tos) { @@ -605,58 +591,22 @@ ((maxaddr = rta_getattr_u32(tbIFLA_VXLAN_LIMIT)) != 0)) print_uint(PRINT_ANY, "limit", "maxaddr %u ", maxaddr); - if (tbIFLA_VXLAN_UDP_CSUM) { - __u8 udp_csum = rta_getattr_u8(tbIFLA_VXLAN_UDP_CSUM); - - if (is_json_context()) { - print_bool(PRINT_ANY, "udp_csum", NULL, udp_csum); - } else { - if (!udp_csum) - fputs("no", f); - fputs("udpcsum ", f); - } - } - - if (tbIFLA_VXLAN_UDP_ZERO_CSUM6_TX) { - __u8 csum6 = rta_getattr_u8(tbIFLA_VXLAN_UDP_ZERO_CSUM6_TX); + if (tbIFLA_VXLAN_GBP) + print_null(PRINT_ANY, "gbp", "gbp ", NULL); + if (tbIFLA_VXLAN_GPE) + print_null(PRINT_ANY, "gpe", "gpe ", NULL); - if (is_json_context()) { - print_bool(PRINT_ANY, - "udp_zero_csum6_tx", NULL, csum6); - } else { - if (!csum6) - fputs("no", f); - fputs("udp6zerocsumtx ", f); - } - } + for (i = 0; i < ARRAY_SIZE(vxlan_opts); i++) { + const struct vxlan_bool_opt *opt = &vxlan_optsi; + __u8 val; - if (tbIFLA_VXLAN_UDP_ZERO_CSUM6_RX) { - __u8 csum6 = rta_getattr_u8(tbIFLA_VXLAN_UDP_ZERO_CSUM6_RX); + if (!tbopt->type) + continue; + val = rta_getattr_u8(tbopt->type); - if (is_json_context()) { - print_bool(PRINT_ANY, - "udp_zero_csum6_rx", - NULL, - csum6); - } else { - if (!csum6) - fputs("no", f); - fputs("udp6zerocsumrx ", f); - } + print_bool_opt(PRINT_ANY, opt->key, val, + val != opt->default_value || show_details > 1); } - - if (tbIFLA_VXLAN_REMCSUM_TX && - rta_getattr_u8(tbIFLA_VXLAN_REMCSUM_TX)) - print_bool(PRINT_ANY, "remcsum_tx", "remcsumtx ", true); - - if (tbIFLA_VXLAN_REMCSUM_RX && - rta_getattr_u8(tbIFLA_VXLAN_REMCSUM_RX)) - print_bool(PRINT_ANY, "remcsum_rx", "remcsumrx ", true); - - if (tbIFLA_VXLAN_GBP) - print_bool(PRINT_ANY, "gbp", "gbp ", true); - if (tbIFLA_VXLAN_GPE) - print_bool(PRINT_ANY, "gpe", "gpe ", true); } static void vxlan_print_help(struct link_util *lu, int argc, char **argv,
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/iplink_xdp.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/iplink_xdp.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * iplink_xdp.c XDP program loader * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Daniel Borkmann <daniel@iogearbox.net> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/iplink_xstats.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/iplink_xstats.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * iplink_stats.c Extended statistics commands * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/ipmacsec.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/ipmacsec.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * ipmacsec.c "ip macsec". * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Sabrina Dubroca <sd@queasysnail.net> */ @@ -942,8 +938,8 @@ print_uint(PRINT_ANY, "an", "%d:", rta_getattr_u8(sa_attrMACSEC_SA_ATTR_AN)); if (is_xpn) { - print_uint(PRINT_ANY, "pn", " PN %u,", - rta_getattr_u64(sa_attrMACSEC_SA_ATTR_PN)); + print_lluint(PRINT_ANY, "pn", " PN %llu,", + rta_getattr_u64(sa_attrMACSEC_SA_ATTR_PN)); print_0xhex(PRINT_ANY, "ssci", "SSCI %08x", ntohl(rta_getattr_u32(sa_attrMACSEC_SA_ATTR_SSCI))); @@ -1019,8 +1015,8 @@ print_uint(PRINT_ANY, "an", "%u:", rta_getattr_u8(sa_attrMACSEC_SA_ATTR_AN)); if (is_xpn) { - print_uint(PRINT_ANY, "pn", " PN %u,", - rta_getattr_u64(sa_attrMACSEC_SA_ATTR_PN)); + print_lluint(PRINT_ANY, "pn", " PN %llu,", + rta_getattr_u64(sa_attrMACSEC_SA_ATTR_PN)); print_0xhex(PRINT_ANY, "ssci", "SSCI %08x", ntohl(rta_getattr_u32(sa_attrMACSEC_SA_ATTR_SSCI))); @@ -1517,7 +1513,8 @@ &cipher.icv_len, sizeof(cipher.icv_len)); if (replay_protect != -1) { - addattr32(n, MACSEC_BUFLEN, IFLA_MACSEC_WINDOW, window); + if (replay_protect) + addattr32(n, MACSEC_BUFLEN, IFLA_MACSEC_WINDOW, window); addattr8(n, MACSEC_BUFLEN, IFLA_MACSEC_REPLAY_PROTECT, replay_protect); }
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/ipmaddr.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/ipmaddr.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * ipmaddr.c "ip maddress". * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h> @@ -107,6 +102,8 @@ if (len >= 0) { struct ma_info *ma = malloc(sizeof(m)); + if (ma == NULL) + break; memcpy(ma, &m, sizeof(m)); ma->addr.bytelen = len; ma->addr.bitlen = len<<3; @@ -154,6 +151,9 @@ sscanf(buf, "%08x%d", (__u32 *)&m.addr.data, &m.users); ma = malloc(sizeof(m)); + if (ma == NULL) + break; + memcpy(ma, &m, sizeof(m)); maddr_ins(result_p, ma); } @@ -183,8 +183,10 @@ if (len >= 0) { struct ma_info *ma = malloc(sizeof(m)); - memcpy(ma, &m, sizeof(m)); + if (ma == NULL) + break; + memcpy(ma, &m, sizeof(m)); ma->addr.bytelen = len; ma->addr.bitlen = len<<3; maddr_ins(result_p, ma);
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/ipmonitor.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/ipmonitor.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * ipmonitor.c "ip monitor". * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/ipmptcp.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/ipmptcp.c
Changed
@@ -454,6 +454,8 @@ MPTCP_EVENT_SUB_ESTABLISHED = "SF_ESTABLISHED", MPTCP_EVENT_SUB_CLOSED = "SF_CLOSED", MPTCP_EVENT_SUB_PRIORITY = "SF_PRIO", + MPTCP_EVENT_LISTENER_CREATED = "LISTENER_CREATED", + MPTCP_EVENT_LISTENER_CLOSED = "LISTENER_CLOSED", }; static void print_addr(const char *key, int af, struct rtattr *value) @@ -492,11 +494,12 @@ goto out; } - printf("%14s", event_to_strghdr->cmd); + printf("%16s", event_to_strghdr->cmd); parse_rtattr(tb, MPTCP_ATTR_MAX, (void *) ghdr + GENL_HDRLEN, len); - printf(" token=%08x", rta_getattr_u32(tbMPTCP_ATTR_TOKEN)); + if (tbMPTCP_ATTR_TOKEN) + printf(" token=%08x", rta_getattr_u32(tbMPTCP_ATTR_TOKEN)); if (tbMPTCP_ATTR_REM_ID) printf(" remid=%u", rta_getattr_u8(tbMPTCP_ATTR_REM_ID));
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/ipmroute.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/ipmroute.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * ipmroute.c "ip mroute". * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/ipneigh.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/ipneigh.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * ipneigh.c "ip neigh". * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h> @@ -729,12 +724,15 @@ return -2; ipneigh_reset_filter(0); + new_json_obj(json); if (print_neigh(answer, stdout) < 0) { fprintf(stderr, "An error :-)\n"); free(answer); + delete_json_obj(); return -1; } free(answer); + delete_json_obj(); return 0; }
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/ipnetconf.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/ipnetconf.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * ipnetconf.c "ip netconf". * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Nicolas Dichtel, <nicolas.dichtel@6wind.com> - * */ #include <stdio.h> @@ -214,6 +209,7 @@ */ if (errno == EOPNOTSUPP && filter.family == AF_UNSPEC) { + delete_json_obj(); filter.family = AF_INET; goto dump; }
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/ipnetns.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/ipnetns.c
Changed
@@ -967,9 +967,8 @@ static int netns_set(int argc, char **argv) { - char netns_pathPATH_MAX; const char *name; - int netns, nsid; + int nsid; if (argc < 1) { fprintf(stderr, "No netns name specified\n"); @@ -988,14 +987,6 @@ else if (nsid < 0) invarg("\"netnsid\" value should be >= 0", argv1); - snprintf(netns_path, sizeof(netns_path), "%s/%s", NETNS_RUN_DIR, name); - netns = open(netns_path, O_RDONLY | O_CLOEXEC); - if (netns < 0) { - fprintf(stderr, "Cannot open network namespace \"%s\": %s\n", - name, strerror(errno)); - return -1; - } - return set_netnsid_from_name(name, nsid); }
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/ipnexthop.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/ipnexthop.c
Changed
@@ -345,10 +345,8 @@ static void ipnh_destroy_entry(struct nh_entry *nhe) { - if (nhe->nh_encap) - free(nhe->nh_encap); - if (nhe->nh_groups) - free(nhe->nh_groups); + free(nhe->nh_encap); + free(nhe->nh_groups); } /* parse nhmsg into nexthop entry struct which must be destroyed by @@ -586,8 +584,7 @@ ipnh_cache_link_entry(nhe); out: - if (answer) - free(answer); + free(answer); return nhe; @@ -1021,6 +1018,7 @@ new_json_obj(json); if (print_nexthop_nocache(answer, (void *)stdout) < 0) { + delete_json_obj(); free(answer); return -1; } @@ -1106,6 +1104,7 @@ new_json_obj(json); if (rtnl_dump_filter(&rth, print_nexthop_nocache, stdout) < 0) { + delete_json_obj(); fprintf(stderr, "Dump terminated\n"); return -2; } @@ -1181,6 +1180,7 @@ new_json_obj(json); if (rtnl_dump_filter(&rth, print_nexthop_bucket, stdout) < 0) { + delete_json_obj(); fprintf(stderr, "Dump terminated\n"); return -2; } @@ -1221,6 +1221,7 @@ new_json_obj(json); if (print_nexthop_bucket(answer, (void *)stdout) < 0) { + delete_json_obj(); free(answer); return -1; }
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/ipntable.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/ipntable.c
Changed
@@ -1,23 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Copyright (C)2006 USAGI/WIDE Project * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see <http://www.gnu.org/licenses>. - */ -/* * based on ipneigh.c - */ -/* + * * Authors: * Masahide NAKAMURA @USAGI */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/ipprefix.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/ipprefix.c
Changed
@@ -1,23 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Copyright (C)2005 USAGI/WIDE Project * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see <http://www.gnu.org/licenses>. - */ -/* * based on ip.c, iproute.c - */ -/* + * * Authors: * Masahide NAKAMURA @USAGI */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/iproute.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/iproute.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * iproute.c "ip route". * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h> @@ -563,7 +558,7 @@ } } -void print_rta_gateway(FILE *fp, unsigned char family, const struct rtattr *rta) +static void print_rta_gateway(FILE *fp, unsigned char family, const struct rtattr *rta) { const char *gateway = format_host_rta(family, rta); @@ -753,6 +748,7 @@ int ret; SPRINT_BUF(b1); + SPRINT_BUF(b2); if (n->nlmsg_type != RTM_NEWROUTE && n->nlmsg_type != RTM_DELROUTE) { fprintf(stderr, "Not a route: %08x %08x %08x\n", @@ -814,7 +810,7 @@ r->rtm_dst_len); } else { const char *hostname = format_host_rta_r(family, tbRTA_DST, - b1, sizeof(b1)); + b2, sizeof(b2)); if (hostname) strncpy(b1, hostname, sizeof(b1) - 1); } @@ -837,7 +833,7 @@ r->rtm_src_len); } else { const char *hostname = format_host_rta_r(family, tbRTA_SRC, - b1, sizeof(b1)); + b2, sizeof(b2)); if (hostname) strncpy(b1, hostname, sizeof(b1) - 1); } @@ -1981,6 +1977,7 @@ if (rtnl_dump_filter_errhndlr(&rth, filter_fn, stdout, save_route_errhndlr, NULL) < 0) { fprintf(stderr, "Dump terminated\n"); + delete_json_obj(); return -2; } @@ -2176,18 +2173,21 @@ if (print_route(answer, (void *)stdout) < 0) { fprintf(stderr, "An error :-)\n"); + delete_json_obj(); free(answer); return -1; } if (answer->nlmsg_type != RTM_NEWROUTE) { fprintf(stderr, "Not a route?\n"); + delete_json_obj(); free(answer); return -1; } len -= NLMSG_LENGTH(sizeof(*r)); if (len < 0) { fprintf(stderr, "Wrong len %d\n", len); + delete_json_obj(); free(answer); return -1; } @@ -2199,6 +2199,7 @@ r->rtm_src_len = 8*RTA_PAYLOAD(tbRTA_PREFSRC); } else if (!tbRTA_SRC) { fprintf(stderr, "Failed to connect the route\n"); + delete_json_obj(); free(answer); return -1; } @@ -2221,6 +2222,7 @@ if (print_route(answer, (void *)stdout) < 0) { fprintf(stderr, "An error :-)\n"); + delete_json_obj(); free(answer); return -1; }
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/iproute_lwtunnel.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/iproute_lwtunnel.c
Changed
@@ -1,14 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * iproute_lwtunnel.c * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Roopa Prabhu, <roopa@cumulusnetworks.com> * Thomas Graf <tgraf@suug.ch> - * */ #include <stdio.h> @@ -37,7 +32,7 @@ #include <linux/ioam6.h> #include <linux/ioam6_iptunnel.h> -static const char *format_encap_type(int type) +static const char *format_encap_type(uint16_t type) { switch (type) { case LWTUNNEL_ENCAP_MPLS: @@ -67,7 +62,7 @@ static void encap_type_usage(void) { - int i; + uint16_t i; fprintf(stderr, "Usage: ip route ... encap TYPE OPTIONS ...\n"); @@ -78,7 +73,7 @@ exit(-1); } -static int read_encap_type(const char *name) +static uint16_t read_encap_type(const char *name) { if (strcmp(name, "mpls") == 0) return LWTUNNEL_ENCAP_MPLS; @@ -145,7 +140,7 @@ static const char *format_seg6mode_type(int mode) { - if (mode < 0 || mode > ARRAY_SIZE(seg6_mode_types)) + if (mode < 0 || mode >= ARRAY_SIZE(seg6_mode_types)) return "<unknown>"; return seg6_mode_typesmode; @@ -839,14 +834,15 @@ void lwt_print_encap(FILE *fp, struct rtattr *encap_type, struct rtattr *encap) { - int et; + uint16_t et; if (!encap_type) return; et = rta_getattr_u16(encap_type); - - print_string(PRINT_ANY, "encap", " encap %s ", format_encap_type(et)); + open_json_object("encap"); + print_string(PRINT_ANY, "encap_type", " encap %s ", + format_encap_type(et)); switch (et) { case LWTUNNEL_ENCAP_MPLS: @@ -880,6 +876,7 @@ print_encap_xfrm(fp, encap); break; } + close_json_object(); } static struct ipv6_sr_hdr *parse_srh(char *segbuf, int hmac, bool encap) @@ -903,6 +900,9 @@ srhlen += 40; srh = malloc(srhlen); + if (srh == NULL) + return NULL; + memset(srh, 0, srhlen); srh->hdrlen = (srhlen >> 3) - 1; @@ -938,14 +938,14 @@ char ***argvp) { int mode_ok = 0, segs_ok = 0, hmac_ok = 0; - struct seg6_iptunnel_encap *tuninfo; + struct seg6_iptunnel_encap *tuninfo = NULL; struct ipv6_sr_hdr *srh; char **argv = *argvp; char segbuf1024 = ""; int argc = *argcp; int encap = -1; __u32 hmac = 0; - int ret = 0; + int ret = -1; int srhlen; while (argc > 0) { @@ -964,7 +964,7 @@ invarg("\"segs\" provided before \"mode\"\n", *argv); - strlcpy(segbuf, *argv, 1024); + strlcpy(segbuf, *argv, sizeof(segbuf)); } else if (strcmp(*argv, "hmac") == 0) { NEXT_ARG(); if (hmac_ok++) @@ -977,9 +977,13 @@ } srh = parse_srh(segbuf, hmac, encap); + if (srh == NULL) + goto out; srhlen = (srh->hdrlen + 1) << 3; tuninfo = malloc(sizeof(*tuninfo) + srhlen); + if (tuninfo == NULL) + goto out; memset(tuninfo, 0, sizeof(*tuninfo) + srhlen); tuninfo->mode = encap; @@ -987,13 +991,12 @@ memcpy(tuninfo->srh, srh, srhlen); if (rta_addattr_l(rta, len, SEG6_IPTUNNEL_SRH, tuninfo, - sizeof(*tuninfo) + srhlen)) { - ret = -1; + sizeof(*tuninfo) + srhlen)) goto out; - } *argcp = argc + 1; *argvp = argv - 1; + ret = 0; out: free(tuninfo); @@ -1017,6 +1020,8 @@ srhlen = 8 + 16 * nsegs; srh = calloc(1, srhlen); + if (srh == NULL) + return NULL; srh->hdrlen = (srhlen >> 3) - 1; srh->type = 3; @@ -1050,7 +1055,7 @@ if (segs_ok++) duparg2("segs", *argv); - strlcpy(segbuf, *argv, 1024); + strlcpy(segbuf, *argv, sizeof(segbuf)); } else { break; } @@ -1471,8 +1476,7 @@ NEXT_ARG(); if (segs_ok++) duparg2("segs", *argv); - strncpy(segbuf, *argv, 1024); - segbuf1023 = 0; + strlcpy(segbuf, *argv, sizeof(segbuf)); if (!NEXT_ARG_OK()) break; NEXT_ARG();
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/iprule.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/iprule.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * iprule.c "ip rule". * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h> @@ -700,7 +695,7 @@ else if (ret != 2) invarg("invalid dport range\n", *argv); filter.dport = r; - } else{ + } else { if (matches(*argv, "dst") == 0 || matches(*argv, "to") == 0) { NEXT_ARG(); @@ -719,6 +714,7 @@ new_json_obj(json); if (rtnl_dump_filter(&rth, filter_fn, stdout) < 0) { fprintf(stderr, "Dump terminated\n"); + delete_json_obj(); return 1; } delete_json_obj();
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/ipseg6.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/ipseg6.c
Changed
@@ -1,10 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * seg6.c "ip sr/seg6" * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation; - * * Author: David Lebrun <david.lebrun@uclouvain.be> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/ipstats.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/ipstats.c
Changed
@@ -88,8 +88,11 @@ return 0; attrs->tbsgroup = calloc(ifla_max + 1, sizeof(*attrs->tbsgroup)); - if (attrs->tbsgroup == NULL) - return -ENOMEM; + if (attrs->tbsgroup == NULL) { + fprintf(stderr, "Error parsing netlink answer: %s\n", + strerror(errno)); + return -errno; + } if (group == 0) err = parse_rtattr(attrs->tbsgroup, ifla_max, @@ -755,11 +758,8 @@ } err = ipstats_stat_show_attrs_alloc_tb(&show_attrs, 0); - if (err != 0) { - fprintf(stderr, "Error parsing netlink answer: %s\n", - strerror(err)); + if (err) return err; - } dev = ll_index_to_name(show_attrs.ifsm->ifindex);
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/iptoken.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/iptoken.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * iptoken.c "ip token" * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Daniel Borkmann, <borkmann@redhat.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/iptunnel.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/iptunnel.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * iptunnel.c "ip tunnel" * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h> @@ -22,6 +17,7 @@ #include <net/if_arp.h> #include <linux/ip.h> #include <linux/if_tunnel.h> +#include <linux/ip6_tunnel.h> #include "rt_names.h" #include "utils.h" @@ -177,11 +173,20 @@ if (get_ifname(p->name, *argv)) invarg("\"name\" not a valid ifname", *argv); if (cmd == SIOCCHGTUNNEL && count == 0) { - struct ip_tunnel_parm old_p = {}; + union { + struct ip_tunnel_parm ip_tnl; + struct ip6_tnl_parm2 ip6_tnl; + } old_p = {}; if (tnl_get_ioctl(*argv, &old_p)) return -1; - *p = old_p; + + if (old_p.ip_tnl.iph.version != 4 || + old_p.ip_tnl.iph.ihl != 5) + invarg("\"name\" is not an ip tunnel", + *argv); + + *p = old_p.ip_tnl; } } count++;
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/iptuntap.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/iptuntap.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * iptunnel.c "ip tuntap" * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: David Woodhouse <David.Woodhouse@intel.com> - * */ #include <stdio.h> @@ -446,6 +441,7 @@ if (rtnl_dump_filter(&rth, print_tuntap, NULL) < 0) { fprintf(stderr, "Dump terminated\n"); + delete_json_obj(); return -1; }
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/ipvrf.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/ipvrf.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * ipvrf.c "ip vrf" * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: David Ahern <dsa@cumulusnetworks.com> - * */ #include <sys/types.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/ipxfrm.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/ipxfrm.c
Changed
@@ -1,25 +1,9 @@ -/* $USAGI: $ */ - +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Copyright (C)2004 USAGI/WIDE Project * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see <http://www.gnu.org/licenses>. - */ -/* * based on ip.c, iproute.c - */ -/* + * * Authors: * Masahide NAKAMURA @USAGI */ @@ -688,8 +672,8 @@ return 0; } -void xfrm_xfrma_print(struct rtattr *tb, __u16 family, - FILE *fp, const char *prefix, bool nokeys) +void xfrm_xfrma_print(struct rtattr *tb, __u16 family, FILE *fp, + const char *prefix, bool nokeys, bool dir) { if (tbXFRMA_MARK) { struct rtattr *rta = tbXFRMA_MARK; @@ -895,8 +879,13 @@ xuo = (struct xfrm_user_offload *) RTA_DATA(tbXFRMA_OFFLOAD_DEV); - fprintf(fp, "dev %s dir %s", ll_index_to_name(xuo->ifindex), + fprintf(fp, "dev %s ", + ll_index_to_name(xuo->ifindex)); + if (dir) + fprintf(fp, "dir %s ", (xuo->flags & XFRM_OFFLOAD_INBOUND) ? "in" : "out"); + fprintf(fp, "mode %s", + (xuo->flags & XFRM_OFFLOAD_PACKET) ? "packet" : "crypto"); fprintf(fp, "%s", _SL_); } if (tbXFRMA_IF_ID) { @@ -988,7 +977,7 @@ fprintf(fp, " (0x%s)", strxf_mask8(xsinfo->flags)); fprintf(fp, "%s", _SL_); - xfrm_xfrma_print(tb, xsinfo->family, fp, buf, nokeys); + xfrm_xfrma_print(tb, xsinfo->family, fp, buf, nokeys, true); if (!xfrm_selector_iszero(&xsinfo->sel)) { char sbufSTRBUF_SIZE; @@ -1094,7 +1083,7 @@ if (show_stats > 0) xfrm_lifetime_print(&xpinfo->lft, &xpinfo->curlft, fp, buf); - xfrm_xfrma_print(tb, xpinfo->sel.family, fp, buf, false); + xfrm_xfrma_print(tb, xpinfo->sel.family, fp, buf, false, false); } int xfrm_id_parse(xfrm_address_t *saddr, struct xfrm_id *id, __u16 *family,
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/link_gre.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/link_gre.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * link_gre.c gre driver module * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Herbert Xu <herbert@gondor.apana.org.au> - * */ #include <string.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/link_gre6.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/link_gre6.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * link_gre6.c gre driver module * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Dmitry Kozlov <xeb@mail.ru> - * */ #include <string.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/link_ip6tnl.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/link_ip6tnl.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * link_ip6tnl.c ip6tnl driver module * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Nicolas Dichtel <nicolas.dichtel@6wind.com> - * */ #include <string.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/link_iptnl.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/link_iptnl.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * link_iptnl.c ipip and sit driver module * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Nicolas Dichtel <nicolas.dichtel@6wind.com> - * */ #include <string.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/link_veth.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/link_veth.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * link_veth.c veth driver module * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Pavel Emelianov <xemul@openvz.org> - * */ #include <string.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/link_vti.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/link_vti.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * link_vti.c VTI driver module * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Herbert Xu <herbert@gondor.apana.org.au> * Saurabh Mohan <saurabh.mohan@vyatta.com> Modified link_gre.c for VTI */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/link_vti6.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/link_vti6.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * link_vti6.c VTI driver module * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Herbert Xu <herbert@gondor.apana.org.au> * Saurabh Mohan <saurabh.mohan@vyatta.com> Modified link_gre.c for VTI * Steffen Klassert <steffen.klassert@secunet.com> Modified link_vti.c for IPv6
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/rtm_map.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/rtm_map.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * rtm_map.c * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/rtmon.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/rtmon.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * rtmon.c RTnetlink listener. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/tcp_metrics.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/tcp_metrics.c
Changed
@@ -1,10 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * tcp_metrics.c "ip tcp_metrics/tcpmetrics" * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation; - * * Authors: Julian Anastasov <ja@ssi.bg>, August 2012 */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/tunnel.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/tunnel.c
Changed
@@ -1,23 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Copyright (C)2006 USAGI/WIDE Project * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see <http://www.gnu.org/licenses>. - */ -/* * split from ip_tunnel.c - */ -/* + * * Author: * Masahide NAKAMURA @USAGI */ @@ -433,11 +419,13 @@ new_json_obj(json); if (rtnl_linkdump_req(&rth, preferred_family) < 0) { perror("Cannot send dump request\n"); + delete_json_obj(); return -1; } if (rtnl_dump_filter(&rth, print_nlmsg_tunnel, info) < 0) { fprintf(stderr, "Dump terminated\n"); + delete_json_obj(); return -1; } delete_json_obj();
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/tunnel.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/tunnel.h
Changed
@@ -1,20 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Copyright (C)2006 USAGI/WIDE Project * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see <http://www.gnu.org/licenses>. - */ -/* * Author: * Masahide NAKAMURA @USAGI */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/xfrm.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/xfrm.h
Changed
@@ -1,22 +1,7 @@ -/* $USAGI: $ */ - +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Copyright (C)2004 USAGI/WIDE Project * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see <http://www.gnu.org/licenses>. - */ -/* * Authors: * Masahide NAKAMURA @USAGI */ @@ -105,7 +90,6 @@ extern struct xfrm_filter filter; int xfrm_state_print(struct nlmsghdr *n, void *arg); -int xfrm_state_print_nokeys(struct nlmsghdr *n, void *arg); int xfrm_policy_print(struct nlmsghdr *n, void *arg); int do_xfrm_state(int argc, char **argv); int do_xfrm_policy(int argc, char **argv); @@ -124,8 +108,8 @@ const char *strxf_ptype(__u8 ptype); void xfrm_selector_print(struct xfrm_selector *sel, __u16 family, FILE *fp, const char *prefix); -void xfrm_xfrma_print(struct rtattr *tb, __u16 family, - FILE *fp, const char *prefix, bool nokeys); +void xfrm_xfrma_print(struct rtattr *tb, __u16 family, FILE *fp, + const char *prefix, bool nokeys, bool dir); void xfrm_state_info_print(struct xfrm_usersa_info *xsinfo, struct rtattr *tb, FILE *fp, const char *prefix, const char *title, bool nokeys);
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/xfrm_monitor.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/xfrm_monitor.c
Changed
@@ -1,25 +1,9 @@ -/* $USAGI: $ */ - +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Copyright (C)2005 USAGI/WIDE Project * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see <http://www.gnu.org/licenses>. - */ -/* * based on ipmonitor.c - */ -/* + * * Authors: * Masahide NAKAMURA @USAGI */ @@ -199,7 +183,7 @@ parse_rtattr(tb, XFRMA_MAX, XFRMREP_RTA(xrep), len); - xfrm_xfrma_print(tb, family, fp, " ", nokeys); + xfrm_xfrma_print(tb, family, fp, " ", nokeys, true); if (oneline) fprintf(fp, "\n");
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/xfrm_policy.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/xfrm_policy.c
Changed
@@ -1,25 +1,9 @@ -/* $USAGI: $ */ - +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Copyright (C)2004 USAGI/WIDE Project * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see <http://www.gnu.org/licenses>. - */ -/* * based on iproute.c - */ -/* + * * Authors: * Masahide NAKAMURA @USAGI */ @@ -57,6 +41,7 @@ " mark MARK mask MASK index INDEX ptype PTYPE \n" " action ACTION priority PRIORITY flag FLAG-LIST \n" " if_id IF_ID LIMIT-LIST TMPL-LIST \n" + " offload packet dev DEV } \n" "Usage: ip xfrm policy { delete | get } { SELECTOR | index INDEX } dir DIR\n" " ctx CTX mark MARK mask MASK ptype PTYPE \n" " if_id IF_ID \n" @@ -260,6 +245,7 @@ char *ptypep = NULL; char *sctxp = NULL; struct xfrm_userpolicy_type upt = {}; + struct xfrm_user_offload xuo = {}; char tmpls_bufXFRM_TMPLS_BUF_SIZE = {}; int tmpls_len = 0; struct xfrm_mark mark = {0, 0}; @@ -268,6 +254,8 @@ char strCTX_BUF_SIZE; } ctx = {}; bool is_if_id_set = false; + unsigned int ifindex = 0; + bool is_offload = false; __u32 if_id = 0; while (argc > 0) { @@ -342,6 +330,21 @@ if (get_u32(&if_id, *argv, 0)) invarg("IF_ID value is invalid", *argv); is_if_id_set = true; + } else if (strcmp(*argv, "offload") == 0) { + NEXT_ARG(); + if (strcmp(*argv, "packet") == 0) + NEXT_ARG(); + else + invarg("Invalid offload mode", *argv); + + if (strcmp(*argv, "dev") == 0) { + NEXT_ARG(); + ifindex = ll_name_to_index(*argv); + if (!ifindex) + invarg("Invalid device name", *argv); + } else + invarg("Missing dev keyword", *argv); + is_offload = true; } else { if (selp) duparg("unknown", *argv); @@ -387,6 +390,13 @@ if (is_if_id_set) addattr32(&req.n, sizeof(req.buf), XFRMA_IF_ID, if_id); + if (is_offload) { + xuo.ifindex = ifindex; + xuo.flags |= XFRM_OFFLOAD_PACKET; + addattr_l(&req.n, sizeof(req.buf), XFRMA_OFFLOAD_DEV, &xuo, + sizeof(xuo)); + } + if (rtnl_open_byproto(&rth, 0, NETLINK_XFRM) < 0) exit(1); @@ -1131,7 +1141,8 @@ if (strcmp(name, "block") == 0) { *policy = XFRM_USERPOLICY_BLOCK; return 0; - } else if (strcmp(name, "accept") == 0) { + } else if (strcmp(name, "accept") == 0 || + strcmp(name, "allow") == 0) { *policy = XFRM_USERPOLICY_ACCEPT; return 0; }
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/ip/xfrm_state.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/ip/xfrm_state.c
Changed
@@ -1,25 +1,9 @@ -/* $USAGI: $ */ - +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Copyright (C)2004 USAGI/WIDE Project * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see <http://www.gnu.org/licenses>. - */ -/* * based on iproute.c - */ -/* + * * Authors: * Masahide NAKAMURA @USAGI */ @@ -61,7 +45,7 @@ " replay-seq-hi SEQ replay-oseq-hi SEQ \n" " flag FLAG-LIST sel SELECTOR LIMIT-LIST encap ENCAP \n" " coa ADDR/PLEN ctx CTX extra-flag EXTRA-FLAG-LIST \n" - " offload dev DEV dir DIR \n" + " offload crypto | packet dev DEV dir DIR \n" " output-mark OUTPUT-MARK mask MASK \n" " if_id IF_ID tfcpad LENGTH \n" "Usage: ip xfrm state allocspi ID mode MODE mark MARK mask MASK \n" @@ -267,7 +251,7 @@ return 0; } -static int xfrm_offload_dir_parse(__u8 *dir, int *argcp, char ***argvp) +static bool xfrm_offload_dir_parse(__u8 *dir, int *argcp, char ***argvp) { int argc = *argcp; char **argv = *argvp; @@ -277,12 +261,12 @@ else if (strcmp(*argv, "out") == 0) *dir = 0; else - invarg("DIR value is invalid", *argv); + return false; *argcp = argc; *argvp = argv; - return 0; + return true; } static int xfrm_state_modify(int cmd, unsigned int flags, int argc, char **argv) @@ -307,7 +291,7 @@ struct xfrm_user_offload xuo = {}; unsigned int ifindex = 0; __u8 dir = 0; - bool is_offload = false; + bool is_offload = false, is_packet_offload = false; __u32 replay_window = 0; __u32 seq = 0, oseq = 0, seq_hi = 0, oseq_hi = 0; char *idp = NULL; @@ -424,24 +408,37 @@ addattr_l(&req.n, sizeof(req.buf), XFRMA_SEC_CTX, (void *)&ctx, ctx.sctx.len); } else if (strcmp(*argv, "offload") == 0) { - is_offload = true; NEXT_ARG(); - if (strcmp(*argv, "dev") == 0) { + /* If user doesn't provide offload mode, treat it as + * crypto one for the backward compatibility. + */ + if (strcmp(*argv, "crypto") == 0) NEXT_ARG(); - ifindex = ll_name_to_index(*argv); - if (!ifindex) { - invarg("value after \"offload dev\" is invalid", *argv); - is_offload = false; - } + else if (strcmp(*argv, "packet") == 0) { + is_packet_offload = true; NEXT_ARG(); } + + if (strcmp(*argv, "dev") == 0) { + NEXT_ARG(); + ifindex = ll_name_to_index(*argv); + if (!ifindex) + invarg("Invalid device name", *argv); + } else + invarg("Missing dev keyword", *argv); + + NEXT_ARG(); if (strcmp(*argv, "dir") == 0) { + bool is_dir; + NEXT_ARG(); - xfrm_offload_dir_parse(&dir, &argc, &argv); - } else { - invarg("value after \"offload dir\" is invalid", *argv); - is_offload = false; - } + is_dir = xfrm_offload_dir_parse(&dir, &argc, + &argv); + if (!is_dir) + invarg("DIR value is invalid", *argv); + } else + invarg("Missing DIR keyword", *argv); + is_offload = true; } else if (strcmp(*argv, "output-mark") == 0) { NEXT_ARG(); if (get_u32(&output_mark.v, *argv, 0)) @@ -605,6 +602,8 @@ if (is_offload) { xuo.ifindex = ifindex; xuo.flags = dir; + if (is_packet_offload) + xuo.flags |= XFRM_OFFLOAD_PACKET; addattr_l(&req.n, sizeof(req.buf), XFRMA_OFFLOAD_DEV, &xuo, sizeof(xuo)); } @@ -1028,7 +1027,7 @@ return __do_xfrm_state_print(n, arg, false); } -int xfrm_state_print_nokeys(struct nlmsghdr *n, void *arg) +static int xfrm_state_print_nokeys(struct nlmsghdr *n, void *arg) { return __do_xfrm_state_print(n, arg, true); }
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/lib/bpf_legacy.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/lib/bpf_legacy.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * bpf.c BPF common code * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Daniel Borkmann <daniel@iogearbox.net> * Jiri Pirko <jiri@resnulli.us> * Alexei Starovoitov <ast@kernel.org>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/lib/cg_map.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/lib/cg_map.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * cg_map.c cgroup v2 cache * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Dmitry Yakunin <zeil@yandex-team.ru> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/lib/fs.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/lib/fs.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * fs.c filesystem APIs * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: David Ahern <dsa@cumulusnetworks.com> - * */ #include <sys/types.h> @@ -357,8 +352,10 @@ if (!f) return -1; - if (!fgets(name, len, f)) + if (!fgets(name, len, f)) { + fclose(f); return -1; + } /* comm ends in \n, get rid of it */ namestrcspn(name, "\n") = '\0';
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/lib/inet_proto.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/lib/inet_proto.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * inet_proto.c * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/lib/json_print.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/lib/json_print.c
Changed
@@ -1,10 +1,6 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* - * json_print.c "print regular or json output, based on json_writer". - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. + * json_print.c - print regular or json output, based on json_writer * * Authors: Julien Fortin, <julien@cumulusnetworks.com> */ @@ -219,6 +215,25 @@ value ? "true" : "false"); } +/* In JSON mode, acts like print_color_bool. + * Otherwise, will print key with prefix of "no" if false. + * The show flag is used to suppres printing in non-JSON mode + */ +int print_color_bool_opt(enum output_type type, + enum color_attr color, + const char *key, + bool value, bool show) +{ + int ret = 0; + + if (_IS_JSON_CONTEXT(type)) + jsonw_bool_field(_jw, key, value); + else if (_IS_FP_CONTEXT(type) && show) + ret = color_fprintf(stdout, color, "%s%s ", + value ? "" : "no", key); + return ret; +} + int print_color_on_off(enum output_type type, enum color_attr color, const char *key,
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/lib/libnetlink.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/lib/libnetlink.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * libnetlink.c RTnetlink service routines. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h> @@ -1104,6 +1099,8 @@ if (answer) *answer = (struct nlmsghdr *)buf; + else + free(buf); return 0; } @@ -1171,12 +1168,6 @@ return __rtnl_talk(rtnl, n, answer, true, NULL); } -int rtnl_talk_iov(struct rtnl_handle *rtnl, struct iovec *iovec, size_t iovlen, - struct nlmsghdr **answer) -{ - return __rtnl_talk_iov(rtnl, iovec, iovlen, answer, true, NULL); -} - int rtnl_talk_suppress_rtnl_errmsg(struct rtnl_handle *rtnl, struct nlmsghdr *n, struct nlmsghdr **answer) {
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/lib/ll_addr.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/lib/ll_addr.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * ll_addr.c * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/lib/ll_map.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/lib/ll_map.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * ll_map.c * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/lib/ll_proto.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/lib/ll_proto.c
Changed
@@ -1,10 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * ll_proto.c * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/lib/ll_types.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/lib/ll_types.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * ll_types.c * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> */ @@ -26,78 +22,78 @@ #include "rt_names.h" #include "utils.h" -const char * ll_type_n2a(int type, char *buf, int len) +const char *ll_type_n2a(int type, char *buf, int len) { #define __PF(f,n) { ARPHRD_##f, #n }, static const struct { int type; const char *name; } arphrd_names = { -__PF(NETROM,netrom) -__PF(ETHER,ether) -__PF(EETHER,eether) -__PF(AX25,ax25) -__PF(PRONET,pronet) -__PF(CHAOS,chaos) -__PF(IEEE802,ieee802) -__PF(ARCNET,arcnet) -__PF(APPLETLK,atalk) -__PF(DLCI,dlci) -__PF(ATM,atm) -__PF(METRICOM,metricom) -__PF(IEEE1394,ieee1394) -__PF(INFINIBAND,infiniband) -__PF(SLIP,slip) -__PF(CSLIP,cslip) -__PF(SLIP6,slip6) -__PF(CSLIP6,cslip6) -__PF(RSRVD,rsrvd) -__PF(ADAPT,adapt) -__PF(ROSE,rose) -__PF(X25,x25) -__PF(HWX25,hwx25) -__PF(CAN,can) -__PF(PPP,ppp) -__PF(HDLC,hdlc) -__PF(LAPB,lapb) -__PF(DDCMP,ddcmp) -__PF(RAWHDLC,rawhdlc) -__PF(TUNNEL,ipip) -__PF(TUNNEL6,tunnel6) -__PF(FRAD,frad) -__PF(SKIP,skip) -__PF(LOOPBACK,loopback) -__PF(LOCALTLK,ltalk) -__PF(FDDI,fddi) -__PF(BIF,bif) -__PF(SIT,sit) -__PF(IPDDP,ip/ddp) -__PF(IPGRE,gre) -__PF(PIMREG,pimreg) -__PF(HIPPI,hippi) -__PF(ASH,ash) -__PF(ECONET,econet) -__PF(IRDA,irda) -__PF(FCPP,fcpp) -__PF(FCAL,fcal) -__PF(FCPL,fcpl) -__PF(FCFABRIC,fcfb0) -__PF(FCFABRIC+1,fcfb1) -__PF(FCFABRIC+2,fcfb2) -__PF(FCFABRIC+3,fcfb3) -__PF(FCFABRIC+4,fcfb4) -__PF(FCFABRIC+5,fcfb5) -__PF(FCFABRIC+6,fcfb6) -__PF(FCFABRIC+7,fcfb7) -__PF(FCFABRIC+8,fcfb8) -__PF(FCFABRIC+9,fcfb9) -__PF(FCFABRIC+10,fcfb10) -__PF(FCFABRIC+11,fcfb11) -__PF(FCFABRIC+12,fcfb12) -__PF(IEEE802_TR,tr) -__PF(IEEE80211,ieee802.11) -__PF(IEEE80211_PRISM,ieee802.11/prism) -__PF(IEEE80211_RADIOTAP,ieee802.11/radiotap) +__PF(NETROM, netrom) +__PF(ETHER, ether) +__PF(EETHER, eether) +__PF(AX25, ax25) +__PF(PRONET, pronet) +__PF(CHAOS, chaos) +__PF(IEEE802, ieee802) +__PF(ARCNET, arcnet) +__PF(APPLETLK, atalk) +__PF(DLCI, dlci) +__PF(ATM, atm) +__PF(METRICOM, metricom) +__PF(IEEE1394, ieee1394) +__PF(INFINIBAND, infiniband) +__PF(SLIP, slip) +__PF(CSLIP, cslip) +__PF(SLIP6, slip6) +__PF(CSLIP6, cslip6) +__PF(RSRVD, rsrvd) +__PF(ADAPT, adapt) +__PF(ROSE, rose) +__PF(X25, x25) +__PF(HWX25, hwx25) +__PF(CAN, can) +__PF(PPP, ppp) +__PF(HDLC, hdlc) +__PF(LAPB, lapb) +__PF(DDCMP, ddcmp) +__PF(RAWHDLC, rawhdlc) +__PF(TUNNEL, ipip) +__PF(TUNNEL6, tunnel6) +__PF(FRAD, frad) +__PF(SKIP, skip) +__PF(LOOPBACK, loopback) +__PF(LOCALTLK, ltalk) +__PF(FDDI, fddi) +__PF(BIF, bif) +__PF(SIT, sit) +__PF(IPDDP, ip/ddp) +__PF(IPGRE, gre) +__PF(PIMREG, pimreg) +__PF(HIPPI, hippi) +__PF(ASH, ash) +__PF(ECONET, econet) +__PF(IRDA, irda) +__PF(FCPP, fcpp) +__PF(FCAL, fcal) +__PF(FCPL, fcpl) +__PF(FCFABRIC, fcfb0) +__PF(FCFABRIC+1, fcfb1) +__PF(FCFABRIC+2, fcfb2) +__PF(FCFABRIC+3, fcfb3) +__PF(FCFABRIC+4, fcfb4) +__PF(FCFABRIC+5, fcfb5) +__PF(FCFABRIC+6, fcfb6) +__PF(FCFABRIC+7, fcfb7) +__PF(FCFABRIC+8, fcfb8) +__PF(FCFABRIC+9, fcfb9) +__PF(FCFABRIC+10, fcfb10) +__PF(FCFABRIC+11, fcfb11) +__PF(FCFABRIC+12, fcfb12) +__PF(IEEE802_TR, tr) +__PF(IEEE80211, ieee802.11) +__PF(IEEE80211_PRISM, ieee802.11/prism) +__PF(IEEE80211_RADIOTAP, ieee802.11/radiotap) __PF(IEEE802154, ieee802.15.4) __PF(IEEE802154_MONITOR, ieee802.15.4/monitor) __PF(PHONET, phonet) @@ -106,14 +102,13 @@ __PF(IP6GRE, gre6) __PF(NETLINK, netlink) __PF(6LOWPAN, 6lowpan) - __PF(NONE, none) -__PF(VOID,void) +__PF(VOID, void) }; #undef __PF - int i; - for (i=0; !numeric && i<sizeof(arphrd_names)/sizeof(arphrd_names0); i++) { + unsigned int i; + for (i = 0; !numeric && i < ARRAY_SIZE(arphrd_names); i++) { if (arphrd_namesi.type == type) return arphrd_namesi.name; }
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/lib/mpls_ntop.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/lib/mpls_ntop.c
Changed
@@ -40,7 +40,7 @@ const char *mpls_ntop(int af, const void *addr, char *buf, size_t buflen) { - switch(af) { + switch (af) { case AF_MPLS: errno = 0; return mpls_ntop1((struct mpls_label *)addr, buf, buflen);
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/lib/mpls_pton.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/lib/mpls_pton.c
Changed
@@ -49,7 +49,7 @@ unsigned int maxlabels = alen / sizeof(struct mpls_label); int err; - switch(af) { + switch (af) { case AF_MPLS: errno = 0; err = mpls_pton1(src, (struct mpls_label *)addr, maxlabels);
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/lib/names.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/lib/names.c
Changed
@@ -1,11 +1,6 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * names.c db names - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/lib/namespace.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/lib/namespace.c
Changed
@@ -1,10 +1,6 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * namespace.c - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. */ #include <sys/statvfs.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/lib/rt_names.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/lib/rt_names.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * rt_names.c rtnetlink names DB. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> */ @@ -85,6 +81,10 @@ continue; entry = malloc(sizeof(*entry)); + if (entry == NULL) { + fprintf(stderr, "malloc error: for entry\n"); + break; + } entry->id = id; entry->name = strdup(namebuf); entry->next = hashid & (size - 1); @@ -230,6 +230,60 @@ } +static char *rtnl_addrprot_tab256 = { + IFAPROT_UNSPEC = "unspec", + IFAPROT_KERNEL_LO = "kernel_lo", + IFAPROT_KERNEL_RA = "kernel_ra", + IFAPROT_KERNEL_LL = "kernel_ll", +}; +static bool rtnl_addrprot_tab_initialized; + +static void rtnl_addrprot_initialize(void) +{ + rtnl_tab_initialize(CONFDIR "/rt_addrprotos", + rtnl_addrprot_tab, + ARRAY_SIZE(rtnl_addrprot_tab)); + rtnl_addrprot_tab_initialized = true; +} + +const char *rtnl_addrprot_n2a(__u8 id, char *buf, int len) +{ + if (numeric) + goto numeric; + if (!rtnl_addrprot_tab_initialized) + rtnl_addrprot_initialize(); + if (rtnl_addrprot_tabid) + return rtnl_addrprot_tabid; +numeric: + snprintf(buf, len, "%#x", id); + return buf; +} + +int rtnl_addrprot_a2n(__u8 *id, const char *arg) +{ + unsigned long res; + char *end; + int i; + + if (!rtnl_addrprot_tab_initialized) + rtnl_addrprot_initialize(); + + for (i = 0; i < 256; i++) { + if (rtnl_addrprot_tabi && + strcmp(rtnl_addrprot_tabi, arg) == 0) { + *id = i; + return 0; + } + } + + res = strtoul(arg, &end, 0); + if (!end || end == arg || *end || res > 255) + return -1; + *id = res; + return 0; +} + + static char *rtnl_rtscope_tab256 = { RT_SCOPE_UNIVERSE = "global", RT_SCOPE_NOWHERE = "nowhere",
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/lib/utils.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/lib/utils.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * utils.c * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h> @@ -101,7 +96,7 @@ return -1; } -int get_hex(char c) +static int get_hex(char c) { if (c >= 'A' && c <= 'F') return c - 'A' + 10; @@ -1294,7 +1289,7 @@ int cmdlineno; /* Like glibc getline but handle continuation lines and comments */ -ssize_t getcmdline(char **linep, size_t *lenp, FILE *in) +static ssize_t getcmdline(char **linep, size_t *lenp, FILE *in) { ssize_t cc; char *cp; @@ -1341,7 +1336,7 @@ } /* split command line into argument vector */ -int makeargs(char *line, char *argv, int maxargs) +static int makeargs(char *line, char *argv, int maxargs) { static const char ws = " \t\r\n"; char *cp = line; @@ -1712,8 +1707,7 @@ } } - if (line) - free(line); + free(line); return ret; }
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/man/man8/bridge.8 -> _service:tar_scm:iproute2-6.4.0.tar.xz/man/man8/bridge.8
Changed
@@ -47,13 +47,17 @@ .BR hwmode " { " vepa " | " veb " } " .BR bcast_flood " { " on " | " off " } " .BR mcast_flood " { " on " | " off " } " +.BR mcast_max_groups +.IR MAX_GROUPS " " .BR mcast_router .IR MULTICAST_ROUTER " " .BR mcast_to_unicast " { " on " | " off " } " .BR neigh_suppress " { " on " | " off " } " +.BR neigh_vlan_suppress " { " on " | " off " } " .BR vlan_tunnel " { " on " | " off " } " .BR isolated " { " on " | " off " } " .BR locked " { " on " | " off " } " +.BR mab " { " on " | " off " } " .B backup_port .IR DEVICE " " .BR nobackup_port " " @@ -126,7 +130,7 @@ .BR nosticky " " nooffloaded " " .ti -8 -.BR "bridge mdb" " { " add " | " del " } " +.BR "bridge mdb" " { " add " | " del " | " replace " } " .B dev .I DEV .B port @@ -137,7 +141,22 @@ .IR SOURCE " " .BR permanent " | " temp " " .B vid -.IR VID " " +.IR VID " " +.BR filter_mode " { " include " | " exclude " } " +.B source_list +.IR SOURCE_LIST " " +.B proto +.IR PROTO " " +.B dst +.IR IPADDR " " +.B dst_port +.IR DST_PORT " " +.B vni +.IR VNI " " +.B src_vni +.IR SRC_VNI " " +.B via +.IR DEV " .ti -8 .BR "bridge mdb show" " " @@ -163,8 +182,11 @@ .IR VID " " .B state .IR STP_STATE " " +.B mcast_max_groups +.IR MAX_GROUPS " " .B mcast_router -.IR MULTICAST_ROUTER " " +.IR MULTICAST_ROUTER " " +.BR neigh_suppress " { " on " | " off " } " .ti -8 .BR "bridge vlan" " " show " | " tunnelshow " " @@ -512,6 +534,15 @@ flooded towards this given port. By default this flag is on. .TP +.BI mcast_max_groups " MAX_GROUPS " +Sets the maximum number of MDB entries that can be registered for a given +port. Attempts to register more MDB entries at the port than this limit +allows will be rejected, whether they are done through netlink (e.g. the +\fBbridge\fR tool), or IGMP or MLD membership reports. Setting a limit to 0 +has the effect of disabling the limit. The default value is 0. See also the +\fBip link\fR option \fBmcast_hash_max\fR. + +.TP .BI mcast_router " MULTICAST_ROUTER " This flag is almost the same as the per-VLAN flag, see below, except its value can only be set in the range 0-2. The default is @@ -561,6 +592,13 @@ enabled on the port. By default this flag is off. .TP +.BR "neigh_vlan_suppress on " or " neigh_vlan_suppress off " +Controls whether per-VLAN neigh discovery (arp and nd) proxy and suppression is +enabled on the port. When on, the \fBbridge link\fR option \fBneigh_suppress\fR +has no effect and the per-VLAN state is set using the \fBbridge vlan\fR option +\fBneigh_suppress\fR. By default this flag is off. + +.TP .BR "vlan_tunnel on " or " vlan_tunnel off " Controls whether vlan to tunnel mapping is enabled on the port. By default this flag is off. @@ -573,13 +611,32 @@ .TP .BR "locked on " or " locked off " -Controls whether a port will be locked, meaning that hosts behind the -port will not be able to communicate through the port unless an FDB -entry with the units MAC address is in the FDB. -The common use is that hosts are allowed access through authentication -with the IEEE 802.1X protocol or based on whitelists or like setups. -By default this flag is off. - +Controls whether a port is locked or not. When locked, non-link-local frames +received through the port are dropped unless an FDB entry with the MAC source +address points to the port. The common use case is IEEE 802.1X where hosts can +authenticate themselves by exchanging EAPOL frames with an authenticator. After +authentication is complete, the user space control plane can install a matching +FDB entry to allow traffic from the host to be forwarded by the bridge. When +learning is enabled on a locked port, the +.B no_linklocal_learn +bridge option needs to be on to prevent the bridge from learning from received +EAPOL frames. By default this flag is off. + +.TP +.BR "mab on " or " mab off " +Controls whether MAC Authentication Bypass (MAB) is enabled on the port or not. +MAB can only be enabled on a locked port that has learning enabled. When +enabled, FDB entries are learned from received traffic and have the "locked" +FDB flag set. The flag can only be set by the kernel and it indicates that the +FDB entry cannot be used to authenticate the corresponding host. User space can +decide to authenticate the host by replacing the FDB entry and clearing the +"locked" FDB flag. Locked FDB entries can roam to unlocked (authorized) ports +in which case the "locked" flag is cleared. FDB entries cannot roam to locked +ports regardless of MAB being enabled or not. Therefore, locked FDB entries are +only created if an FDB entry with the given {MAC, VID} does not already exist. +This behavior prevents unauthenticated hosts from disrupting traffic destined +to already authenticated hosts. Locked FDB entries act like regular dynamic +entries with respect to forwarding and aging. By default this flag is off. .TP .BI backup_port " DEVICE" @@ -873,8 +930,8 @@ objects contain known IP or L2 multicast group addresses on a link. .P -The corresponding commands display mdb entries, add new entries, -and delete old ones. +The corresponding commands display mdb entries, add new entries, replace +entries and delete old ones. .SS bridge mdb add - add a new multicast group database entry @@ -911,6 +968,66 @@ .BI vid " VID" the VLAN ID which is known to have members of this multicast group. +.TP +.BR "filter_mode include " or " filter_mode exclude " +controls whether the sources in the entry's source list are in INCLUDE or +EXCLUDE mode. Can only be set for (*, G) entries. + +.TP +.BI source_list " SOURCE_LIST" +optional list of source IP addresses of senders for this multicast group, +separated by a ','. Whether the entry forwards packets from these senders or +not is determined by the entry's filter mode, which becomes a mandatory +argument. Can only be set for (*, G) entries. + +.TP +.BI proto " PROTO" +the routing protocol identifier of this mdb entry. Can be a number or a string +from the file /etc/iproute2/rt_protos. If the routing protocol is not given, +then +.B static +is assumed. + +.in -8 +The next command line parameters apply only +when the specified device +.I DEV +is of type VXLAN. + +.TP +.BI dst " IPADDR" +the IP address of the destination +VXLAN tunnel endpoint where the multicast receivers reside. + +.TP +.BI dst_port " DST_PORT" +the UDP destination port number to use to connect to the remote VXLAN tunnel +endpoint. If omitted, the value specified at VXLAN device creation will be +used. + +.TP +.BI vni " VNI" +the VXLAN VNI Network Identifier to use to connect to the remote VXLAN tunnel +endpoint. If omitted, the value specified at VXLAN device creation will be used +or the source VNI when the VXLAN device is in external mode. + +.TP +.BI src_vni " SRC_VNI" +the source VNI Network Identifier this entry belongs to. Used only when the +VXLAN device is in external mode. If omitted, the value specified at VXLAN +device creation will be used. + +.TP +.BI via " DEV" +device name of the outgoing interface for the VXLAN device to reach the remote +VXLAN tunnel endpoint. + +.in -8 +The 0.0.0.0 and :: MDB entries are special catchall entries used to flood IPv4 +and IPv6 unregistered multicast packets, respectively. Therefore, when these +entries are programmed, the catchall 00:00:00:00:00:00 FDB entry will only +flood broadcast, unknown unicast and link-local multicast. + .in -8 .SS bridge mdb delete - delete a multicast group database entry This command removes an existing mdb entry. @@ -919,6 +1036,13 @@ The arguments are the same as with .BR "bridge mdb add" . +.SS bridge mdb replace - replace a multicast group database entry +If no matching entry is found, a new one will be created instead. + +.PP +The arguments are the same as with +.BR "bridge mdb add" . + .SS bridge mdb show - list multicast group database entries This command displays the current multicast group membership table. The table @@ -1056,6 +1180,15 @@ .sp .TP +.BI mcast_max_groups " MAX_GROUPS " +Sets the maximum number of MDB entries that can be registered for a given +VLAN on a given port. A VLAN-specific equivalent of the per-port option of +the same name, see above for details. + +Note that this option is only available when \fBip link\fR option +\fBmcast_vlan_snooping\fR is enabled. + +.TP .BI mcast_router " MULTICAST_ROUTER " configure this vlan and interface's multicast router mode, note that only modes 0 - 2 are available for bridge devices. @@ -1080,6 +1213,14 @@ enable multicast traffic forwarding. This mode is available only for ports. .sp +.TP +.BR "neigh_suppress on " or " neigh_suppress off " +Controls whether neigh discovery (arp and nd) proxy and suppression is enabled +for a given VLAN on a given port. By default this flag is off. + +Note that this option only takes effect when \fBbridge link\fR option +\fBneigh_vlan_suppress\fR is enabled for a given port. + .SS bridge vlan show - list vlan configuration. This command displays the current VLAN filter table.
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/man/man8/dcb-app.8 -> _service:tar_scm:iproute2-6.4.0.tar.xz/man/man8/dcb-app.8
Changed
@@ -23,6 +23,7 @@ .RB " " dgram-port-prio " " .RB " " port-prio " " .RB " " dscp-prio " " +.RB " " pcp-prio " " .ti -8 .B dcb ets " { " add " | " del " | " replace " } " dev @@ -33,6 +34,7 @@ .RB " " dgram-port-prio " " \fIPORT-MAP\fB " " .RB " " port-prio " " \fIPORT-MAP\fB " " .RB " " dscp-prio " " \fIDSCP-MAP\fB " " +.RB " " pcp-prio " " \fIPCP-MAP\fB " " .ti -8 .IR PRIO-LIST " := " PRIO-LIST " " PRIO @@ -56,6 +58,12 @@ .IR DSCP-MAPPING " := { " DSCP " | " \fBall " }" \fB:\fIPRIO\fR .ti -8 +.IR PCP-MAP " := " PCP-MAP " " PCP-MAPPING + +.ti -8 +.IR PCP-MAPPING " := " PCP\fB:\fIPRIO\fR + +.ti -8 .IR ET " := { " \fB0x600\fR " .. " \fB0xffff\fR " }" .ti -8 @@ -65,6 +73,9 @@ .IR DSCP " := { " \fB0\fR " .. " \fB63\fR " }" .ti -8 +.IR PCP " := { " \fB0(nd/de)\fR " .. " \fB7(nd/de)\fR " }" + +.ti -8 .IR PRIO " := { " \fB0\fR " .. " \fB7\fR " }" .SH DESCRIPTION @@ -182,6 +193,17 @@ .B -N turns the show translation off. +.TP +.B pcp-prio \fIPCP-MAP +\fIPCP-MAP\fR uses the array parameter syntax, see +.BR dcb (8) +for details. Keys are PCP/DEI. Values are priorities assigned to traffic with +matching PCP/DEI. PCP/DEI values are written as a combination of numeric- and +symbolic values, to accommodate for both. PCP always in numerical form e.g +0 .. 7 and DEI in symbolic form e.g 'de' (drop-eligible), indicating that the +DEI bit is 1 or 'nd' (not-drop-eligible), indicating that the DEI bit is 0. +In combination 2de:1 translates to a mapping of PCP=2 and DEI=1 to priority 1. + .SH EXAMPLE & USAGE Prioritize traffic with DSCP 0 to priority 0, 24 to 3 and 48 to 6: @@ -221,6 +243,16 @@ .br (nothing) +Add a rule to map traffic with PCP 1 and DEI 0 to priority 1 and PCP 2 and DEI 1 +to priority 2: + +.P +# dcb app add dev eth0 pcp-prio 1nd:1 2de:2 +.br +# dcb app show dev eth0 pcp-prio +.br +pcp-prio 1nd:1 2de:2 + .SH EXIT STATUS Exit status is 0 if command was successful or a positive integer upon failure.
View file
_service:tar_scm:iproute2-6.4.0.tar.xz/man/man8/dcb-apptrust.8
Added
@@ -0,0 +1,109 @@ +.TH DCB-APPTRUST 8 "22 November 2022" "iproute2" "Linux" +.SH NAME +dcb-apptrust \- show / configure per-selector trust and trust order of the +application priority table of the DCB (Data Center Bridging) subsystem. +.SH SYNOPSIS +.sp +.ad l +.in +8 + +.ti -8 +.B dcb +.RI " " OPTIONS " " +.B apptrust +.RI "{ " COMMAND " | " help " }" +.sp + +.ti -8 +.B dcb apptrust show dev +.RI DEV +.RB " " order " " + +.ti -8 +.B dcb apptrust set dev +.RI DEV +.RB " " order " " \fiSEL-LIST\fB " " + +.ti -8 +.IR SEL-LIST " := " SEL-LIST " " SEL + +.ti -8 +.IR SEL " := { " ethtype " | " stream-port " | " dgram-port " | " port " | " dscp " | " pcp " } " + +.SH DESCRIPTION + +.B dcb apptrust +is used to configure per-selector trust and trust order of the +Application Priority Table, see +.BR dcb-app (8) +for details on how to configure app table entries. + +Selector trust can be used by the +software stack, or drivers (most likely the latter), when querying the APP +table, to determine if an APP entry should take effect, or not. Additionally, the +order of the trusted selectors will dictate which selector should take +precedence, in the case of multiple different APP table selectors being present. + +.SH COMMANDS + +.TP +.B show +Display all trusted selectors. + +.TP +.B set +Set new list of trusted selectors. Empty list is effectively the same as +removing trust entirely. + +.SH PARAMETERS + +The following describes only the write direction, i.e. as used with the +\fBset\fR command. For the \fBshow\fR command, the parameter name is to be used +as a simple keyword without further arguments. This instructs the tool to show +the values of a given parameter. + +.TP +.B order \fISEL-LIST +\fISEL-LIST\fR is a space-separated list of selector names. Possible selector +values are: +.B ethtype, +.B stream-port, +.B dgram-port, +.B port, +.B dscp, +and +.B pcp + + +.SH EXAMPLE & USAGE + +Set trust order to: dscp, pcp for eth0: +.P +# dcb apptrust set dev eth0 order dscp pcp + +Set trust order to: port (stream or dgram), pcp, ethtype for eth1: +.P +# dcb apptrust set dev eth1 order port pcp ethtype + +Show what was set: + +.P +# dcb apptrust show dev eth0 +.br +order: port pcp ethtype + +.SH EXIT STATUS +Exit status is 0 if command was successful or a positive integer upon failure. + +.SH SEE ALSO +.BR dcb (8), +.BR dcb-app (8) + +.SH REPORTING BUGS +Report any bugs to the Network Developers mailing list +.B <netdev@vger.kernel.org> +where the development and maintenance is primarily done. +You do not have to be subscribed to the list to send a message there. + +.SH AUTHOR +Daniel Machon <daniel.machon@microchip.com>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/man/man8/devlink-port.8 -> _service:tar_scm:iproute2-6.4.0.tar.xz/man/man8/devlink-port.8
Changed
@@ -71,6 +71,12 @@ .RI " " .BR state " { " active " | " inactive " }" .RI "" +.RI " " +.BR roce " { " enable " | " disable " }" +.RI "" +.RI " " +.BR migratable " { " enable " | " disable " }" +.RI "" .ti -8 .BR "devlink port function rate " @@ -208,6 +214,14 @@ .I inactive - To inactivate the function and its device(s), set to inactive. +.TP +.BR roce " { " enable " | " disable " } " +Set the RoCE capability of the function. + +.TP +.BR migratable " { " enable " | " disable " } " +Set the migratable capability of the function. + .ti -8 .SS devlink port del - delete a devlink port .PP @@ -327,6 +341,16 @@ in driver unload and device removal. .RE .PP +devlink port function set pci/0000:01:00.0/1 roce enable +.RS 4 +This will enable the RoCE functionality of the function. +.RE +.PP +devlink port function set pci/0000:01:00.0/1 migratable enable +.RS 4 +This will enable the migratable functionality of the function. +.RE +.PP devlink port function set pci/0000:01:00.0/1 hw_addr 00:00:00:11:22:33 state active .RS 4 Configure hardware address and also active the function. When a function is
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/man/man8/devlink-rate.8 -> _service:tar_scm:iproute2-6.4.0.tar.xz/man/man8/devlink-rate.8
Changed
@@ -26,12 +26,16 @@ .RI "{ " DEV/PORT_INDEX " | " DEV/NODE_NAME " } " .RB " tx_share \fIVALUE " .RB " tx_max \fIVALUE " +.RB " tx_priority \fIN " +.RB " tx_weight \fIN " .RB " {" " parent \fINODE_NAME " | " noparent " "} " .ti -8 .BI "devlink port function rate add " DEV/NODE_NAME .RB " tx_share \fIVALUE " .RB " tx_max \fIVALUE " +.RB " tx_priority \fIN " +.RB " tx_weight \fIN " .RB " {" " parent \fINODE_NAME " | " noparent " "} " .ti -8 @@ -83,6 +87,20 @@ .PP .BI tx_max " VALUE" - specifies maximum tx rate value. +.PP +.BI tx_priority " N" +- allows for usage of strict priority arbiter among siblings. This arbitration +scheme attempts to schedule nodes based on their priority as long as the nodes +remain within their bandwidth limit. The higher the priority the higher the +probability that the node will get selected for scheduling. +.PP +.BI tx_weight " N" +- allows for usage of Weighted Fair Queuing arbitration scheme among siblings. +This arbitration scheme can be used simultaneously with the strict priority. +As a node is configured with a higher rate it gets more BW relative to it's +siblings. Values are relative like a percentage points, they basically tell +how much BW should node take relative to it's siblings. +.PP .TP 8 .I VALUE These parameter accept a floating point number, possibly followed by either a @@ -123,6 +141,10 @@ (ki-, mi-, gi- and ti-) respectively. Input is case-insensitive. .RE .PP +.TP 8 +.I N +These parameter accept integer meaning weight or priority of a node. +.PP .BI parent " NODE_NAME \fR| " noparent - set rate object parent to existing node with name \fINODE_NAME\fR or unset parent. Rate limits of the parent node applied to all it's children. Actual
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/man/man8/ip-address.8.in -> _service:tar_scm:iproute2-6.4.0.tar.xz/man/man8/ip-address.8.in
Changed
@@ -50,7 +50,9 @@ .B vrf .IR NAME " " .BR up " " -.BR nomaster " " +.BR nomaster " " +.B proto +.IR ADDRPROTO " " .ti -8 .BR "ip address" " { " showdump " | " restore " }" @@ -66,7 +68,9 @@ .B label .IR LABEL " " .B scope -.IR SCOPE-ID " " +.IR SCOPE-ID " " +.B proto +.IR ADDRPROTO " " .ti -8 .IR SCOPE-ID " := " @@ -74,6 +78,10 @@ .IR NUMBER " " .ti -8 +.IR ADDRPROTO " := " +.IR NAME " | " NUMBER " " + +.ti -8 .IR FLAG-LIST " := " FLAG-LIST " " FLAG .ti -8 @@ -288,6 +296,36 @@ Openvswitch VXLAN interfaces as well as other tunneling mechanisms that need to receive multicast traffic. +.TP +.BI proto " ADDRPROTO" +the protocol identifier of this route. +.I ADDRPROTO +may be a number or a string from the file +.BR "/etc/iproute2/rt_addrprotos" . +If the protocol ID is not given, + +.B ip assumes protocol 0. Several protocol +values have a fixed interpretation. Namely: + +.in +8 +.B kernel_lo +- The ::1 address that kernel installs on a loopback netdevice has this + protocol value +.sp + +.B kernel_ra +- IPv6 addresses installed in response to router advertisement messages +.sp + +.B kernel_ll +- Link-local addresses have this protocol value +.sp +.in -8 + +.sp +The rest of the values are not reserved and the administrator is free +to assign (or not to assign) protocol tags. + .SS ip address delete - delete protocol address .B Arguments: coincide with the arguments of @@ -400,6 +438,13 @@ This is an alias for .BR temporary " or " secondary . +.TP +.BI proto " ADDRPROTO" +Only show addresses with a given protocol, or those for which the kernel +response did not include protocol. See the corresponding argument to +.B ip addr add +for details about address protocols. + .SS ip address flush - flush protocol addresses This command flushes the protocol addresses selected by some criteria.
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/man/man8/ip-link.8.in -> _service:tar_scm:iproute2-6.4.0.tar.xz/man/man8/ip-link.8.in
Changed
@@ -38,13 +38,18 @@ .br .RB " " gso_max_size .IR BYTES " " +.RB " " gso_ipv4_max_size +.IR BYTES " " .RB " " gso_max_segs .IR SEGMENTS " " .br .RB " " gro_max_size .IR BYTES " " +.RB " " gro_ipv4_max_size +.IR BYTES " " +.br .RB " " netns " {" -.IR PID " | " NETNSNAME " } " +.IR PID " | " NETNSNAME " | " NETNSFILE " } " .br .BI type " TYPE" .RI " " ARGS " " @@ -88,11 +93,16 @@ .RB " " txqueuelen .IR PACKETS " " .br -.RB " " max_gso_size +.RB " " gso_max_size .IR BYTES " " -.RB " " max_gso_segs +.RB " " gso_ipv4_max_size +.IR BYTES " " +.RB " " gso_max_segs .IR SEGMENTS " " -.RB " " max_gro_size +.br +.RB " " gro_max_size +.IR BYTES " " +.RB " " gro_ipv4_max_size .IR BYTES " " .br .RB " " name @@ -108,7 +118,7 @@ .IR MTU " " .br .RB " " netns " {" -.IR PID " | " NETNSNAME " } " +.IR PID " | " NETNSNAME " | " NETNSFILE " } " .br .RB " " link-netnsid .IR ID " " @@ -301,6 +311,7 @@ .sp .B bond - Bonding device +.sp .B bridge - Ethernet Bridge device .sp @@ -422,7 +433,14 @@ .TP .BI gso_max_size " BYTES " specifies the recommended maximum size of a Generic Segment Offload -packet the new device should accept. +packet the new device should accept. This is also used to enable BIG +TCP for IPv6 on this device when the size is greater than 65536. + +.TP +.BI gso_ipv4_max_size " BYTES " +specifies the recommended maximum size of a IPv4 Generic Segment Offload +packet the new device should accept. This is especially used to enable +BIG TCP for IPv4 on this device by setting to a size greater than 65536. .TP .BI gso_max_segs " SEGMENTS " @@ -431,8 +449,15 @@ .TP .BI gro_max_size " BYTES " -specifies the maximum size of a packet built by GRO stack -on this device. +specifies the maximum size of a packet built by GRO stack on this +device. This is also used for BIG TCP to allow the size of a +merged IPv6 GSO packet on this device greater than 65536. + +.TP +.BI gro_ipv4_max_size " BYTES " +specifies the maximum size of a IPv4 packet built by GRO stack on this +device. This is especially used for BIG TCP to allow the size of a +merged IPv4 GSO packet on this device greater than 65536. .TP .BI index " IDX " @@ -440,8 +465,15 @@ creation fails, if the index is busy. .TP -.BI netns " { PID | NAME } " -specifies the desired network namespace to create interface in. +.B netns +.RI "{ " PID " | " NETNSNAME " | " NETNSFILE " }" +.br +create the device in the network namespace associated with process +.IR "PID " or +the name +.IR "NETNSNAME " or +the file +.IR "NETNSFILE". .TP VLAN Type Support @@ -1454,6 +1486,7 @@ .BR mode " { " private " | " vepa " | " bridge " | " passthru .RB " " nopromisc " | " source " " nodst " } " .RB " " bcqueuelen " { " LENGTH " } " +.RB " " bclim " " LIMIT " " .in +8 .sp @@ -1512,6 +1545,13 @@ When listing device parameters both the bcqueuelen parameter as well as the actual used bcqueuelen are listed to better help the user understand the setting. + +.BR bclim " " LIMIT +- Set the threshold for broadcast queueing. +.BR LIMIT " must be a 32-bit integer." +Setting this to -1 disables broadcast queueing altogether. Otherwise +a multicast address will be queued as broadcast if the number of devices +using it is greater than the given value. .in -8 .TP @@ -2163,10 +2203,15 @@ .IR "POINTOPOINT" . .TP -.BI netns " NETNSNAME " \fR| " PID" -move the device to the network namespace associated with name +.B netns +.RI "{ " PID " | " NETNSNAME " | " NETNSFILE " }" +.br +move the device to the network namespace associated with process +.IR "PID " or +the name .IR "NETNSNAME " or -.RI process " PID". +the file +.IR "NETNSFILE". Some devices are not allowed to change network namespace: loopback, bridge, wireless. These are network namespace local devices. In such case @@ -2472,11 +2517,16 @@ .BR neigh_suppress " { " on " | " off " }" +.BR neigh_vlan_suppress " { " on " | " off " }" + .BR vlan_tunnel " { " on " | " off " }" .BR isolated " { " on " | " off " }" .BR locked " { " on " | " off " }" + +.BR mab " { " on " | " off " }" + .BR backup_port " DEVICE" .BR nobackup_port " " @@ -2574,14 +2624,42 @@ - controls whether neigh discovery (arp and nd) proxy and suppression is enabled on the port. By default this flag is off. +.BR neigh_vlan_suppress " { " on " | " off " }" +- controls whether per-VLAN neigh discovery (arp and nd) proxy and suppression +is enabled on the port. When on, the \fBbridge link\fR option +\fBneigh_suppress\fR has no effect and the per-VLAN state is set using the +\fBbridge vlan\fR option \fBneigh_suppress\fR. By default this flag is off. + .BR vlan_tunnel " { " on " | " off " }" - controls whether vlan to tunnel mapping is enabled on the port. By default this flag is off. .BR locked " { " on " | " off " }" -- sets or unsets a port in locked mode, so that when enabled, hosts -behind the port cannot communicate through the port unless a FDB entry -representing the host is in the FDB. By default this flag is off. +- controls whether a port is locked or not. When locked, non-link-local frames +received through the port are dropped unless an FDB entry with the MAC source +address points to the port. The common use case is IEEE 802.1X where hosts can +authenticate themselves by exchanging EAPOL frames with an authenticator. After +authentication is complete, the user space control plane can install a matching +FDB entry to allow traffic from the host to be forwarded by the bridge. When +learning is enabled on a locked port, the +.B no_linklocal_learn +bridge option needs to be on to prevent the bridge from learning from received +EAPOL frames. By default this flag is off. + +.BR mab " { " on " | " off " }" +- controls whether MAC Authentication Bypass (MAB) is enabled on the port or +not. MAB can only be enabled on a locked port that has learning enabled. When +enabled, FDB entries are learned from received traffic and have the "locked" +FDB flag set. The flag can only be set by the kernel and it indicates that the +FDB entry cannot be used to authenticate the corresponding host. User space can +decide to authenticate the host by replacing the FDB entry and clearing the +"locked" FDB flag. Locked FDB entries can roam to unlocked (authorized) ports +in which case the "locked" flag is cleared. FDB entries cannot roam to locked +ports regardless of MAB being enabled or not. Therefore, locked FDB entries are +only created if an FDB entry with the given {MAC, VID} does not already exist. +This behavior prevents unauthenticated hosts from disrupting traffic destined +to already authenticated hosts. Locked FDB entries act like regular dynamic +entries with respect to forwarding and aging. By default this flag is off. .BI backup_port " DEVICE" - if the port loses carrier all traffic will be redirected to the @@ -2649,6 +2727,9 @@ .BI bcqueuelen " LENGTH " + +.BI bclim " LIMIT " + .in +8 .BI bcqueuelen " LENGTH " @@ -2662,6 +2743,13 @@ When listing device parameters both the bcqueuelen parameter as well as the actual used bcqueuelen are listed to better help the user understand the setting. + +.BI bclim " LIMIT " +- Set the threshold for broadcast queueing. +.IR LIMIT " must be a 32-bit integer." +Setting this to -1 disables broadcast queueing altogether. Otherwise +a multicast address will be queued as broadcast if the number of devices +using it is greater than the given value. .in -8 .TP
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/man/man8/ip-route.8.in -> _service:tar_scm:iproute2-6.4.0.tar.xz/man/man8/ip-route.8.in
Changed
@@ -963,7 +963,12 @@ .in -2 .B psp -- Penultimate Segment Pop of the SRH (not yet supported in kernel) +- The Penultimate Segment Pop (PSP) copies the last SID from the SID List +(carried by the outermost SRH) into the IPv6 Destination Address (DA) and +removes (i.e. pops) the SRH from the IPv6 header. +The PSP operation takes place only at a penultimate SR Segment Endpoint node +(e.g., the Segment Left must be one) and does not happen at non-penultimate +endpoint nodes. .B usp - Ultimate Segment Pop of the SRH (not yet supported in kernel) @@ -1359,6 +1364,11 @@ Adds an IPv6 route with SRv6 decapsulation and forward with lookup in VRF table. .RE .PP +ip -6 route add 2001:db8:1::/64 encap seg6local action End flavors psp dev eth0 +.RS 4 +Adds an IPv6 route with SRv6 End behavior with psp flavor enabled. +.RE +.PP ip -6 route add 2001:db8:1::/64 encap seg6local action End flavors next-csid dev eth0 .RS 4 Adds an IPv6 route with SRv6 End behavior with next-csid flavor enabled.
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/man/man8/ip-rule.8 -> _service:tar_scm:iproute2-6.4.0.tar.xz/man/man8/ip-rule.8
Changed
@@ -15,7 +15,7 @@ .ti -8 .B ip rule -.RB " " list +.RB " " show .RI " " SELECTOR " " .ti -8 @@ -42,8 +42,8 @@ .IR STRING " " .B oif .IR STRING " " -.B pref -.IR NUMBER " " +.B priority +.IR PREFERENCE " " .IR l3mdev " " .B uidrange .IR NUMBER "-" NUMBER " " @@ -88,7 +88,7 @@ .SH DESCRIPTION .I ip rule manipulates rules -in the routing policy database control the route selection algorithm. +in the routing policy database that controls the route selection algorithm. .P Classic routing algorithms used in the Internet make routing decisions @@ -96,8 +96,8 @@ but not in practice, on the TOS field). .P -In some circumstances we want to route packets differently depending not only -on destination addresses, but also on other packet fields: source address, +In some circumstances, we want to route packets differently depending not only +on destination addresses but also on other packet fields: source address, IP protocol, transport protocol ports or even packet payload. This task is called 'policy routing'. @@ -111,7 +111,7 @@ .B selector and an .B action predicate. -The RPDB is scanned in order of decreasing priority (note that lower number +The RPDB is scanned in order of decreasing priority (note that a lower number means higher priority, see the description of .I PREFERENCE below). The selector @@ -179,21 +179,21 @@ .RS .B unicast -- the rule prescribes to return the route found +- the rule returns the route found in the routing table referenced by the rule. .B blackhole -- the rule prescribes to silently drop the packet. +- the rule causes a silent drop the packet. .B unreachable -- the rule prescribes to generate a 'Network is unreachable' error. +- the rule generates a 'Network is unreachable' error. .B prohibit -- the rule prescribes to generate 'Communication is administratively +- the rule generates 'Communication is administratively prohibited' error. .B nat -- the rule prescribes to translate the source address +- the rule translates the source address of the IP packet into some other value. .RE
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/man/man8/ip-xfrm.8 -> _service:tar_scm:iproute2-6.4.0.tar.xz/man/man8/ip-xfrm.8
Changed
@@ -65,6 +65,12 @@ .IR MASK " " .RB " " if_id .IR IF-ID " " +.RB " " offload +.RB " " crypto | packet " " +.RB dev +.IR DEV " +.RB dir +.IR DIR " " .RB " " tfcpad .IR LENGTH " " @@ -246,6 +252,10 @@ .IR FLAG-LIST " " .RB " " if_id .IR IF-ID " " +.RB " " offload +.RB packet +.RB dev +.IR DEV " " .RI " " LIMIT-LIST " " TMPL-LIST " " .ti -8 @@ -587,6 +597,10 @@ .I IF-ID xfrm interface identifier used to in both xfrm policies and states +.TP +.I DEV +Network interface name used to offload policies and states + .sp .PP .TS
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/man/man8/ss.8 -> _service:tar_scm:iproute2-6.4.0.tar.xz/man/man8/ss.8
Changed
@@ -156,7 +156,7 @@ Show process using socket. .TP .B \-T, \-\-threads -Show thread using socket. Implies \-p. +Show thread using socket. Implies .BR \-p . .TP .B \-i, \-\-info
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/man/man8/tc-flower.8 -> _service:tar_scm:iproute2-6.4.0.tar.xz/man/man8/tc-flower.8
Changed
@@ -54,7 +54,9 @@ .IR BOS " | " .B mpls_ttl .IR TTL " | " -.BR ip_proto " { " tcp " | " udp " | " sctp " | " icmp " | " icmpv6 " | " +.B l2tpv3_sid +.IR LSID " | " +.BR ip_proto " { " tcp " | " udp " | " sctp " | " icmp " | " icmpv6 " | " l2tp " | " .IR IP_PROTO " } | " .B ip_tos .IR MASKED_IP_TOS " | " @@ -291,11 +293,16 @@ .I TTL is an unsigned 8 bit value in decimal format. .TP +.BI l2tpv3_sid " LSID" +Match on L2TPv3 session id field transported over IPv4 or IPv6. +.I LSID +is an unsigned 32 bit value in decimal format. +.TP .BI ip_proto " IP_PROTO" Match on layer four protocol. .I IP_PROTO may be -.BR tcp ", " udp ", " sctp ", " icmp ", " icmpv6 +.BR tcp ", " udp ", " sctp ", " icmp ", " icmpv6 ", " l2tp or an unsigned 8bit value in hexadecimal format. .TP .BI ip_tos " MASKED_IP_TOS"
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/man/man8/tc-mqprio.8 -> _service:tar_scm:iproute2-6.4.0.tar.xz/man/man8/tc-mqprio.8
Changed
@@ -3,30 +3,38 @@ MQPRIO \- Multiqueue Priority Qdisc (Offloaded Hardware QOS) .SH SYNOPSIS .B tc qdisc ... dev -dev -.B ( parent -classid -.B | root) handle -major: -.B mqprio num_tc -tcs -.B map -P0 P1 P2... -.B queues -count1@offset1 count2@offset2 ... -.B hw -1|0 -.B mode -dcb|channel -.B shaper -dcb| -.B bw_rlimit +dev ( +.B parent +classid | root) +.B handle +major: +.B mqprio +.ti +8 + +.B num_tc +tcs +.B map +P0 P1 P2... +.B queues +count1@offset1 count2@offset2 ... +.ti +8 + +.B hw +1|0 +.B mode +dcb|channel +.B shaper +dcb|bw_rlimit +.ti +8 + .B min_rate -min_rate1 min_rate2 ... +min_rate1 min_rate2 ... .B max_rate -max_rate1 max_rate2 ... -.B - +max_rate1 max_rate2 ... +.ti +8 + +.B fp +FP0 FP1 FP2 ... .SH DESCRIPTION The MQPRIO qdisc is a simple queuing discipline that allows mapping @@ -98,6 +106,7 @@ .TP num_tc Number of traffic classes to use. Up to 16 classes supported. +You cannot have more classes than queues .TP map @@ -119,6 +128,8 @@ to support hardware offload. Set to .B 0 to configure user specified values in software only. +The default value of this parameter is +.B 1 .TP mode @@ -139,11 +150,140 @@ .TP min_rate -Minimum value of bandwidth rate limit for a traffic class. +Minimum value of bandwidth rate limit for a traffic class. Supported only when +the +.B 'shaper' +argument is set to +.B 'bw_rlimit'. .TP max_rate -Maximum value of bandwidth rate limit for a traffic class. +Maximum value of bandwidth rate limit for a traffic class. Supported only when +the +.B 'shaper' +argument is set to +.B 'bw_rlimit'. + +.TP +fp +Selects whether traffic classes are express (deliver packets via the eMAC) or +preemptible (deliver packets via the pMAC), according to IEEE 802.1Q-2018 +clause 6.7.2 Frame preemption. Takes the form of an array (one element per +traffic class) with values being +.B 'E' +(for express) or +.B 'P' +(for preemptible). + +Multiple priorities which map to the same traffic class, as well as multiple +TXQs which map to the same traffic class, must have the same FP attributes. +To interpret the FP as an attribute per priority, the +.B 'map' +argument can be used for translation. To interpret FP as an attribute per TXQ, +the +.B 'queues' +argument can be used for translation. + +Traffic classes are express by default. The argument is supported only with +.B 'hw' +set to 1. Preemptible traffic classes are accepted only if the device has a MAC +Merge layer configurable through +.BR ethtool(8). + +.SH SEE ALSO +.BR ethtool(8) + +.SH EXAMPLE + +The following example shows how to attach priorities to 4 traffic classes ("num_tc 4"), +and then how to pair these traffic classes with 4 hardware queues with mqprio, +with hardware coordination ("hw 1", or does not specified, because 1 is the default value). +Traffic class 0 (tc0) is mapped to hardware queue 0 (q0), tc1 is mapped to q1, +tc2 is mapped to q2, and tc3 is mapped q3. + +.EX +# tc qdisc add dev eth0 root mqprio \ + num_tc 4 \ + map 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 \ + queues 1@0 1@1 1@2 1@3 \ + hw 1 +.EE + +The next example shows how to attach priorities to 3 traffic classes ("num_tc 3"), +and how to pair these traffic classes with 4 queues, +without hardware coordination ("hw 0"). +Traffic class 0 (tc0) is mapped to hardware queue 0 (q0), tc1 is mapped to q1, +tc2 and is mapped to q2 and q3, where the queue selection between these +two queues is somewhat randomly decided. + +.EX +# tc qdisc add dev eth0 root mqprio \ + num_tc 3 \ + map 0 0 0 0 1 1 1 1 2 2 2 2 2 2 2 2 \ + queues 1@0 1@1 2@2 \ + hw 0 +.EE + + +In both cases from above the priority values from 0 to 3 (prio0-3) are +mapped to tc0, prio4-7 are mapped to tc1, and the +prio8-11 are mapped to tc2 ("map" attribute). The last four priority values +(prio12-15) are mapped in different ways in the two examples. +They are mapped to tc3 in the first example and mapped to tc2 in the second example. +The values of these two examples are the following: + + ┌────┬────┬───────┐ ┌────┬────┬────────┐ + │Prio│ tc │ queue │ │Prio│ tc │ queue │ + ├────┼────┼───────┤ ├────┼────┼────────┤ + │ 0 │ 0 │ 0 │ │ 0 │ 0 │ 0 │ + │ 1 │ 0 │ 0 │ │ 1 │ 0 │ 0 │ + │ 2 │ 0 │ 0 │ │ 2 │ 0 │ 0 │ + │ 3 │ 0 │ 0 │ │ 3 │ 0 │ 0 │ + │ 4 │ 1 │ 1 │ │ 4 │ 1 │ 1 │ + │ 5 │ 1 │ 1 │ │ 5 │ 1 │ 1 │ + │ 6 │ 1 │ 1 │ │ 6 │ 1 │ 1 │ + │ 7 │ 1 │ 1 │ │ 7 │ 1 │ 1 │ + │ 8 │ 2 │ 2 │ │ 8 │ 2 │ 2 or 3 │ + │ 9 │ 2 │ 2 │ │ 9 │ 2 │ 2 or 3 │ + │ 10 │ 2 │ 2 │ │ 10 │ 2 │ 2 or 3 │ + │ 11 │ 2 │ 2 │ │ 11 │ 2 │ 2 or 3 │ + │ 12 │ 3 │ 3 │ │ 12 │ 2 │ 2 or 3 │ + │ 13 │ 3 │ 3 │ │ 13 │ 2 │ 2 or 3 │ + │ 14 │ 3 │ 3 │ │ 14 │ 2 │ 2 or 3 │ + │ 15 │ 3 │ 3 │ │ 15 │ 2 │ 2 or 3 │ + └────┴────┴───────┘ └────┴────┴────────┘ + example1 example2 + + +Another example of queue mapping is the following. +There are 5 traffic classes, and there are 8 hardware queues. + +.EX +# tc qdisc add dev eth0 root mqprio \ + num_tc 5 \ + map 0 0 0 1 1 1 1 2 2 3 3 4 4 4 4 4 \ + queues 1@0 2@1 1@3 1@4 3@5 +.EE + +The value mapping is the following for this example: + + ┌───────┐ + tc0────┤Queue 0│◄────1@0 + ├───────┤ + ┌─┤Queue 1│◄────2@1 + tc1──┤ ├───────┤ + └─┤Queue 2│ + ├───────┤ + tc2────┤Queue 3│◄────1@3 + ├───────┤ + tc3────┤Queue 4│◄────1@4 + ├───────┤ + ┌─┤Queue 5│◄────3@5 + │ ├───────┤ + tc4──┼─┤Queue 6│ + │ ├───────┤ + └─┤Queue 7│ + └───────┘ .SH AUTHORS
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/man/man8/tc-netem.8 -> _service:tar_scm:iproute2-6.4.0.tar.xz/man/man8/tc-netem.8
Changed
@@ -1,6 +1,6 @@ .TH NETEM 8 "25 November 2011" "iproute2" "Linux" .SH NAME -NetEm \- Network Emulator +netem \- Network Emulator .SH SYNOPSIS .B "tc qdisc ... dev" .IR DEVICE " " @@ -20,7 +20,7 @@ .IR TIME " " JITTER " " CORRELATION " " .br -.BR distribution " { "uniform " | " normal " | " pareto " | " paretonormal " } " +.BR distribution " { "uniform " | " normal " | " pareto " | " paretonormal " } " .IR LOSS " := " .BR loss " { " @@ -64,135 +64,175 @@ .BR bytes .IR BYTES " " - .SH DESCRIPTION -NetEm is an enhancement of the Linux traffic control facilities -that allow one to add delay, packet loss, duplication and more other -characteristics to packets outgoing from a selected network -interface. NetEm is built using the existing Quality Of Service (QOS) -and Differentiated Services (diffserv) facilities in the Linux -kernel. - -.SH netem OPTIONS -netem has the following options: - -.SS limit packets - -maximum number of packets the qdisc may hold queued at a time. - -.SS delay -adds the chosen delay to the packets outgoing to chosen network interface. The -optional parameters allows one to introduce a delay variation and a correlation. -Delay and jitter values are expressed in ms while correlation is percentage. - -.SS distribution -allow the user to choose the delay distribution. If not specified, the default -distribution is Normal. Additional parameters allow one to consider situations in -which network has variable delays depending on traffic flows concurring on the -same path, that causes several delay peaks and a tail. - -.SS loss random -adds an independent loss probability to the packets outgoing from the chosen -network interface. It is also possible to add a correlation, but this option -is now deprecated due to the noticed bad behavior. - -.SS loss state -adds packet losses according to the 4-state Markov using the transition -probabilities as input parameters. The parameter p13 is mandatory and if used -alone corresponds to the Bernoulli model. The optional parameters allows one to -extend the model to 2-state (p31), 3-state (p23 and p32) and 4-state (p14). -State 1 corresponds to good reception, State 4 to independent losses, State 3 -to burst losses and State 2 to good reception within a burst. - -.SS loss gemodel -adds packet losses according to the Gilbert-Elliot loss model or its special -cases (Gilbert, Simple Gilbert and Bernoulli). To use the Bernoulli model, the -only needed parameter is p while the others will be set to the default -values r=1-p, 1-h=1 and 1-k=0. The parameters needed for the Simple Gilbert -model are two (p and r), while three parameters (p, r, 1-h) are needed for the -Gilbert model and four (p, r, 1-h and 1-k) are needed for the Gilbert-Elliot -model. As known, p and r are the transition probabilities between the bad and -the good states, 1-h is the loss probability in the bad state and 1-k is the -loss probability in the good state. - -.SS ecn -can be used optionally to mark packets instead of dropping them. A loss model -has to be used for this to be enabled. - -.SS corrupt -allows the emulation of random noise introducing an error in a random position -for a chosen percent of packets. It is also possible to add a correlation -through the proper parameter. - -.SS duplicate -using this option the chosen percent of packets is duplicated before queuing -them. It is also possible to add a correlation through the proper parameter. - -.SS reorder -to use reordering, a delay option must be specified. There are two ways to use -this option (assuming 'delay 10ms' in the options list). - -.B "reorder " -.I 25% 50% -.B "gap" -.I 5 +The +.B netem +queue discipline provides Network Emulation functionality +for testing protocols by emulating the properties of real-world networks. + +The queue discipline provides one or more network impairments to packets +such as: delay, loss, duplication, and packet corruption. + +.SH OPTIONS +.TP +.BI limit " COUNT" +Limits the maximum number of packets the qdisc may hold when doing delay. + +.TP +.B delay +.IR TIME " " JITTER " " CORRELATION " " .br -in this first example, the first 4 (gap - 1) packets are delayed by 10ms and -subsequent packets are sent immediately with a probability of 0.25 (with -correlation of 50% ) or delayed with a probability of 0.75. After a packet is -reordered, the process restarts i.e. the next 4 packets are delayed and -subsequent packets are sent immediately or delayed based on reordering -probability. To cause a repeatable pattern where every 5th packet is reordered -reliably, a reorder probability of 100% can be used. +Delays the packets before sending. +The optional parameters allow introducing a delay variation and a correlation. +Delay and jitter values are expressed in milliseconds; +Correlation is set by specifying a percent of how much the previous delay +will impact the current random value. + +.TP +.BI distribution " TYPE" +Specifies a pattern for delay distribution. +.RS +.TP +.B uniform +Use an equally weighted distribution of packet delays. +.TP +.B normal +Use a Gaussian distribution of delays. +Sometimes called a Bell Curve. +.TP +.B pareto +Use a Pareto distribution of packet delays. +This is useful to emulate long-tail distributions. +.TP +.B paretonormal +This is a mix of +.B pareto +and +.B normal +distribution which has properties of both Bell curve and long tail. +.RE -.B reorder -.I 25% 50% +.TP +.BI loss " MODEL" +Drop packets based on a loss model. +.I MODEL +can be one of +.RS +.TP +.BI random " PERCENT" +Each packet loss is independent. +.TP +.BI state " P13 P31 P32 P23 P14 " +Use a 4-state Markov chain to describe packet loss. .br -in this second example 25% of packets are sent immediately (with correlation of -50%) while the others are delayed by 10 ms. - -.SS rate -delay packets based on packet size and is a replacement for -.IR TBF . -Rate can be -specified in common units (e.g. 100kbit). Optional +.I P13 +is the packet loss. +Optional parameters extend the model to 2-state +.IR P31 , +3-state +.IR P23 , +.I P32 +and 4-state +.IR P14 . + +The Markov chain states are: +.RS +.TP +.B 1 +good packet reception (no loss). +.TP +.B 2 +good reception within a burst. +.TP +.B 3 +burst losses. +.TP +.B 4 +independent losses. +.RE + +.TP +.BI gemodel " PERCENT R 1-H 1-K " +Use a Gilbert-Elliot (burst loss) model +based on: +.RS +.TP +.I PERCENT +probability of starting bad (lossy) state. +.TP +.I R +probability of exiting bad state. +.TP +.I "1-H" +loss probability in bad state. +.TP +.I "1-K" +loss probability in good state. +.RE +.RE + +.TP +.B ecn +Use +Explicit Congestion Notification (ECN) +to mark packets instead of dropping them. +A loss model has to be used for this to be enabled. +.TP +.BI corrupt " PERCENT" +modifies the contents of the packet at a random position +based on +.IR PERCENT . +.TP +.BI duplicate " PERCENT" +creates a copy of the packet before queuing. +.TP +.BI reorder " PERCENT" +modifies the order of packet in the queue. +.TP +.BI gap " DISTANCE" +sends some packets immediately. +The first packets +.I "(DISTANCE - 1)" +are delayed and the next packet is sent immediately. + +.TP +.BI rate " RATE PACKETOVERHEAD CELLSIZE CELLOVERHEAD " +Delays packets based on packet size to emulate a fixed link speed. +Optional parameters: +.RS +.TP .I PACKETOVERHEAD -(in bytes) specify an per packet overhead and can be negative. A positive value can be -used to simulate additional link layer headers. A negative value can be used to -artificial strip the Ethernet header (e.g. -14) and/or simulate a link layer -header compression scheme. The third parameter - an unsigned value - specify -the cellsize. Cellsize can be used to simulate link layer schemes. ATM for -example has an payload cellsize of 48 bytes and 5 byte per cell header. If a -packet is 50 byte then ATM must use two cells: 2 * 48 bytes payload including 2 -* 5 byte header, thus consume 106 byte on the wire. The last optional value -.I CELLOVERHEAD -can be used to specify per cell overhead - for our ATM example 5. +Specify a per packet overhead in bytes. +Used to simulate additional link layer headers. +A negative value can be used to simlate when the Ethernet header is +stripped (e.g. -14) or header compression is used. +.TP +.I CELLSIZE +simulate link layer schemes like ATM. +.TP .I CELLOVERHEAD -can be negative, but use negative values with caution. - -Note that rate throttling is limited by several factors: the kernel clock -granularity avoid a perfect shaping at a specific level. This will show up in -an artificial packet compression (bursts). Another influence factor are network -adapter buffers which can also add artificial delay. - -.SS slot -defer delivering accumulated packets to within a slot. Each available slot can be -configured with a minimum delay to acquire, and an optional maximum delay. -Alternatively it can be configured with the distribution similar to -.BR distribution -for -.BR delay -option. Slot delays can be specified in nanoseconds, microseconds, milliseconds or seconds -(e.g. 800us). Values for the optional parameters -.I BYTES -will limit the number of bytes delivered per slot, and/or -.I PACKETS -will limit the number of packets delivered per slot. +specify per cell overhead. +.RE + +Rate throttling impacted by several factors including the kernel clock +granularity. This will show up in an artificial packet compression (bursts). + +.TP +.BI slot " MIN_DELAY MAX_DELAY " +allows emulating slotted networks. +Defer delivering accumulated packets to within a slot. +Each available slot is configured with a minimum delay to acquire, +and an optional maximum delay. +.TP +.B slot distribution +allows configuring based on distribution similar to +.B distribution +option for packet delays. These slot options can provide a crude approximation of bursty MACs such as DOCSIS, WiFi, and LTE. -Note that slotting is limited by several factors: the kernel clock granularity, +Slot emulation is limited by several factors: the kernel clock granularity, as with a rate, and attempts to deliver many packets within a slot will be smeared by the timer resolution, and by the underlying native bandwidth also. @@ -201,36 +241,156 @@ the actual delivered rate. .SH LIMITATIONS -The main known limitation of Netem are related to timer granularity, since -Linux is not a real-time operating system. +Netem is limited by the timer granularity in the kernel. +Rate and delay maybe impacted by clock interrupts. +.PP +Mixing forms of reordering may lead to unexpected results. +For any method of reordering to work, some delay is necessary. +If the delay is less than the inter-packet arrival time then +no reordering will be seen. +Due to mechanisms like TSQ (TCP Small Queues), for TCP performance test +results to be realistic netem must be placed on the ingress of the +receiver host. +.PP +Combining netem with other qdisc is possible but may not always +work because netem use skb control block to set delays. .SH EXAMPLES .PP -tc qdisc add dev eth0 root netem rate 5kbit 20 100 5 +.EX +# tc qdisc add dev eth0 root netem delay 100ms +.EE +.RS 4 +Add fixed amount of delay to all packets going out on device eth0. +Each packet will have added delay of 100ms ± 10ms. +.RE +.PP +.EX +# tc qdisc change dev eth0 root netem delay 100ms 10ms 25% +.EE +.RS 4 +This causes the added delay of 100ms ± 10ms +and the next packet delay value will be biased by 25% on the most recent delay. +This isn't a true statistical correlation, but an approximation. +.RE +.PP +.EX +# tc qdisc change dev eth0 root netem delay 100ms 20ms distribution normal +.EE +.RS 4 +This delays packets according to a normal distribution (Bell curve) +over a range of 100ms ± 20ms. +.RE +.PP +.EX +# tc qdisc change dev eth0 root netem loss 0.1% +.EE .RS 4 -delay all outgoing packets on device eth0 with a rate of 5kbit, a per packet -overhead of 20 byte, a cellsize of 100 byte and a per celloverhead of 5 byte: +This causes 1/10th of a percent (i.e 1 out of 1000) packets to be +randomly dropped. + +An optional correlation may also be added. +This causes the random number generator to be less random and can be used to emulate packet burst losses. +.RE +.PP +.EX +# tc qdisc change dev eth0 root netem duplicate 1% +.EE +.RS 4 +This causes one percent of the packets sent on eth0 to be duplicated. +.RE +.PP +.EX +# tc qdisc change dev eth0 root netem loss 0.3% 25% +.EE +.RS 4 +This will cause 0.3% of packets to be lost, +and each successive probability depends is biased by 25% of the previous one. +.RE +.PP +There are two different ways to specify reordering. +The gap method uses a fixed sequence and reorders every Nth packet. +.EX +# tc qdisc change dev eth0 root netem gap 5 delay 10ms +.EE +.RS 4 +This causes every 5th (10th, 15th, …) packet to go to be sent immediately +and every other packet to be delayed by 10ms. +This is predictable and useful for base protocol testing like reassembly. +.RE +.PP +The reorder form uses a percentage of the packets to get misordered. +.EX +# tc qdisc change dev eth0 root netem delay 10ms reorder 25% 50% +.EE +In this example, 25% of packets (with a correlation of 50%) will get sent immediately, others will be delayed by 10ms. +.PP +Packets will also get reordered if jitter is large enough. +.EX +# tc qdisc change dev eth0 root netem delay 100ms 75ms +.EE +.RS 4 +If the first packet gets a random delay of 100ms (100ms base - 0ms jitter) +and the second packet is sent 1ms later and gets a delay of 50ms (100ms base - 50ms jitter); +the second packet will be sent first. +This is because the queue discipline tfifo inside netem, +keeps packets in order by time to send. +.RE +.PP +If you don't want this behavior then replace the internal +queue discipline tfifo with a simple FIFO queue discipline. +.EX +# tc qdisc add dev eth0 root handle 1: netem delay 10ms 100ms +# tc qdisc add dev eth0 parent 1:1 pfifo limit 1000 +.EE + +.PP +Example of using rate control and cells size. +.EX +# tc qdisc add dev eth0 root netem rate 5kbit 20 100 5 +.EE +.RS 4 +Delay all outgoing packets on device eth0 with a rate of 5kbit, a per packet +overhead of 20 byte, a cellsize of 100 byte and a per celloverhead of 5 bytes. .RE +.PP +It is possible to selectively apply impairment using traffic classification. +.EX +# tc qdisc add dev eth0 root handle 1: prio +# tc qdisc add dev eth0 parent 1:3 handle 30: \ + tbf rate 20kbit buffer 1600 limit 3000 +# tc qdisc add dev eth0 parent 30:1 handle 31: \ + netem delay 200ms 10ms distribution normal +# tc filter add dev eth0 protocol ip parent 1:0 prio 3 u32 \ + match ip dst 65.172.181.4/32 flowid 1:3 +.EE +.RS 4 +This example uses a priority queueing discipline; +a TBF is added to do rate control; and a simple netem delay. +A filter classifies all packets going to 65.172.181.4 as being priority 3. +.PP .SH SOURCES .IP " 1. " 4 Hemminger S. , "Network Emulation with NetEm", Open Source Development Lab, April 2005 -(http://devresources.linux-foundation.org/shemminger/netem/LCA2005_paper.pdf) +.UR http://devresources.linux-foundation.org/shemminger/netem/LCA2005_paper.pdf +.UE .IP " 2. " 4 -Netem page from Linux foundation, (https://wiki.linuxfoundation.org/networking/netem) - -.IP " 3. " 4 Salsano S., Ludovici F., Ordine A., "Definition of a general and intuitive loss model for packet networks and its implementation in the Netem module in the -Linux kernel", available at http://netgroup.uniroma2.it/NetemCLG +Linux kernel", available at +.UR http://netgroup.uniroma2.it/NetemCLG +.UE .SH SEE ALSO -.BR tc (8), -.BR tc-tbf (8) +.BR tc (8) .SH AUTHOR -Netem was written by Stephen Hemminger at Linux foundation and is based on NISTnet. -This manpage was created by Fabio Ludovici <fabio.ludovici at yahoo dot it> and -Hagen Paul Pfeifer <hagen@jauu.net> +Netem was written by Stephen Hemminger at Linux foundation and was +inspired by NISTnet. + +Original manpage was created by Fabio Ludovici +<fabio.ludovici at yahoo dot it> and Hagen Paul Pfeifer +<hagen@jauu.net>.
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/man/man8/tc-taprio.8 -> _service:tar_scm:iproute2-6.4.0.tar.xz/man/man8/tc-taprio.8
Changed
@@ -32,6 +32,14 @@ .ti +8 .B sched-entry <command N> <gate mask N> <interval N> +.ti +8 + +.B max-sdu +<queueMaxSDUTC 0> <queueMaxSDUTC 1> <queueMaxSDUTC N> +.ti +8 + +.B fp +<adminStatusTC 0> <adminStatusTC 1> <adminStatusTC N> .SH DESCRIPTION The TAPRIO qdisc implements a simplified version of the scheduling @@ -150,6 +158,22 @@ .BR etf(8) qdisc. +.TP +max-sdu +.br +Specifies an array containing at most 16 elements, one per traffic class, which +corresponds to the queueMaxSDU table from IEEE 802.1Q-2018. Each array element +represents the maximum L2 payload size that can egress that traffic class. +Elements that are not filled in default to 0. The value 0 means that the +traffic class can send packets up to the port's maximum MTU in size. + +.TP +fp +.br +Selects whether traffic classes are express or preemptible. See +.BR tc-mqprio(8) +for details. + .SH EXAMPLES The following example shows how an traffic schedule with three traffic @@ -164,7 +188,7 @@ 300us duration. .EX -# tc qdisc replace dev eth0 parent root handle 100 taprio \\ +# tc qdisc replace dev eth0 parent root handle 100 stab overhead 24 taprio \\ num_tc 3 \\ map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \\ queues 1@0 1@1 2@2 \\ @@ -180,7 +204,7 @@ for more information about configuring the ETF qdisc. .EX -# tc qdisc replace dev eth0 parent root handle 100 taprio \\ +# tc qdisc replace dev eth0 parent root handle 100 stab overhead 24 taprio \\ num_tc 3 \\ map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \\ queues 1@0 1@0 1@0 \\ @@ -205,19 +229,28 @@ durations (i.e. 20 us + 20 us + 60 us = 100 us). Although the base-time is in the past, the hardware will start executing the schedule at a PTP time equal to the smallest integer multiple of 100 us, plus 200 ns, that is larger than the -NIC's current PTP time. +NIC's current PTP time. In addition, the MTU for traffic class 5 is limited to +200 octets, so that the interference this creates upon traffic class 7 during +the time window when their gates are both open is bounded. The interference is +determined by the transmit time of the max SDU, plus the L2 header length, plus +the L1 overhead (determined from the size table specified using +.BR tc-stab(8)). .EX -# tc qdisc add dev eth0 parent root taprio \\ +# tc qdisc add dev eth0 parent root stab overhead 24 taprio \\ num_tc 8 \\ map 0 1 2 3 4 5 6 7 \\ queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 \\ + max-sdu 0 0 0 0 0 200 0 0 \\ base-time 200 \\ sched-entry S 80 20000 \\ sched-entry S a0 20000 \\ - sched-entry S df 60000 \\ + sched-entry S 5f 60000 \\ flags 0x2 .EE +.SH SEE ALSO +.BR tc-stab(8) + .SH AUTHORS Vinicius Costa Gomes <vinicius.gomes@intel.com>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/man/man8/tc-tunnel_key.8 -> _service:tar_scm:iproute2-6.4.0.tar.xz/man/man8/tc-tunnel_key.8
Changed
@@ -131,6 +131,9 @@ .B nocsum with IPv6, be sure you know what you are doing. Zero UDP checksums provide weaker protection against corrupted packets. See RFC6935 for details. +.TP +.B nofrag +disallow IP fragmentation. .RE .SH EXAMPLES The following example encapsulates incoming ICMP packets on eth0 into a vxlan
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/man/man8/tc.8 -> _service:tar_scm:iproute2-6.4.0.tar.xz/man/man8/tc.8
Changed
@@ -361,10 +361,6 @@ packets when nearing configured bandwidth allocation. Well suited to very large bandwidth applications. .TP -rr -Round-Robin qdisc with support for multiqueue network devices. Removed from -Linux since kernel version 2.6.27. -.TP sfb Stochastic Fair Blue is a classless qdisc to manage congestion based on packet loss and link utilization history while trying to prevent
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/man/man8/vdpa-dev.8 -> _service:tar_scm:iproute2-6.4.0.tar.xz/man/man8/vdpa-dev.8
Changed
@@ -31,6 +31,7 @@ .I NAME .B mgmtdev .I MGMTDEV +.RI " device_features " DEVICE_FEATURES " " .RI " mac " MACADDR " " .RI " mtu " MTU " " .RI " max_vqp " MAX_VQ_PAIRS " " @@ -74,6 +75,15 @@ Name of the management device to use for device addition. .PP +.BI device_features " DEVICE_FEATURES" +Specifies the virtio device features bit-mask that is provisioned for the new vdpa device. + +The bits can be found under include/uapi/linux/virtio*h. + +see macros such as VIRTIO_F_ and VIRTIO_XXX(e.g NET)_F_ for specific bit values. + +This is optional. + .BI mac " MACADDR" - specifies the mac address for the new vdpa device. This is applicable only for the network type of vdpa device. This is optional. @@ -127,6 +137,11 @@ Add the vdpa device named foo on the management device vdpa_sim_net. .RE .PP +vdpa dev add name foo mgmtdev vdpa_sim_net device_features 0x300020000 +.RS 4 +Add the vdpa device named foo on the management device vdpa_sim_net with device_features of 0x300020000 +.RE +.PP vdpa dev add name foo mgmtdev vdpa_sim_net mac 00:11:22:33:44:55 .RS 4 Add the vdpa device named foo on the management device vdpa_sim_net with mac address of 00:11:22:33:44:55.
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/misc/arpd.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/misc/arpd.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * arpd.c ARP helper daemon. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/misc/ifstat.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/misc/ifstat.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * ifstat.c handy utility to read net interface statistics * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/misc/lnstat.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/misc/lnstat.c
Changed
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* lnstat - Unified linux network statistics * * Copyright (C) 2004 by Harald Welte <laforge@gnumonks.org> @@ -8,12 +9,6 @@ * * Copyright 2001 by Robert Olsson <robert.olsson@its.uu.se> * Uppsala University, Sweden - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * */ /* Maximum number of fields that can be displayed */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/misc/lnstat_util.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/misc/lnstat_util.c
Changed
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* lnstat.c: Unified linux network statistics * * Copyright (C) 2004 by Harald Welte <laforge@gnumonks.org> @@ -8,12 +9,6 @@ * * Copyright 2001 by Robert Olsson <robert.olsson@its.uu.se> * Uppsala University, Sweden - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * */ #include <unistd.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/misc/nstat.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/misc/nstat.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * nstat.c handy utility to read counters /proc/net/netstat and snmp * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> */ @@ -223,9 +219,15 @@ exit(-1); } n->id = strdup(idbuf); + if (n->id == NULL) { + perror("nstat: strdup"); + exit(-1); + } n->rate = 0; n->next = db; db = n; + if (next == NULL) + break; p = next; } n = db;
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/misc/rtacct.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/misc/rtacct.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * rtacct.c Applet to display contents of /proc/net/rt_acct. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/misc/ss.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/misc/ss.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * ss.c "sockstat", socket statistics * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/misc/ss_util.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/misc/ss_util.h
Changed
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __SS_UTIL_H__ #define __SS_UTIL_H__
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/misc/ssfilter.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/misc/ssfilter.h
Changed
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ #include <stdbool.h> enum {
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/misc/ssfilter.y -> _service:tar_scm:iproute2-6.4.0.tar.xz/misc/ssfilter.y
Changed
@@ -1,4 +1,5 @@ %{ +/* SPDX-License-Identifier: GPL-2.0-or-later */ #include <stdio.h> #include <stdlib.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/misc/ssfilter_check.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/misc/ssfilter_check.c
Changed
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ #include <stdio.h> #include <stdlib.h> #include <errno.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/netem/maketable.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/netem/maketable.c
Changed
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: NIST-PD */ /* * Experimental data distribution table generator * Taken from the uncopyrighted NISTnet code (public domain).
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/netem/normal.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/netem/normal.c
Changed
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: NIST-PD */ /* * Normal distribution table generator * Taken from the uncopyrighted NISTnet code.
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/netem/pareto.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/netem/pareto.c
Changed
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: NIST-PD */ /* * Pareto distribution table generator * Taken from the uncopyrighted NISTnet code.
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/netem/paretonormal.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/netem/paretonormal.c
Changed
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: NIST-PD */ /* * Paretoormal distribution table generator *
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/netem/stats.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/netem/stats.c
Changed
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: NIST-PD */ /* * Experimental data distribution table generator * Taken from the uncopyrighted NISTnet code (public domain).
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/rdma/include/uapi/rdma/ib_user_verbs.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/rdma/include/uapi/rdma/ib_user_verbs.h
Changed
@@ -105,6 +105,18 @@ IB_USER_VERBS_EX_CMD_MODIFY_CQ }; +/* see IBA A19.4.1.1 Placement Types */ +enum ib_placement_type { + IB_FLUSH_GLOBAL = 1U << 0, + IB_FLUSH_PERSISTENT = 1U << 1, +}; + +/* see IBA A19.4.1.2 Selectivity Level */ +enum ib_selectivity_level { + IB_FLUSH_RANGE = 0, + IB_FLUSH_MR, +}; + /* * Make sure that all structs defined in this file remain laid out so * that they pack the same way on 32-bit and 64-bit architectures (to @@ -466,6 +478,8 @@ IB_UVERBS_WC_BIND_MW = 5, IB_UVERBS_WC_LOCAL_INV = 6, IB_UVERBS_WC_TSO = 7, + IB_UVERBS_WC_FLUSH = 8, + IB_UVERBS_WC_ATOMIC_WRITE = 9, }; struct ib_uverbs_wc { @@ -784,6 +798,8 @@ IB_UVERBS_WR_RDMA_READ_WITH_INV = 11, IB_UVERBS_WR_MASKED_ATOMIC_CMP_AND_SWP = 12, IB_UVERBS_WR_MASKED_ATOMIC_FETCH_AND_ADD = 13, + IB_UVERBS_WR_FLUSH = 14, + IB_UVERBS_WR_ATOMIC_WRITE = 15, /* Review enum ib_wr_opcode before modifying this */ }; @@ -1331,6 +1347,11 @@ /* Deprecated. Please use IB_UVERBS_RAW_PACKET_CAP_SCATTER_FCS. */ IB_UVERBS_DEVICE_RAW_SCATTER_FCS = 1ULL << 34, IB_UVERBS_DEVICE_PCI_WRITE_END_PADDING = 1ULL << 36, + /* Flush placement types */ + IB_UVERBS_DEVICE_FLUSH_GLOBAL = 1ULL << 38, + IB_UVERBS_DEVICE_FLUSH_PERSISTENT = 1ULL << 39, + /* Atomic write attributes */ + IB_UVERBS_DEVICE_ATOMIC_WRITE = 1ULL << 40, }; enum ib_uverbs_raw_packet_caps {
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/rdma/rdma.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/rdma/rdma.h
Changed
@@ -131,7 +131,6 @@ void rd_prepare_msg(struct rd *rd, uint32_t cmd, uint32_t *seq, uint16_t flags); int rd_dev_init_cb(const struct nlmsghdr *nlh, void *data); int rd_attr_cb(const struct nlattr *attr, void *data); -int rd_attr_check(const struct nlattr *attr, int *typep); /* * Print helpers
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/rdma/stat.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/rdma/stat.c
Changed
@@ -443,7 +443,7 @@ } mode = strtok_r(NULL, delim, &saved_ptr); - } while(1); + } while (1); if (mask) rd_arg_inc(rd);
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/rdma/utils.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/rdma/utils.c
Changed
@@ -75,6 +75,13 @@ slash = strchr(rd_argv(rd), '/'); /* if no port found, return 0 */ + if (slash == NULL) { + if (strict_port) + return -EINVAL; + else + return 0; + } + if (slash++) { if (*slash == '-') { if (strict_port) @@ -468,7 +475,7 @@ RDMA_NLDEV_ATTR_RES_RAW = MNL_TYPE_BINARY, }; -int rd_attr_check(const struct nlattr *attr, int *typep) +static int rd_attr_check(const struct nlattr *attr, int *typep) { int type; @@ -747,6 +754,9 @@ return NULL; dev_name = strdup(rd_argv(rd)); + if (!dev_name) + return NULL; + if (allow_port_index) { slash = strrchr(dev_name, '/'); if (slash)
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/Makefile -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/Makefile
Changed
@@ -15,7 +15,6 @@ TCMODULES += q_skbprio.o TCMODULES += q_tbf.o TCMODULES += q_cbq.o -TCMODULES += q_rr.o TCMODULES += q_multiq.o TCMODULES += q_netem.o TCMODULES += q_choke.o
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/e_bpf.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/e_bpf.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * e_bpf.c BPF exec proxy * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Daniel Borkmann <daniel@iogearbox.net> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/em_canid.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/em_canid.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * em_canid.c Ematch rule to match CAN frames according to their CAN identifiers * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Idea: Oliver Hartkopp <oliver.hartkopp@volkswagen.de> * Copyright: (c) 2011 Czech Technical University in Prague * (c) 2011 Volkswagen Group Research
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/em_cmp.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/em_cmp.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * em_cmp.c Simple comparison Ematch * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/em_ipset.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/em_ipset.c
Changed
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * em_ipset.c IPset Ematch * @@ -8,10 +9,6 @@ * Patrick Schaaf <bof@bof.de> * Martin Josefsson <gandalf@wlug.westbo.se> * Copyright (C) 2003-2010 Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ #include <stdbool.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/em_ipt.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/em_ipt.c
Changed
@@ -1,11 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * em_ipt.c IPtables extensions matching Ematch * * (C) 2018 Eyal Birger <eyal.birger@gmail.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ #include <getopt.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/em_meta.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/em_meta.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * em_meta.c Metadata Ematch * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/em_nbyte.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/em_nbyte.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * em_nbyte.c N-Byte Ematch * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/em_u32.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/em_u32.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * em_u32.c U32 Ematch * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/emp_ematch.y -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/emp_ematch.y
Changed
@@ -1,4 +1,5 @@ %{ +/* SPDX-License-Identifier: GPL-2.0-or-later */ #include <stdio.h> #include <stdlib.h> #include <malloc.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/f_basic.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/f_basic.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * f_basic.c Basic Classifier * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Thomas Graf <tgraf@suug.ch> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/f_bpf.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/f_bpf.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * f_bpf.c BPF-based Classifier * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Daniel Borkmann <daniel@iogearbox.net> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/f_cgroup.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/f_cgroup.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * f_cgroup.c Control Group Classifier * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Thomas Graf <tgraf@infradead.org> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/f_flow.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/f_flow.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * f_flow.c Flow filter * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Patrick McHardy <kaber@trash.net> */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/f_flower.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/f_flower.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * f_flower.c Flower Classifier * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Jiri Pirko <jiri@resnulli.us> */ @@ -26,6 +22,10 @@ #include "tc_util.h" #include "rt_names.h" +#ifndef IPPROTO_L2TP +#define IPPROTO_L2TP 115 +#endif + enum flower_matching_flags { FLOWER_IP_FLAGS, }; @@ -60,7 +60,7 @@ " ppp_proto ipv4 | ipv6 | mpls_uc | mpls_mc | PPP_PROTO " " dst_mac MASKED-LLADDR |\n" " src_mac MASKED-LLADDR |\n" - " ip_proto tcp | udp | sctp | icmp | icmpv6 | IP-PROTO |\n" + " ip_proto tcp | udp | sctp | icmp | icmpv6 | l2tp | IP-PROTO |\n" " ip_tos MASKED-IP_TOS |\n" " ip_ttl MASKED-IP_TTL |\n" " mpls LSE-LIST |\n" @@ -68,6 +68,7 @@ " mpls_tc TC |\n" " mpls_bos BOS |\n" " mpls_ttl TTL |\n" + " l2tpv3_sid LSID |\n" " dst_ip PREFIX |\n" " src_ip PREFIX |\n" " dst_port PORT-NUMBER |\n" @@ -428,6 +429,11 @@ if (eth_type != htons(ETH_P_IPV6)) goto err; ip_proto = IPPROTO_ICMPV6; + } else if (!strcmp(str, "l2tp")) { + if (eth_type != htons(ETH_P_IP) && + eth_type != htons(ETH_P_IPV6)) + goto err; + ip_proto = IPPROTO_L2TP; } else { ret = get_u8(&ip_proto, str, 16); if (ret) @@ -646,6 +652,27 @@ return flower_parse_u8(str, value_type, mask_type, NULL, NULL, n); } +static int flower_parse_l2tpv3(char *str, __u8 ip_proto, + struct nlmsghdr *n) +{ + __be32 sid; + int ret; + + if (ip_proto != IPPROTO_L2TP) { + fprintf(stderr, + "Can't set \"l2tpv3_sid\" if ip_proto isn't l2tp\n"); + return -1; + } + ret = get_be32(&sid, str, 10); + if (ret < 0) { + fprintf(stderr, "Illegal \"l2tpv3 session id\"\n"); + return -1; + } + addattr32(n, MAX_MSG, TCA_FLOWER_KEY_L2TPV3_SID, sid); + + return 0; +} + static int flower_port_attr_type(__u8 ip_proto, enum flower_endpoint endpoint) { if (ip_proto == IPPROTO_TCP) @@ -1840,6 +1867,11 @@ fprintf(stderr, "Illegal \"icmp code\"\n"); return -1; } + } else if (!strcmp(*argv, "l2tpv3_sid")) { + NEXT_ARG(); + ret = flower_parse_l2tpv3(*argv, ip_proto, n); + if (ret < 0) + return -1; } else if (matches(*argv, "arp_tip") == 0) { NEXT_ARG(); ret = flower_parse_arp_ip_addr(*argv, eth_type, @@ -2153,6 +2185,8 @@ sprintf(out, "icmp"); else if (ip_proto == IPPROTO_ICMPV6) sprintf(out, "icmpv6"); + else if (ip_proto == IPPROTO_L2TP) + sprintf(out, "l2tp"); else sprintf(out, "%02x", ip_proto); @@ -2880,6 +2914,14 @@ flower_print_masked_u8("icmp_code", tbnl_type, tbnl_mask_type, NULL); + if (tbTCA_FLOWER_KEY_L2TPV3_SID) { + struct rtattr *attr = tbTCA_FLOWER_KEY_L2TPV3_SID; + + print_nl(); + print_uint(PRINT_ANY, "l2tpv3_sid", " l2tpv3_sid %u", + rta_getattr_be32(attr)); + } + flower_print_ip4_addr("arp_sip", tbTCA_FLOWER_KEY_ARP_SIP, tbTCA_FLOWER_KEY_ARP_SIP_MASK); flower_print_ip4_addr("arp_tip", tbTCA_FLOWER_KEY_ARP_TIP,
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/f_fw.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/f_fw.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * f_fw.c FW filter. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/f_matchall.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/f_matchall.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * f_matchall.c Match-all Classifier * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Jiri Pirko <jiri@mellanox.com>, Yotam Gigi <yotamg@mellanox.com> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/f_route.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/f_route.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * f_route.c ROUTE filter. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/f_rsvp.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/f_rsvp.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * q_rsvp.c RSVP filter. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/f_u32.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/f_u32.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * q_u32.c U32 filter. * - * This program is free software; you can u32istribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> * Match mark added by Catalin(ux aka Dino) BOIE <catab at umbrella.ro> 5 nov 2004 * @@ -832,12 +828,12 @@ print_nl(); print_uint(PRINT_ANY, "ip_ihl", " match IP ihl %u", ntohl(key->val) >> 24); - return; + break; case 0x00ff0000: print_nl(); print_0xhex(PRINT_ANY, "ip_dsfield", " match IP dsfield %#x", ntohl(key->val) >> 16); - return; + break; } break; case 8: @@ -845,7 +841,6 @@ print_nl(); print_int(PRINT_ANY, "ip_protocol", " match IP protocol %d", ntohl(key->val) >> 16); - return; } break; case 12: @@ -868,7 +863,6 @@ print_string(PRINT_ANY, "address", "%s", addr); print_int(PRINT_ANY, "prefixlen", "/%d", bits); close_json_object(); - return; } } break; @@ -878,19 +872,19 @@ case 0x0000ffff: print_uint(PRINT_ANY, "dport", "match dport %u", ntohl(key->val) & 0xffff); - return; + break; case 0xffff0000: print_nl(); print_uint(PRINT_ANY, "sport", " match sport %u", ntohl(key->val) >> 16); - return; + break; case 0xffffffff: print_nl(); print_uint(PRINT_ANY, "dport", " match dport %u, ", ntohl(key->val) & 0xffff); print_uint(PRINT_ANY, "sport", "match sport %u", ntohl(key->val) >> 16); - return; + break; } /* XXX: Default print_raw */ } @@ -909,12 +903,12 @@ print_nl(); print_uint(PRINT_ANY, "ip_ihl", " match IP ihl %u", ntohl(key->val) >> 24); - return; + break; case 0x00ff0000: print_nl(); print_0xhex(PRINT_ANY, "ip_dsfield", " match IP dsfield %#x", ntohl(key->val) >> 16); - return; + break; } break; case 8: @@ -922,7 +916,6 @@ print_nl(); print_int(PRINT_ANY, "ip_protocol", " match IP protocol %d", ntohl(key->val) >> 16); - return; } break; case 12: @@ -945,7 +938,6 @@ print_string(PRINT_ANY, "address", "%s", addr); print_int(PRINT_ANY, "prefixlen", "/%d", bits); close_json_object(); - return; } } break; @@ -956,11 +948,11 @@ print_nl(); print_uint(PRINT_ANY, "sport", " match sport %u", ntohl(key->val) & 0xffff); - return; + break; case 0xffff0000: print_uint(PRINT_ANY, "dport", "match dport %u", ntohl(key->val) >> 16); - return; + break; case 0xffffffff: print_nl(); print_uint(PRINT_ANY, "sport", " match sport %u, ", @@ -968,7 +960,7 @@ print_uint(PRINT_ANY, "dport", "match dport %u", ntohl(key->val) >> 16); - return; + break; } /* XXX: Default print_raw */ } @@ -1277,7 +1269,7 @@ if (tbTCA_U32_CLASSID) { __u32 classid = rta_getattr_u32(tbTCA_U32_CLASSID); SPRINT_BUF(b1); - if (sel && (sel->flags & TC_U32_TERMINAL)) + if (!sel || !(sel->flags & TC_U32_TERMINAL)) print_string(PRINT_FP, NULL, "*", NULL); print_string(PRINT_ANY, "flowid", "flowid %s ",
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/m_action.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/m_action.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * m_action.c Action Management * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: J Hadi Salim (hadi@cyberus.ca) * * TODO: @@ -87,7 +83,7 @@ return -1; } -static struct action_util *get_action_kind(char *str) +static struct action_util *get_action_kind(const char *str) { static void *aBODY; void *dlh; @@ -127,7 +123,7 @@ #ifdef CONFIG_GACT if (!looked4gact) { looked4gact = 1; - strcpy(str, "gact"); + str = "gact"; goto restart_s; } #endif @@ -590,6 +586,13 @@ open_json_object(NULL); tc_dump_action(fp, tbTCA_ACT_TAB, tot_acts ? *tot_acts:0, false); + + if (tbTCA_ROOT_EXT_WARN_MSG) { + print_string(PRINT_ANY, "warn", "%s", + rta_getattr_str(tbTCA_ROOT_EXT_WARN_MSG)); + print_nl(); + } + close_json_object(); return 0;
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/m_bpf.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/m_bpf.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * m_bpf.c BPF based action module * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Jiri Pirko <jiri@resnulli.us> * Daniel Borkmann <daniel@iogearbox.net> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/m_connmark.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/m_connmark.c
Changed
@@ -1,19 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * m_connmark.c Connection tracking marking import * * Copyright (c) 2011 Felix Fietkau <nbd@openwrt.org> - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, see <http://www.gnu.org/licenses>. */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/m_csum.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/m_csum.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * m_csum.c checksum updating action * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Gregoire Baron <baronchon@n7mm.org> */ @@ -98,7 +94,9 @@ while (argc > 0) { if (matches(*argv, "csum") == 0) { NEXT_ARG(); - if (parse_csum_args(&argc, &argv, &sel)) { + if (strcmp(*argv, "index") == 0) { + goto skip_args; + } else if (parse_csum_args(&argc, &argv, &sel)) { fprintf(stderr, "Illegal csum construct (%s)\n", *argv); explain(); @@ -127,6 +125,7 @@ if (argc) { if (matches(*argv, "index") == 0) { +skip_args: NEXT_ARG(); if (get_u32(&sel.index, *argv, 10)) { fprintf(stderr, "Illegal \"index\" (%s) <csum>\n",
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/m_ct.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/m_ct.c
Changed
@@ -13,6 +13,7 @@ #include <string.h> #include "utils.h" #include "tc_util.h" +#include "rt_names.h" #include <linux/tc_act/tc_ct.h> static void @@ -20,10 +21,11 @@ { fprintf(stderr, "Usage: ct clear\n" - " ct commit force zone ZONE mark MASKED_MARK label MASKED_LABEL nat NAT_SPEC\n" + " ct commit force zone ZONE mark MASKED_MARK label MASKED_LABEL nat NAT_SPEC helper HELPER\n" " ct nat zone ZONE\n" "Where: ZONE is the conntrack zone table number\n" " NAT_SPEC is {src|dst} addr addr1-addr2 port port1-port2\n" + " HELPER is family-proto-name such as ipv4-tcp-ftp\n" "\n"); exit(-1); } @@ -156,6 +158,30 @@ return ct_parse_u32(str, TCA_CT_MARK, TCA_CT_MARK_MASK, n); } +static int ct_parse_helper(char *str, struct nlmsghdr *n) +{ + char f32, p32, name32; + __u8 family, proto; + + if (strlen(str) >= 32 || + sscanf(str, "%^--%^--%^-", f, p, name) != 3) + return -1; + if (!strcmp(f, "ipv4")) + family = AF_INET; + else if (!strcmp(f, "ipv6")) + family = AF_INET6; + else + return -1; + proto = inet_proto_a2n(p); + if (proto < 0) + return -1; + + addattr8(n, MAX_MSG, TCA_CT_HELPER_FAMILY, family); + addattr8(n, MAX_MSG, TCA_CT_HELPER_PROTO, proto); + addattrstrz(n, MAX_MSG, TCA_CT_HELPER_NAME, name); + return 0; +} + static int ct_parse_labels(char *str, struct nlmsghdr *n) { #define LABELS_SIZE 16 @@ -283,6 +309,14 @@ } } else if (matches(*argv, "help") == 0) { usage(); + } else if (matches(*argv, "helper") == 0) { + NEXT_ARG(); + + ret = ct_parse_helper(*argv, n); + if (ret) { + fprintf(stderr, "ct: Illegal \"helper\"\n"); + return -1; + } } else { break; } @@ -436,6 +470,22 @@ print_string(PRINT_ANY, "label", " label %s", out); } +static void ct_print_helper(struct rtattr *family, struct rtattr *proto, struct rtattr *name) +{ + char helper32, buf32, *n; + int *f, *p; + + if (!family || !proto || !name) + return; + + f = RTA_DATA(family); + p = RTA_DATA(proto); + n = RTA_DATA(name); + snprintf(helper, sizeof(helper), "%s-%s-%s", (*f == AF_INET) ? "ipv4" : "ipv6", + inet_proto_n2a(*p, buf, sizeof(buf)), n); + print_string(PRINT_ANY, "helper", " helper %s", helper); +} + static int print_ct(struct action_util *au, FILE *f, struct rtattr *arg) { struct rtattr *tbTCA_CT_MAX + 1; @@ -468,6 +518,7 @@ print_masked_u32("mark", tbTCA_CT_MARK, tbTCA_CT_MARK_MASK, false); print_masked_u16("zone", tbTCA_CT_ZONE, NULL, false); ct_print_labels(tbTCA_CT_LABELS, tbTCA_CT_LABELS_MASK); + ct_print_helper(tbTCA_CT_HELPER_FAMILY, tbTCA_CT_HELPER_PROTO, tbTCA_CT_HELPER_NAME); ct_print_nat(ct_action, tb); print_action_control(f, " ", p->action, "");
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/m_ematch.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/m_ematch.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * m_ematch.c Extended Matches * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/m_estimator.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/m_estimator.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * m_estimator.c Parse/print estimator module options. * - * This program is free software; you can u32istribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/m_gact.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/m_gact.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * m_gact.c generic actions module * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: J Hadi Salim (hadi@cyberus.ca) - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/m_ife.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/m_ife.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * m_ife.c IFE actions module * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: J Hadi Salim (jhs@mojatatu.com) - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/m_ipt.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/m_ipt.c
Changed
@@ -1,12 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * m_ipt.c iptables based targets * utilities mostly ripped from iptables <duh, its the linux way> * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: J Hadi Salim (hadi@cyberus.ca) */ @@ -416,8 +412,7 @@ m->tflags = 0; m->used = 0; /* Free allocated memory */ - if (m->t) - free(m->t); + free(m->t); return 0;
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/m_mirred.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/m_mirred.c
Changed
@@ -1,15 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * m_egress.c ingress/egress packet mirror/redir actions module * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: J Hadi Salim (hadi@cyberus.ca) * * TODO: Add Ingress support - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/m_mpls.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/m_mpls.c
Changed
@@ -91,6 +91,9 @@ NEXT_ARG(); + if (strcmp(*argv, "index") == 0) + goto skip_args; + while (argc > 0) { if (matches(*argv, "pop") == 0) { if (check_double_action(action, *argv)) @@ -164,6 +167,7 @@ if (argc) { if (matches(*argv, "index") == 0) { +skip_args: NEXT_ARG(); if (get_u32(&parm.index, *argv, 10)) invarg("illegal index", *argv);
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/m_nat.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/m_nat.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * m_nat.c NAT module * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Herbert Xu <herbert@gondor.apana.org.au> - * */ #include <stdio.h> @@ -93,7 +88,9 @@ while (argc > 0) { if (matches(*argv, "nat") == 0) { NEXT_ARG(); - if (parse_nat_args(&argc, &argv, &sel)) { + if (strcmp(*argv, "index") == 0) { + goto skip_args; + } else if (parse_nat_args(&argc, &argv, &sel)) { fprintf(stderr, "Illegal nat construct (%s)\n", *argv); explain(); @@ -118,6 +115,7 @@ if (argc) { if (matches(*argv, "index") == 0) { +skip_args: NEXT_ARG(); if (get_u32(&sel.index, *argv, 10)) { fprintf(stderr, "Nat: Illegal \"index\"\n");
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/m_pedit.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/m_pedit.c
Changed
@@ -1,18 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * m_pedit.c generic packet editor actions module * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: J Hadi Salim (hadi@cyberus.ca) * * TODO: * 1) Big endian broken in some spots * 2) A lot of this stuff was added on the fly; get a big double-double * and clean it up at some point. - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/m_pedit.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/m_pedit.h
Changed
@@ -1,10 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * m_pedit.h generic packet editor actions module * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. * * Authors: J Hadi Salim (hadi@cyberus.ca) *
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/m_police.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/m_police.c
Changed
@@ -1,16 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * m_police.c Parse/print policing module options. * - * This program is free software; you can u32istribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * FIXES: 19990619 - J Hadi Salim (hadi@cyberus.ca) - * simple addattr packaging fix. - * 2002: J Hadi Salim - Add tc action extensions syntax - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/m_sample.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/m_sample.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * m_sample.c ingress/egress packet sampling module * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Yotam Gigi <yotamg@mellanox.com> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/m_simple.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/m_simple.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * m_simple.c simple action * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: J Hadi Salim <jhs@mojatatu.com> * * Pedagogical example. Adds a string that will be printed every time
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/m_skbedit.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/m_skbedit.c
Changed
@@ -1,22 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * m_skbedit.c SKB Editing module * * Copyright (c) 2008, Intel Corporation. * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see <http://www.gnu.org/licenses>. - * * Authors: Alexander Duyck <alexander.h.duyck@intel.com> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/m_skbmod.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/m_skbmod.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * m_skbmod.c skb modifier action module * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: J Hadi Salim (jhs@mojatatu.com) - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/m_tunnel_key.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/m_tunnel_key.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * m_tunnel_key.c ip tunnel manipulation module * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Amir Vadai <amir@vadai.me> */ @@ -30,7 +26,8 @@ "dst_ip <IP> (mandatory)\n" "dst_port <UDP_PORT>\n" "geneve_opts | vxlan_opts | erspan_opts <OPTIONS>\n" - "csum | nocsum (default is \"csum\")\n"); + "csum | nocsum (default is \"csum\")\n" + "nofrag\n"); } static void usage(void) @@ -325,7 +322,7 @@ int ret; int has_src_ip = 0; int has_dst_ip = 0; - int csum = 1; + int csum = 1, nofrag = 0; if (matches(*argv, "tunnel_key") != 0) return -1; @@ -429,6 +426,8 @@ csum = 1; } else if (matches(*argv, "nocsum") == 0) { csum = 0; + } else if (strcmp(*argv, "nofrag") == 0) { + nofrag = 1; } else if (matches(*argv, "help") == 0) { usage(); } else { @@ -439,6 +438,9 @@ addattr8(n, MAX_MSG, TCA_TUNNEL_KEY_NO_CSUM, !csum); + if (nofrag) + addattr(n, MAX_MSG, TCA_TUNNEL_KEY_NO_FRAG); + parse_action_control_dflt(&argc, &argv, &parm.action, false, TC_ACT_PIPE); @@ -517,15 +519,36 @@ rta_getattr_be16(attr)); } -static void tunnel_key_print_flag(FILE *f, const char *name_on, - const char *name_off, - struct rtattr *attr) +static const struct { + const char *name; + unsigned int nl_flag; +} tunnel_key_flag_names = { + { "", TCA_TUNNEL_KEY_NO_CSUM }, /* special handling, not bool */ + { "nofrag", TCA_TUNNEL_KEY_NO_FRAG }, +}; + +static void tunnel_key_print_flags(struct rtattr *tb) { - if (!attr) - return; + unsigned int i, nl_flag; + print_nl(); - print_string(PRINT_ANY, "flag", "\t%s", - rta_getattr_u8(attr) ? name_on : name_off); + for (i = 0; i < ARRAY_SIZE(tunnel_key_flag_names); i++) { + nl_flag = tunnel_key_flag_namesi.nl_flag; + if (nl_flag == TCA_TUNNEL_KEY_NO_CSUM) { + /* special handling to preserve csum/nocsum design */ + if (!tbnl_flag) + continue; + print_string(PRINT_ANY, "flag", "\t%s", + rta_getattr_u8(tbnl_flag) ? + "nocsum" : "csum" ); + } else { + if (tbnl_flag) + print_string(PRINT_FP, NULL, "\t%s", + tunnel_key_flag_namesi.name); + print_bool(PRINT_JSON, tunnel_key_flag_namesi.name, + NULL, !!tbnl_flag); + } + } } static void tunnel_key_print_geneve_options(struct rtattr *attr) @@ -701,8 +724,7 @@ tunnel_key_print_dst_port(f, "dst_port", tbTCA_TUNNEL_KEY_ENC_DST_PORT); tunnel_key_print_key_opt(tbTCA_TUNNEL_KEY_ENC_OPTS); - tunnel_key_print_flag(f, "nocsum", "csum", - tbTCA_TUNNEL_KEY_NO_CSUM); + tunnel_key_print_flags(tb); tunnel_key_print_tos_ttl(f, "tos", tbTCA_TUNNEL_KEY_ENC_TOS); tunnel_key_print_tos_ttl(f, "ttl",
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/m_vlan.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/m_vlan.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * m_vlan.c vlan manipulation module * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Jiri Pirko <jiri@resnulli.us> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/m_xt.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/m_xt.c
Changed
@@ -1,12 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * m_xt.c xtables based targets * utilities mostly ripped from iptables <duh, its the linux way> * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: J Hadi Salim (hadi@cyberus.ca) */ @@ -303,8 +299,7 @@ m->tflags = 0; m->used = 0; /* Free allocated memory */ - if (m->t) - free(m->t); + free(m->t); } return 0;
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/m_xt_old.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/m_xt_old.c
Changed
@@ -1,12 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * m_xt.c xtables based targets * utilities mostly ripped from iptables <duh, its the linux way> * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: J Hadi Salim (hadi@cyberus.ca) */ @@ -341,8 +337,7 @@ m->tflags = 0; m->used = 0; /* Free allocated memory */ - if (m->t) - free(m->t); + free(m->t); return 0;
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/p_eth.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/p_eth.c
Changed
@@ -1,13 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * m_pedit_eth.c packet editor: ETH header * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. * * Authors: Amir Vadai (amir@vadai.me) - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/p_icmp.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/p_icmp.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * m_pedit_icmp.c packet editor: ICMP header * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: J Hadi Salim (hadi@cyberus.ca) - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/p_ip.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/p_ip.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * p_ip.c packet editor: IPV4 header * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: J Hadi Salim (hadi@cyberus.ca) - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/p_ip6.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/p_ip6.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * p_ip6.c packet editor: IPV6 header * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Amir Vadai <amir@vadai.me> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/p_tcp.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/p_tcp.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * m_pedit_tcp.c packet editor: TCP header * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: J Hadi Salim (hadi@cyberus.ca) - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/p_udp.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/p_udp.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * m_pedit_udp.c packet editor: UDP header * - * This program is free software; you can distribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: J Hadi Salim (hadi@cyberus.ca) - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_atm.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/q_atm.c
Changed
@@ -3,7 +3,6 @@ * q_atm.c ATM. * * Hacked 1998-2000 by Werner Almesberger, EPFL ICA - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_cbq.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/q_cbq.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * q_cbq.c CBQ. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_cbs.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/q_cbs.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * q_cbs.c CBS. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Vinicius Costa Gomes <vinicius.gomes@intel.com> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_choke.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/q_choke.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * q_choke.c CHOKE. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Stephen Hemminger <shemminger@vyatta.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_codel.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/q_codel.c
Changed
@@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause /* * Codel - The Controlled-Delay Active Queue Management algorithm * @@ -5,37 +6,6 @@ * Copyright (C) 2011-2012 Van Jacobson <van@pollere.com> * Copyright (C) 2012 Michael D. Taht <dave.taht@bufferbloat.net> * Copyright (C) 2012,2015 Eric Dumazet <edumazet@google.com> - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The names of the authors may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * Alternatively, provided that this notice is retained in full, this - * software may be distributed under the terms of the GNU General - * Public License ("GPL") version 2, in which case the provisions of the - * GPL apply INSTEAD OF those given above. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_drr.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/q_drr.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * q_drr.c DRR. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Patrick McHardy <kaber@trash.net> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_dsmark.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/q_dsmark.c
Changed
@@ -3,7 +3,6 @@ * q_dsmark.c Differentiated Services field marking. * * Hacked 1998,1999 by Werner Almesberger, EPFL ICA - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_etf.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/q_etf.c
Changed
@@ -1,14 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * q_etf.c Earliest TxTime First (ETF). * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Vinicius Costa Gomes <vinicius.gomes@intel.com> * Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_fifo.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/q_fifo.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * q_fifo.c FIFO. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_fq.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/q_fq.c
Changed
@@ -1,38 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause /* * Fair Queue * * Copyright (C) 2013-2015 Eric Dumazet <edumazet@google.com> - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The names of the authors may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * Alternatively, provided that this notice is retained in full, this - * software may be distributed under the terms of the GNU General - * Public License ("GPL") version 2, in which case the provisions of the - * GPL apply INSTEAD OF those given above. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_fq_codel.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/q_fq_codel.c
Changed
@@ -1,38 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause /* * Fair Queue Codel * * Copyright (C) 2012,2015 Eric Dumazet <edumazet@google.com> - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The names of the authors may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * Alternatively, provided that this notice is retained in full, this - * software may be distributed under the terms of the GNU General - * Public License ("GPL") version 2, in which case the provisions of the - * GPL apply INSTEAD OF those given above. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_gred.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/q_gred.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * q_gred.c GRED. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: J Hadi Salim(hadi@nortelnetworks.com) * code ruthlessly ripped from * Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_hfsc.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/q_hfsc.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * q_hfsc.c HFSC. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Patrick McHardy, <kaber@trash.net> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_htb.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/q_htb.c
Changed
@@ -1,13 +1,7 @@ -/* - * q_htb.c HTB. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * - * Authors: Martin Devera, devik@cdi.cz +/* SPDX-License-Identifier: GPL-2.0 */ +/* q_htb.c Hierarchical Token Bucket * + * Author: Martin Devera, devik@cdi.cz */ #include <stdio.h> @@ -113,7 +107,8 @@ return 0; } -static int htb_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n, const char *dev) +static int htb_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, + struct nlmsghdr *n, const char *dev) { struct tc_htb_opt opt = {}; __u32 rtab256, ctab256; @@ -307,27 +302,28 @@ RTA_PAYLOAD(tbTCA_HTB_CEIL64) >= sizeof(ceil64)) ceil64 = rta_getattr_u64(tbTCA_HTB_CEIL64); - tc_print_rate(PRINT_FP, NULL, "rate %s ", rate64); + tc_print_rate(PRINT_ANY, "rate", "rate %s ", rate64); if (hopt->rate.overhead) - fprintf(f, "overhead %u ", hopt->rate.overhead); + print_uint(PRINT_ANY, "overhead", "overhead %u ", hopt->rate.overhead); buffer = tc_calc_xmitsize(rate64, hopt->buffer); - tc_print_rate(PRINT_FP, NULL, "ceil %s ", ceil64); + tc_print_rate(PRINT_ANY, "ceil", "ceil %s ", ceil64); cbuffer = tc_calc_xmitsize(ceil64, hopt->cbuffer); linklayer = (hopt->rate.linklayer & TC_LINKLAYER_MASK); if (linklayer > TC_LINKLAYER_ETHERNET || show_details) - fprintf(f, "linklayer %s ", sprint_linklayer(linklayer, b3)); + print_string(PRINT_ANY, "linklayer", "linklayer %s ", + sprint_linklayer(linklayer, b3)); if (show_details) { - print_size(PRINT_FP, NULL, "burst %s/", buffer); - fprintf(f, "%u ", 1<<hopt->rate.cell_log); - print_size(PRINT_FP, NULL, "mpu %s ", hopt->rate.mpu); - print_size(PRINT_FP, NULL, "cburst %s/", cbuffer); - fprintf(f, "%u ", 1<<hopt->ceil.cell_log); - print_size(PRINT_FP, NULL, "mpu %s ", hopt->ceil.mpu); - fprintf(f, "level %d ", (int)hopt->level); + print_size(PRINT_ANY, "burst", "burst %s/", buffer); + print_uint(PRINT_ANY, "burst_cell", "%u", 1<<hopt->rate.cell_log); + print_size(PRINT_ANY, "mpu_rate", "mpu %s ", hopt->rate.mpu); + print_size(PRINT_ANY, "cburst", "cburst %s/", cbuffer); + print_uint(PRINT_ANY, "cburst_cell", "%u", 1<<hopt->ceil.cell_log); + print_size(PRINT_ANY, "mpu_ceil", "mpu %s ", hopt->ceil.mpu); + print_int(PRINT_ANY, "level", "level %d ", (int)hopt->level); } else { - print_size(PRINT_FP, NULL, "burst %s ", buffer); - print_size(PRINT_FP, NULL, "cburst %s ", cbuffer); + print_size(PRINT_ANY, "burst", "burst %s ", buffer); + print_size(PRINT_ANY, "cburst", "cburst %s", cbuffer); } if (show_raw) fprintf(f, "buffer %08x cbuffer %08x ", @@ -369,9 +365,13 @@ return -1; st = RTA_DATA(xstats); - fprintf(f, " lended: %u borrowed: %u giants: %u\n", - st->lends, st->borrows, st->giants); - fprintf(f, " tokens: %d ctokens: %d\n", st->tokens, st->ctokens); + print_uint(PRINT_ANY, "lended", " lended: %u ", st->lends); + print_uint(PRINT_ANY, "borrowed", "borrowed: %u ", st->borrows); + print_uint(PRINT_ANY, "giants", "giants: %u", st->giants); + print_nl(); + print_int(PRINT_ANY, "tokens", " tokens: %d ", st->tokens); + print_int(PRINT_ANY, "ctokens", "ctokens: %d", st->ctokens); + print_nl(); return 0; }
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_ingress.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/q_ingress.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * q_ingress.c INGRESS. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: J Hadi Salim */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_mqprio.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/q_mqprio.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * q_mqprio.c MQ prio qdisc * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Author: John Fastabend, <john.r.fastabend@intel.com> */ @@ -27,12 +23,29 @@ "Usage: ... mqprio num_tc NUMBER map P0 P1 ...\n" " queues count1@offset1 count2@offset2 ... " "hw 1|0\n" + " fp FP0 FP1 FP2 ...\n" " mode dcb|channel\n" " shaper bw_rlimit SHAPER_PARAMS\n" "Where: SHAPER_PARAMS := { min_rate MIN_RATE1 MIN_RATE2 ...|\n" " max_rate MAX_RATE1 MAX_RATE2 ... }\n"); } +static void add_tc_entries(struct nlmsghdr *n, __u32 fpTC_QOPT_MAX_QUEUE, + int num_fp_entries) +{ + struct rtattr *l; + __u32 tc; + + for (tc = 0; tc < num_fp_entries; tc++) { + l = addattr_nest(n, 1024, TCA_MQPRIO_TC_ENTRY | NLA_F_NESTED); + + addattr32(n, 1024, TCA_MQPRIO_TC_ENTRY_INDEX, tc); + addattr32(n, 1024, TCA_MQPRIO_TC_ENTRY_FP, fptc); + + addattr_nest_end(n, l); + } +} + static int mqprio_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n, const char *dev) { @@ -47,7 +60,10 @@ __u64 min_rate64TC_QOPT_MAX_QUEUE = {0}; __u64 max_rate64TC_QOPT_MAX_QUEUE = {0}; __u16 shaper = TC_MQPRIO_SHAPER_DCB; + __u32 fpTC_QOPT_MAX_QUEUE = { }; __u16 mode = TC_MQPRIO_MODE_DCB; + bool have_tc_entries = false; + int num_fp_entries = 0; int cnt_off_pairs = 0; struct rtattr *tail; __u32 flags = 0; @@ -97,6 +113,21 @@ idx++; cnt_off_pairs++; } + } else if (strcmp(*argv, "fp") == 0) { + while (idx < TC_QOPT_MAX_QUEUE && NEXT_ARG_OK()) { + NEXT_ARG(); + if (strcmp(*argv, "E") == 0) { + fpidx = TC_FP_EXPRESS; + } else if (strcmp(*argv, "P") == 0) { + fpidx = TC_FP_PREEMPTIBLE; + } else { + PREV_ARG(); + break; + } + num_fp_entries++; + idx++; + } + have_tc_entries = true; } else if (strcmp(*argv, "hw") == 0) { NEXT_ARG(); if (get_u8(&opt.hw, *argv, 10)) { @@ -191,6 +222,9 @@ addattr_l(n, 1024, TCA_MQPRIO_SHAPER, &shaper, sizeof(shaper)); + if (have_tc_entries) + add_tc_entries(n, fp, num_fp_entries); + if (flags & TC_MQPRIO_F_MIN_RATE) { struct rtattr *start; @@ -222,6 +256,64 @@ return 0; } +static void dump_tc_entry(struct rtattr *rta, __u32 fpTC_QOPT_MAX_QUEUE, + int *max_tc_fp) +{ + struct rtattr *tbTCA_MQPRIO_TC_ENTRY_MAX + 1; + __u32 tc, val = 0; + + parse_rtattr_nested(tb, TCA_MQPRIO_TC_ENTRY_MAX, rta); + + if (!tbTCA_MQPRIO_TC_ENTRY_INDEX) { + fprintf(stderr, "Missing tc entry index\n"); + return; + } + + tc = rta_getattr_u32(tbTCA_MQPRIO_TC_ENTRY_INDEX); + /* Prevent array out of bounds access */ + if (tc >= TC_QOPT_MAX_QUEUE) { + fprintf(stderr, "Unexpected tc entry index %d\n", tc); + return; + } + + if (tbTCA_MQPRIO_TC_ENTRY_FP) { + val = rta_getattr_u32(tbTCA_MQPRIO_TC_ENTRY_FP); + fptc = val; + + if (*max_tc_fp < (int)tc) + *max_tc_fp = tc; + } +} + +static void dump_tc_entries(FILE *f, struct rtattr *opt, int len) +{ + __u32 fpTC_QOPT_MAX_QUEUE = {}; + int max_tc_fp = -1; + struct rtattr *rta; + int tc; + + for (rta = opt; RTA_OK(rta, len); rta = RTA_NEXT(rta, len)) { + if (rta->rta_type != (TCA_MQPRIO_TC_ENTRY | NLA_F_NESTED)) + continue; + + dump_tc_entry(rta, fp, &max_tc_fp); + } + + if (max_tc_fp >= 0) { + open_json_array(PRINT_ANY, + is_json_context() ? "fp" : "\n fp:"); + for (tc = 0; tc <= max_tc_fp; tc++) { + print_string(PRINT_ANY, NULL, " %s", + fptc == TC_FP_PREEMPTIBLE ? "P" : + fptc == TC_FP_EXPRESS ? "E" : + "?"); + } + close_json_array(PRINT_ANY, ""); + + print_nl(); + } +} + static int mqprio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt) { int i; @@ -313,7 +405,10 @@ tc_print_rate(PRINT_ANY, NULL, "%s ", max_rate64i); close_json_array(PRINT_ANY, ""); } + + dump_tc_entries(f, RTA_DATA(opt) + RTA_ALIGN(sizeof(*qopt)), len); } + return 0; }
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_multiq.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/q_multiq.c
Changed
@@ -1,20 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * q_multiq.c Multiqueue aware qdisc * * Copyright (c) 2008, Intel Corporation. * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see <http://www.gnu.org/licenses>. - * * Author: Alexander Duyck <alexander.h.duyck@intel.com> * * Original Authors: PJ Waskiewicz, <peter.p.waskiewicz.jr@intel.com> (RR)
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_netem.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/q_netem.c
Changed
@@ -417,6 +417,9 @@ } else if (matches(*argv, "distribution") == 0) { NEXT_ARG(); dist_data = calloc(sizeof(dist_data0), MAX_DIST); + if (dist_data == NULL) + return -1; + dist_size = get_distribution(*argv, dist_data, MAX_DIST); if (dist_size <= 0) { free(dist_data);
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_pie.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/q_pie.c
Changed
@@ -1,18 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* Copyright (C) 2013 Cisco Systems, Inc, 2013. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * * Author: Vijay Subramanian <vijaynsu@cisco.com> * Author: Mythili Prabhu <mysuryan@cisco.com> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_prio.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/q_prio.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * q_prio.c PRIO. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h> @@ -106,6 +101,8 @@ if (parse_rtattr_nested_compat(tb, TCA_PRIO_MAX, opt, qopt, sizeof(*qopt))) return -1; + if (qopt == NULL) + return -1; /* missing data from kernel */ print_uint(PRINT_ANY, "bands", "bands %u ", qopt->bands); open_json_array(PRINT_ANY, "priomap");
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_qfq.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/q_qfq.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * q_qfq.c QFQ. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Stephen Hemminger <shemminger@vyatta.com> * Fabio Checconi <fabio@gandalf.sssup.it> *
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_red.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/q_red.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * q_red.c RED. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_sfb.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/q_sfb.c
Changed
@@ -1,17 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * q_sfb.c Stochastic Fair Blue. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Juliusz Chroboczek <jch@pps.jussieu.fr> - * */ - - #include <stdio.h> #include <stdlib.h> #include <unistd.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_sfq.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/q_sfq.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * q_sfq.c SFQ. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_skbprio.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/q_skbprio.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * q_skbprio.c SKB PRIORITY QUEUE. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Nishanth Devarajan, <ndev2021@gmail.com> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_taprio.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/q_taprio.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * q_taprio.c Time Aware Priority Scheduler * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Vinicius Costa Gomes <vinicius.gomes@intel.com> * Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com> */ @@ -49,10 +45,11 @@ { fprintf(stderr, "Usage: ... taprio clockid CLOCKID\n" - " num_tc NUMBER map P0 P1 ... " - " queues COUNT@OFFSET COUNT@OFFSET COUNT@OFFSET ... " - " sched-entry index cmd gate-mask interval ... " - " base-time time txtime-delay delay" + " num_tc NUMBER map P0 P1 ...\n" + " queues COUNT@OFFSET COUNT@OFFSET COUNT@OFFSET ...\n" + " sched-entry index cmd gate-mask interval ... \n" + " base-time time txtime-delay delay\n" + " fp FP0 FP1 FP2 ...\n" "\n" "CLOCKID must be a valid SYS-V id (i.e. CLOCK_TAI)\n"); } @@ -151,14 +148,48 @@ return e; } +static void add_tc_entries(struct nlmsghdr *n, __u32 max_sduTC_QOPT_MAX_QUEUE, + int num_max_sdu_entries, __u32 fpTC_QOPT_MAX_QUEUE, + int num_fp_entries) +{ + struct rtattr *l; + int num_tc; + __u32 tc; + + num_tc = max(num_max_sdu_entries, num_fp_entries); + + for (tc = 0; tc < num_tc; tc++) { + l = addattr_nest(n, 1024, TCA_TAPRIO_ATTR_TC_ENTRY | NLA_F_NESTED); + + addattr_l(n, 1024, TCA_TAPRIO_TC_ENTRY_INDEX, &tc, sizeof(tc)); + + if (tc < num_max_sdu_entries) { + addattr_l(n, 1024, TCA_TAPRIO_TC_ENTRY_MAX_SDU, + &max_sdutc, sizeof(max_sdutc)); + } + + if (tc < num_fp_entries) { + addattr_l(n, 1024, TCA_TAPRIO_TC_ENTRY_FP, &fptc, + sizeof(fptc)); + } + + addattr_nest_end(n, l); + } +} + static int taprio_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n, const char *dev) { + __u32 max_sduTC_QOPT_MAX_QUEUE = { }; + __u32 fpTC_QOPT_MAX_QUEUE = { }; __s32 clockid = CLOCKID_INVALID; struct tc_mqprio_qopt opt = { }; __s64 cycle_time_extension = 0; struct list_head sched_entries; + bool have_tc_entries = false; + int num_max_sdu_entries = 0; struct rtattr *tail, *l; + int num_fp_entries = 0; __u32 taprio_flags = 0; __u32 txtime_delay = 0; __s64 cycle_time = 0; @@ -211,6 +242,34 @@ free(tmp); idx++; } + } else if (strcmp(*argv, "fp") == 0) { + while (idx < TC_QOPT_MAX_QUEUE && NEXT_ARG_OK()) { + NEXT_ARG(); + if (strcmp(*argv, "E") == 0) { + fpidx = TC_FP_EXPRESS; + } else if (strcmp(*argv, "P") == 0) { + fpidx = TC_FP_PREEMPTIBLE; + } else { + fprintf(stderr, + "Illegal \"fp\" value \"%s\", expected \"E\" or \"P\"\n", + *argv); + return -1; + } + num_fp_entries++; + idx++; + } + have_tc_entries = true; + } else if (strcmp(*argv, "max-sdu") == 0) { + while (idx < TC_QOPT_MAX_QUEUE && NEXT_ARG_OK()) { + NEXT_ARG(); + if (get_u32(&max_sduidx, *argv, 10)) { + PREV_ARG(); + break; + } + num_max_sdu_entries++; + idx++; + } + have_tc_entries = true; } else if (strcmp(*argv, "sched-entry") == 0) { uint32_t mask, interval; struct sched_entry *e; @@ -341,6 +400,9 @@ addattr_l(n, 1024, TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME_EXTENSION, &cycle_time_extension, sizeof(cycle_time_extension)); + if (have_tc_entries) + add_tc_entries(n, max_sdu, num_max_sdu_entries, fp, num_fp_entries); + l = addattr_nest(n, 1024, TCA_TAPRIO_ATTR_SCHED_ENTRY_LIST | NLA_F_NESTED); err = add_sched_list(&sched_entries, n); @@ -430,11 +492,89 @@ return 0; } +static void dump_tc_entry(struct rtattr *item, + __u32 max_sduTC_QOPT_MAX_QUEUE, + __u32 fpTC_QOPT_MAX_QUEUE, + int *max_tc_max_sdu, int *max_tc_fp) +{ + struct rtattr *tbTCA_TAPRIO_TC_ENTRY_MAX + 1; + __u32 tc, val = 0; + + parse_rtattr_nested(tb, TCA_TAPRIO_TC_ENTRY_MAX, item); + + if (!tbTCA_TAPRIO_TC_ENTRY_INDEX) { + fprintf(stderr, "Missing tc entry index\n"); + return; + } + + tc = rta_getattr_u32(tbTCA_TAPRIO_TC_ENTRY_INDEX); + /* Prevent array out of bounds access */ + if (tc >= TC_QOPT_MAX_QUEUE) { + fprintf(stderr, "Unexpected tc entry index %d\n", tc); + return; + } + + if (tbTCA_TAPRIO_TC_ENTRY_MAX_SDU) { + val = rta_getattr_u32(tbTCA_TAPRIO_TC_ENTRY_MAX_SDU); + max_sdutc = val; + if (*max_tc_max_sdu < (int)tc) + *max_tc_max_sdu = tc; + } + + if (tbTCA_TAPRIO_TC_ENTRY_FP) { + val = rta_getattr_u32(tbTCA_TAPRIO_TC_ENTRY_FP); + fptc = val; + + if (*max_tc_fp < (int)tc) + *max_tc_fp = tc; + } +} + +static void dump_tc_entries(FILE *f, struct rtattr *opt) +{ + __u32 max_sduTC_QOPT_MAX_QUEUE = {}; + __u32 fpTC_QOPT_MAX_QUEUE = {}; + int max_tc_max_sdu = -1; + int max_tc_fp = -1; + struct rtattr *i; + int tc, rem; + + rem = RTA_PAYLOAD(opt); + + for (i = RTA_DATA(opt); RTA_OK(i, rem); i = RTA_NEXT(i, rem)) { + if (i->rta_type != (TCA_TAPRIO_ATTR_TC_ENTRY | NLA_F_NESTED)) + continue; + + dump_tc_entry(i, max_sdu, fp, &max_tc_max_sdu, &max_tc_fp); + } + + if (max_tc_max_sdu >= 0) { + open_json_array(PRINT_ANY, "max-sdu"); + for (tc = 0; tc <= max_tc_max_sdu; tc++) + print_uint(PRINT_ANY, NULL, " %u", max_sdutc); + close_json_array(PRINT_ANY, ""); + + print_nl(); + } + + if (max_tc_fp >= 0) { + open_json_array(PRINT_ANY, "fp"); + for (tc = 0; tc <= max_tc_fp; tc++) { + print_string(PRINT_ANY, NULL, " %s", + fptc == TC_FP_PREEMPTIBLE ? "P" : + fptc == TC_FP_EXPRESS ? "E" : + "?"); + } + close_json_array(PRINT_ANY, ""); + + print_nl(); + } +} + static int taprio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt) { struct rtattr *tbTCA_TAPRIO_ATTR_MAX + 1; struct tc_mqprio_qopt *qopt = 0; - __s32 clockid = CLOCKID_INVALID; int i; if (opt == NULL) @@ -467,10 +607,13 @@ print_nl(); - if (tbTCA_TAPRIO_ATTR_SCHED_CLOCKID) - clockid = rta_getattr_s32(tbTCA_TAPRIO_ATTR_SCHED_CLOCKID); + if (tbTCA_TAPRIO_ATTR_SCHED_CLOCKID) { + __s32 clockid; - print_string(PRINT_ANY, "clockid", "clockid %s", get_clock_name(clockid)); + clockid = rta_getattr_s32(tbTCA_TAPRIO_ATTR_SCHED_CLOCKID); + print_string(PRINT_ANY, "clockid", "clockid %s", + get_clock_name(clockid)); + } if (tbTCA_TAPRIO_ATTR_FLAGS) { __u32 flags; @@ -501,6 +644,8 @@ close_json_object(); } + dump_tc_entries(f, opt); + return 0; }
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/q_tbf.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/q_tbf.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * q_tbf.c TBF. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/tc.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/tc.c
Changed
@@ -1,16 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * tc.c "tc" utility frontend. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * - * Fixes: - * - * Petri Mattila <petri@prihateam.fi> 990308: wrong memset's resulted in faults */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/tc_cbq.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/tc_cbq.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * tc_cbq.c CBQ maintenance routines. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/tc_class.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/tc_class.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * tc_class.c "tc class". * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h> @@ -334,8 +329,9 @@ return -1; } + open_json_object(NULL); if (n->nlmsg_type == RTM_DELTCLASS) - fprintf(fp, "deleted "); + print_null(PRINT_ANY, "deleted", "deleted ", NULL); abuf0 = 0; if (t->tcm_handle) { @@ -344,22 +340,24 @@ else print_tc_classid(abuf, sizeof(abuf), t->tcm_handle); } - fprintf(fp, "class %s %s ", rta_getattr_str(tbTCA_KIND), abuf); + print_string(PRINT_ANY, "class", "class %s ", rta_getattr_str(tbTCA_KIND)); + print_string(PRINT_ANY, "handle", "%s ", abuf); if (filter_ifindex == 0) - fprintf(fp, "dev %s ", ll_index_to_name(t->tcm_ifindex)); + print_devname(PRINT_ANY, t->tcm_ifindex); if (t->tcm_parent == TC_H_ROOT) - fprintf(fp, "root "); + print_bool(PRINT_ANY, "root", "root ", true); else { if (filter_qdisc) print_tc_classid(abuf, sizeof(abuf), TC_H_MIN(t->tcm_parent)); else print_tc_classid(abuf, sizeof(abuf), t->tcm_parent); - fprintf(fp, "parent %s ", abuf); + print_string(PRINT_ANY, "parent", "parent %s ", abuf); } if (t->tcm_info) - fprintf(fp, "leaf %x: ", t->tcm_info>>16); + print_0xhex(PRINT_ANY, "leaf", "leaf %x: ", t->tcm_info>>16); + q = get_qdisc_kind(RTA_DATA(tbTCA_KIND)); if (tbTCA_OPTIONS) { if (q && q->print_copt) @@ -367,19 +365,21 @@ else fprintf(stderr, "cannot parse class parameters"); } - fprintf(fp, "\n"); + print_nl(); if (show_stats) { struct rtattr *xstats = NULL; - + open_json_object("stats"); if (tbTCA_STATS || tbTCA_STATS2) { print_tcstats_attr(fp, tb, " ", &xstats); - fprintf(fp, "\n"); + print_string(PRINT_FP, NULL, "\n", NULL); } if (q && (xstats || tbTCA_XSTATS) && q->print_xstats) { q->print_xstats(q, fp, xstats ? : tbTCA_XSTATS); - fprintf(fp, "\n"); + print_string(PRINT_FP, NULL, "\n", NULL); } + close_json_object(); } + close_json_object(); fflush(fp); return 0; } @@ -450,11 +450,13 @@ perror("Cannot send dump request"); return 1; } - + new_json_obj(json); if (rtnl_dump_filter(&rth, print_class, stdout) < 0) { fprintf(stderr, "Dump terminated\n"); + delete_json_obj(); return 1; } + delete_json_obj(); if (show_graph) graph_cls_show(stdout, &buf0, &root_cls_list, 0);
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/tc_core.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/tc_core.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * tc_core.c TC core library. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/tc_estimator.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/tc_estimator.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * tc_core.c TC core library. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/tc_exec.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/tc_exec.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * tc_exec.c "tc exec". * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Daniel Borkmann <daniel@iogearbox.net> */ @@ -100,6 +96,10 @@ strncpy(kind, *argv, sizeof(kind) - 1); eu = get_exec_kind(kind); + if (eu == NULL) { + fprintf(stderr, "Allocation failed finding exec\n"); + return -1; + } argc--; argv++;
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/tc_filter.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/tc_filter.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * tc_filter.c "tc filter". * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h> @@ -75,7 +70,7 @@ __u32 protocol = 0; int protocol_set = 0; __u32 block_index = 0; - __u32 chain_index; + __u32 chain_index = 0; int chain_index_set = 0; char *fhandle = NULL; char dIFNAMSIZ = {}; @@ -371,6 +366,7 @@ print_nl(); } + print_ext_msg(tb); close_json_object(); fflush(fp); return 0; @@ -598,7 +594,6 @@ char dIFNAMSIZ = {}; __u32 prio = 0; __u32 protocol = 0; - __u32 chain_index; __u32 block_index = 0; char *fhandle = NULL; @@ -680,6 +675,8 @@ protocol = res; filter_protocol = protocol; } else if (matches(*argv, "chain") == 0) { + __u32 chain_index; + NEXT_ARG(); if (filter_chain_index_set) duparg("chain", *argv); @@ -719,7 +716,7 @@ } if (filter_chain_index_set) - addattr32(&req.n, sizeof(req), TCA_CHAIN, chain_index); + addattr32(&req.n, sizeof(req), TCA_CHAIN, filter_chain_index); if (brief) { struct nla_bitfield32 flags = { @@ -738,6 +735,7 @@ new_json_obj(json); if (rtnl_dump_filter(&rth, print_filter, stdout) < 0) { fprintf(stderr, "Dump terminated\n"); + delete_json_obj(); return 1; } delete_json_obj();
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/tc_monitor.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/tc_monitor.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * tc_monitor.c "tc monitor". * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Jamal Hadi Salim - * */ #include <stdio.h> @@ -42,9 +37,6 @@ if (timestamp) print_timestamp(fp); - if (n->nlmsg_type == NLMSG_DONE) - nl_dump_ext_ack_done(n, 0, 0); - if (n->nlmsg_type == RTM_NEWTFILTER || n->nlmsg_type == RTM_DELTFILTER || n->nlmsg_type == RTM_NEWCHAIN ||
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/tc_qdisc.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/tc_qdisc.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * tc_qdisc.c "tc qdisc". * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> * J Hadi Salim: Extension to ingress */ @@ -191,8 +187,7 @@ addattr_l(&req.n, sizeof(req), TCA_STAB_DATA, stab.data, stab.szopts.tsize * sizeof(__u16)); addattr_nest_end(&req.n, tail); - if (stab.data) - free(stab.data); + free(stab.data); } if (d0) { @@ -346,6 +341,8 @@ print_nl(); } } + + print_ext_msg(tb); close_json_object(); fflush(fp); return 0; @@ -435,6 +432,7 @@ new_json_obj(json); if (rtnl_dump_filter(&rth, print_qdisc, stdout) < 0) { fprintf(stderr, "Dump terminated\n"); + delete_json_obj(); return 1; } delete_json_obj();
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/tc_red.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/tc_red.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * tc_red.c RED maintenance routines. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/tc_stab.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/tc_stab.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * tc_stab.c "tc qdisc ... stab *". * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Jussi Kivilinna, <jussi.kivilinna@mbnet.fi> - * */ #include <stdio.h>
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/tc_util.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/tc_util.c
Changed
@@ -1,13 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * tc_util.c Misc TC utility functions. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> - * */ #include <stdio.h> @@ -463,7 +458,7 @@ { int argc = *argc_p; char **argv = *argv_p; - int result1 = -1, result2; + int result1 = -1, result2 = -1; int *result_p = &result1; int ok = 0; int ret; @@ -476,7 +471,7 @@ result_p = &result2; NEXT_ARG(); /* fall-through */ - case 0: + case 0: ret = parse_action_control(&argc, &argv, result_p, allow_num); if (ret) @@ -848,3 +843,12 @@ print_masked_type(UINT16_MAX, __rta_getattr_be16_u32, name, attr, mask_attr, newline); } + +void print_ext_msg(struct rtattr **tb) +{ + if (!tbTCA_EXT_WARN_MSG) + return; + + print_string(PRINT_ANY, "warn", "%s", rta_getattr_str(tbTCA_EXT_WARN_MSG)); + print_nl(); +}
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tc/tc_util.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/tc/tc_util.h
Changed
@@ -133,4 +133,6 @@ struct rtattr *mask_attr, bool newline); void print_masked_be16(const char *name, struct rtattr *attr, struct rtattr *mask_attr, bool newline); + +void print_ext_msg(struct rtattr **tb); #endif
View file
_service:tar_scm:iproute2-6.4.0.tar.xz/testsuite/tests/ip/neigh
Added
+(directory)
View file
_service:tar_scm:iproute2-6.4.0.tar.xz/testsuite/tests/ip/neigh/basic.t
Added
@@ -0,0 +1,13 @@ +#!/bin/sh + +. lib/generic.sh + +ts_log "Testing add/get neigh" + +NEW_DEV="$(rand_dev)" +ts_ip "$0" "Add $NEW_DEV dummy interface" link add dev $NEW_DEV type dummy +ts_ip "$0" "Add $NEW_DEV neighbor 192.0.2.2 " neigh add 192.0.2.2 lladdr 02:00:00:00:00:01 dev $NEW_DEV +ts_ip "$0" "List neighbors " neigh list +test_on '02:00:00:00:00:01' +ts_ip "$0" "Get $NEW_DEV neighbor 192.0.2.2 " --json neigh get 192.0.2.2 dev $NEW_DEV +test_on '"lladdr":"02:00:00:00:00:01"'
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/testsuite/tools/Makefile -> _service:tar_scm:iproute2-6.4.0.tar.xz/testsuite/tools/Makefile
Changed
@@ -1,9 +1,13 @@ # SPDX-License-Identifier: GPL-2.0 CFLAGS= +LDLIBS= include ../../config.mk +ifeq ($(HAVE_CAP),y) +LDLIBS+= -lcap +endif generate_nlmsg: generate_nlmsg.c ../../lib/libnetlink.a ../../lib/libutil.a - $(QUIET_CC)$(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -I../../include -I../../include/uapi -include../../include/uapi/linux/netlink.h -o $@ $^ -lmnl -lcap + $(QUIET_CC)$(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -I../../include -I../../include/uapi -include../../include/uapi/linux/netlink.h -o $@ $^ -lmnl $(LDLIBS) clean: rm -f generate_nlmsg
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/testsuite/tools/generate_nlmsg.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/testsuite/tools/generate_nlmsg.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * generate_nlmsg.c Testsuite helper generating nlmsg blob * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Phil Sutter <phil@nwl.cc> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tipc/bearer.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tipc/bearer.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * bearer.c TIPC bearer functionality. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Richard Alpe <richard.alpe@ericsson.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tipc/bearer.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/tipc/bearer.h
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * bearer.h TIPC bearer functionality. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Richard Alpe <richard.alpe@ericsson.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tipc/cmdl.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tipc/cmdl.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * cmdl.c Framework for handling command line options. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Richard Alpe <richard.alpe@ericsson.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tipc/cmdl.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/tipc/cmdl.h
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * cmdl.h Framework for handling command line options. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Richard Alpe <richard.alpe@ericsson.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tipc/link.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tipc/link.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * link.c TIPC link functionality. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Richard Alpe <richard.alpe@ericsson.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tipc/link.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/tipc/link.h
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * link.c TIPC link functionality. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Richard Alpe <richard.alpe@ericsson.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tipc/media.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tipc/media.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * media.c TIPC link functionality. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Richard Alpe <richard.alpe@ericsson.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tipc/media.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/tipc/media.h
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * media.h TIPC link functionality. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Richard Alpe <richard.alpe@ericsson.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tipc/misc.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tipc/misc.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * misc.c Miscellaneous TIPC helper functions. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Richard Alpe <richard.alpe@ericsson.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tipc/misc.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/tipc/misc.h
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * misc.h Miscellaneous TIPC helper functions. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Richard Alpe <richard.alpe@ericsson.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tipc/msg.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tipc/msg.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * msg.c Messaging (netlink) helper functions. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Richard Alpe <richard.alpe@ericsson.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tipc/msg.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/tipc/msg.h
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * msg.h Messaging (netlink) helper functions. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Richard Alpe <richard.alpe@ericsson.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tipc/nametable.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tipc/nametable.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * nametable.c TIPC nametable functionality. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Richard Alpe <richard.alpe@ericsson.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tipc/nametable.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/tipc/nametable.h
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * nametable.h TIPC nametable functionality. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Richard Alpe <richard.alpe@ericsson.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tipc/node.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tipc/node.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * node.c TIPC node functionality. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Richard Alpe <richard.alpe@ericsson.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tipc/node.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/tipc/node.h
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * node.h TIPC node functionality. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Richard Alpe <richard.alpe@ericsson.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tipc/peer.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tipc/peer.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * peer.c TIPC peer functionality. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Richard Alpe <richard.alpe@ericsson.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tipc/peer.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/tipc/peer.h
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * peer.h TIPC peer functionality. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Richard Alpe <richard.alpe@ericsson.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tipc/socket.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tipc/socket.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * socket.c TIPC socket functionality. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Richard Alpe <richard.alpe@ericsson.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tipc/socket.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/tipc/socket.h
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * socket.h TIPC socket functionality. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Richard Alpe <richard.alpe@ericsson.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/tipc/tipc.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/tipc/tipc.c
Changed
@@ -1,11 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * tipc. TIPC utility frontend. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Authors: Richard Alpe <richard.alpe@ericsson.com> */
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/vdpa/include/uapi/linux/vdpa.h -> _service:tar_scm:iproute2-6.4.0.tar.xz/vdpa/include/uapi/linux/vdpa.h
Changed
@@ -53,11 +53,9 @@ VDPA_ATTR_DEV_VENDOR_ATTR_NAME, /* string */ VDPA_ATTR_DEV_VENDOR_ATTR_VALUE, /* u64 */ + /* virtio features that are provisioned to the vDPA device */ VDPA_ATTR_DEV_FEATURES, /* u64 */ - /* virtio features that are supported by the vDPA device */ - VDPA_ATTR_VDPA_DEV_SUPPORTED_FEATURES, /* u64 */ - /* new attributes must be added above here */ VDPA_ATTR_MAX, };
View file
_service:tar_scm:iproute2-6.1.0.tar.xz/vdpa/vdpa.c -> _service:tar_scm:iproute2-6.4.0.tar.xz/vdpa/vdpa.c
Changed
@@ -27,6 +27,7 @@ #define VDPA_OPT_VDEV_MTU BIT(5) #define VDPA_OPT_MAX_VQP BIT(6) #define VDPA_OPT_QUEUE_INDEX BIT(7) +#define VDPA_OPT_VDEV_FEATURES BIT(8) struct vdpa_opts { uint64_t present; /* flags of present items */ @@ -38,6 +39,7 @@ uint16_t mtu; uint16_t max_vqp; uint32_t queue_idx; + uint64_t device_features; }; struct vdpa { @@ -187,6 +189,17 @@ return get_u32(result, *argv, 10); } +static int vdpa_argv_u64_hex(struct vdpa *vdpa, int argc, char **argv, + uint64_t *result) +{ + if (argc <= 0 || !*argv) { + fprintf(stderr, "number expected\n"); + return -EINVAL; + } + + return get_u64((__u64 *)result, *argv, 16); +} + struct vdpa_args_metadata { uint64_t o_flag; const char *err_msg; @@ -244,6 +257,10 @@ mnl_attr_put_u16(nlh, VDPA_ATTR_DEV_NET_CFG_MAX_VQP, opts->max_vqp); if (opts->present & VDPA_OPT_QUEUE_INDEX) mnl_attr_put_u32(nlh, VDPA_ATTR_DEV_QUEUE_INDEX, opts->queue_idx); + if (opts->present & VDPA_OPT_VDEV_FEATURES) { + mnl_attr_put_u64(nlh, VDPA_ATTR_DEV_FEATURES, + opts->device_features); + } } static int vdpa_argv_parse(struct vdpa *vdpa, int argc, char **argv, @@ -329,6 +346,14 @@ NEXT_ARG_FWD(); o_found |= VDPA_OPT_QUEUE_INDEX; + } else if (!strcmp(*argv, "device_features") && + (o_optional & VDPA_OPT_VDEV_FEATURES)) { + NEXT_ARG_FWD(); + err = vdpa_argv_u64_hex(vdpa, argc, argv, + &opts->device_features); + if (err) + return err; + o_found |= VDPA_OPT_VDEV_FEATURES; } else { fprintf(stderr, "Unknown option \"%s\"\n", *argv); return -EINVAL; @@ -615,7 +640,8 @@ static void cmd_dev_help(void) { fprintf(stderr, "Usage: vdpa dev show DEV \n"); - fprintf(stderr, " vdpa dev add name NAME mgmtdev MANAGEMENTDEV mac MACADDR mtu MTU \n"); + fprintf(stderr, " vdpa dev add name NAME mgmtdev MANAGEMENTDEV device_features DEVICE_FEATURES\n"); + fprintf(stderr, " mac MACADDR mtu MTU \n"); fprintf(stderr, " max_vqp MAX_VQ_PAIRS \n"); fprintf(stderr, " vdpa dev del DEV\n"); fprintf(stderr, "Usage: vdpa dev config COMMAND OPTIONS \n"); @@ -708,7 +734,7 @@ err = vdpa_argv_parse_put(nlh, vdpa, argc, argv, VDPA_OPT_VDEV_MGMTDEV_HANDLE | VDPA_OPT_VDEV_NAME, VDPA_OPT_VDEV_MAC | VDPA_OPT_VDEV_MTU | - VDPA_OPT_MAX_VQP); + VDPA_OPT_MAX_VQP | VDPA_OPT_VDEV_FEATURES); if (err) return err; @@ -960,7 +986,7 @@ pr_out_section_start(vdpa, "vstats"); err = mnlu_gen_socket_sndrcv(&vdpa->nlg, nlh, cmd_dev_vstats_show_cb, vdpa); pr_out_section_end(vdpa); - return 0; + return err; } static int cmd_dev_vstats(struct vdpa *vdpa, int argc, char **argv)
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2