Merge remote-tracking branch 'main/main' into next

Signed-off-by: David Ahern <dsahern@kernel.org>
This commit is contained in:
David Ahern
2025-02-07 21:00:44 +00:00
12 changed files with 114 additions and 64 deletions

View File

@@ -4,6 +4,7 @@
#include <stdio.h>
#include <string.h>
#include <endian.h>
#include <asm/types.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>

View File

@@ -1573,6 +1573,16 @@ union bpf_attr {
* If provided, prog_flags should have BPF_F_TOKEN_FD flag set.
*/
__s32 prog_token_fd;
/* The fd_array_cnt can be used to pass the length of the
* fd_array array. In this case all the [map] file descriptors
* passed in this array will be bound to the program, even if
* the maps are not referenced directly. The functionality is
* similar to the BPF_PROG_BIND_MAP syscall, but maps can be
* used by the verifier during the program load. If provided,
* then the fd_array[0,...,fd_array_cnt-1] is expected to be
* continuous.
*/
__u32 fd_array_cnt;
};
struct { /* anonymous struct used by BPF_OBJ_* commands */

View File

@@ -1,21 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _LINUX_LIMITS_H
#define _LINUX_LIMITS_H
#define NR_OPEN 1024
#define NGROUPS_MAX 65536 /* supplemental group IDs are available */
#define ARG_MAX 131072 /* # bytes of args + environ for exec() */
#define LINK_MAX 127 /* # links a file may have */
#define MAX_CANON 255 /* size of the canonical input queue */
#define MAX_INPUT 255 /* size of the type-ahead buffer */
#define NAME_MAX 255 /* # chars in a file name */
#define PATH_MAX 4096 /* # chars in a path name including nul */
#define PIPE_BUF 4096 /* # bytes in atomic write to a pipe */
#define XATTR_NAME_MAX 255 /* # chars in an extended attribute name */
#define XATTR_SIZE_MAX 65536 /* size of an extended attribute value (64k) */
#define XATTR_LIST_MAX 65536 /* size of extended attribute namelist (64k) */
#define RTSIG_MAX 32
#endif

View File

@@ -1 +1 @@
static const char version[] = "6.12.0";
static const char version[] = "6.13.0";

View File

@@ -11,17 +11,14 @@
#include <fcntl.h>
#include <dlfcn.h>
#include <errno.h>
#include <sys/socket.h>
#include <linux/if.h>
#include <linux/if_packet.h>
#include <linux/if_ether.h>
#include <linux/sockios.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
#include <sys/ioctl.h>
#include <stdbool.h>
#include <linux/mpls.h>
#include <strings.h>
#include <limits.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <linux/if.h>
#include <linux/if_ether.h>
#include "rt_names.h"
#include "utils.h"

View File

@@ -661,6 +661,65 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
"mcast_querier %u ",
rta_getattr_u8(tb[IFLA_BR_MCAST_QUERIER]));
if (tb[IFLA_BR_MCAST_QUERIER_STATE]) {
struct rtattr *bqtb[BRIDGE_QUERIER_MAX + 1];
SPRINT_BUF(other_time);
parse_rtattr_nested(bqtb, BRIDGE_QUERIER_MAX, tb[IFLA_BR_MCAST_QUERIER_STATE]);
memset(other_time, 0, sizeof(other_time));
open_json_object("mcast_querier_state_ipv4");
if (bqtb[BRIDGE_QUERIER_IP_ADDRESS]) {
print_string(PRINT_FP,
NULL,
"%s ",
"mcast_querier_ipv4_addr");
print_color_string(PRINT_ANY,
COLOR_INET,
"mcast_querier_ipv4_addr",
"%s ",
format_host_rta(AF_INET, bqtb[BRIDGE_QUERIER_IP_ADDRESS]));
}
if (bqtb[BRIDGE_QUERIER_IP_PORT])
print_uint(PRINT_ANY,
"mcast_querier_ipv4_port",
"mcast_querier_ipv4_port %u ",
rta_getattr_u32(bqtb[BRIDGE_QUERIER_IP_PORT]));
if (bqtb[BRIDGE_QUERIER_IP_OTHER_TIMER])
print_string(PRINT_ANY,
"mcast_querier_ipv4_other_timer",
"mcast_querier_ipv4_other_timer %s ",
sprint_time64(
rta_getattr_u64(bqtb[BRIDGE_QUERIER_IP_OTHER_TIMER]),
other_time));
close_json_object();
open_json_object("mcast_querier_state_ipv6");
if (bqtb[BRIDGE_QUERIER_IPV6_ADDRESS]) {
print_string(PRINT_FP,
NULL,
"%s ",
"mcast_querier_ipv6_addr");
print_color_string(PRINT_ANY,
COLOR_INET6,
"mcast_querier_ipv6_addr",
"%s ",
format_host_rta(AF_INET6, bqtb[BRIDGE_QUERIER_IPV6_ADDRESS]));
}
if (bqtb[BRIDGE_QUERIER_IPV6_PORT])
print_uint(PRINT_ANY,
"mcast_querier_ipv6_port",
"mcast_querier_ipv6_port %u ",
rta_getattr_u32(bqtb[BRIDGE_QUERIER_IPV6_PORT]));
if (bqtb[BRIDGE_QUERIER_IPV6_OTHER_TIMER])
print_string(PRINT_ANY,
"mcast_querier_ipv6_other_timer",
"mcast_querier_ipv6_other_timer %s ",
sprint_time64(
rta_getattr_u64(bqtb[BRIDGE_QUERIER_IPV6_OTHER_TIMER]),
other_time));
close_json_object();
}
if (tb[IFLA_BR_MCAST_HASH_ELASTICITY])
print_uint(PRINT_ANY,
"mcast_hash_elasticity",

View File

@@ -1,21 +1,21 @@
/* SPDX-License-Identifier: GPL-2.0 */
#define _ATFILE_SOURCE
#include <sys/file.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <sys/inotify.h>
#include <sys/mount.h>
#include <sys/syscall.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <sched.h>
#include <fcntl.h>
#include <dirent.h>
#include <errno.h>
#include <unistd.h>
#include <ctype.h>
#include <linux/limits.h>
#include <limits.h>
#include <sys/file.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/inotify.h>
#include <sys/mount.h>
#include <linux/net_namespace.h>
@@ -23,7 +23,6 @@
#include "list.h"
#include "ip_common.h"
#include "namespace.h"
#include "json_print.h"
static int usage(void)
{

View File

@@ -9,8 +9,9 @@
#include <string.h>
#include <stdio.h>
#include <stdbool.h>
#include <limits.h>
#include <linux/types.h>
#include <linux/limits.h>
#include <ftw.h>
#include "cg_map.h"

View File

@@ -812,7 +812,7 @@ void duparg(const char *key, const char *arg)
void duparg2(const char *key, const char *arg)
{
fprintf(stderr,
"Error: either \"%s\" is duplicate, or \"%s\" is a garbage.\n",
"Error: either \"%s\" is duplicate, or \"%s\" is garbage.\n",
key, arg);
exit(-1);
}

View File

@@ -2476,7 +2476,7 @@ loaded under
.B xdpgeneric object "|" pinned
then the kernel will use the generic XDP variant instead of the native one.
.B xdpdrv
has the opposite effect of requestsing that the automatic fallback to the
has the opposite effect of requesting that the automatic fallback to the
generic XDP variant be disabled and in case driver is not XDP-capable error
should be returned.
.B xdpdrv
@@ -2485,7 +2485,7 @@ also disables hardware offloads.
in ip link output indicates that the program has been offloaded to hardware
and can also be used to request the "offload" mode, much like
.B xdpgeneric
it forces program to be installed specifically in HW/FW of the apater.
it forces program to be installed specifically in HW/FW of the adapter.
.B off
(or

View File

@@ -10,11 +10,12 @@
#include <string.h>
#include <errno.h>
#include <getopt.h>
#include <time.h>
#include <libgen.h>
#include <netinet/in.h>
#include <libmnl/libmnl.h>
#include <rdma/rdma_netlink.h>
#include <rdma/rdma_user_cm.h>
#include <time.h>
#include <net/if_arp.h>
#include "list.h"

View File

@@ -10,7 +10,7 @@
#include <unistd.h>
#include <string.h>
#include <net/if.h>
#include <linux/limits.h>
#include <linux/if_arp.h>
#include <linux/if_ether.h>
#include <linux/ip.h>
@@ -22,6 +22,9 @@
#include "tc_util.h"
#include "rt_names.h"
/* maximum length of options string */
#define FLOWER_OPTS_MAX 4096
#ifndef IPPROTO_L2TP
#define IPPROTO_L2TP 115
#endif
@@ -1252,7 +1255,7 @@ static int flower_check_enc_opt_key(char *key)
static int flower_parse_enc_opts_geneve(char *str, struct nlmsghdr *n)
{
char key[XATTR_SIZE_MAX], mask[XATTR_SIZE_MAX];
char key[FLOWER_OPTS_MAX], mask[FLOWER_OPTS_MAX];
int data_len, key_len, mask_len, err;
char *token, *slash;
struct rtattr *nest;
@@ -1265,7 +1268,7 @@ static int flower_parse_enc_opts_geneve(char *str, struct nlmsghdr *n)
if (slash)
*slash = '\0';
if ((key_len + strlen(token) > XATTR_SIZE_MAX) ||
if ((key_len + strlen(token) > FLOWER_OPTS_MAX) ||
flower_check_enc_opt_key(token))
return -1;
@@ -1275,7 +1278,7 @@ static int flower_parse_enc_opts_geneve(char *str, struct nlmsghdr *n)
if (!slash) {
/* Pad out mask when not provided */
if (mask_len + strlen(token) > XATTR_SIZE_MAX)
if (mask_len + strlen(token) > FLOWER_OPTS_MAX)
return -1;
data_len = strlen(rindex(token, ':'));
@@ -1288,7 +1291,7 @@ static int flower_parse_enc_opts_geneve(char *str, struct nlmsghdr *n)
continue;
}
if (mask_len + strlen(slash + 1) > XATTR_SIZE_MAX)
if (mask_len + strlen(slash + 1) > FLOWER_OPTS_MAX)
return -1;
strcpy(&mask[mask_len], slash + 1);
@@ -1318,7 +1321,7 @@ static int flower_parse_enc_opts_geneve(char *str, struct nlmsghdr *n)
static int flower_parse_enc_opts_vxlan(char *str, struct nlmsghdr *n)
{
char key[XATTR_SIZE_MAX], mask[XATTR_SIZE_MAX];
char key[FLOWER_OPTS_MAX], mask[FLOWER_OPTS_MAX];
struct rtattr *nest;
char *slash;
int err;
@@ -1326,14 +1329,14 @@ static int flower_parse_enc_opts_vxlan(char *str, struct nlmsghdr *n)
slash = strchr(str, '/');
if (slash) {
*slash++ = '\0';
if (strlen(slash) > XATTR_SIZE_MAX)
if (strlen(slash) > FLOWER_OPTS_MAX)
return -1;
strcpy(mask, slash);
} else {
strcpy(mask, "0xffffffff");
}
if (strlen(str) > XATTR_SIZE_MAX)
if (strlen(str) > FLOWER_OPTS_MAX)
return -1;
strcpy(key, str);
@@ -1355,7 +1358,7 @@ static int flower_parse_enc_opts_vxlan(char *str, struct nlmsghdr *n)
static int flower_parse_enc_opts_erspan(char *str, struct nlmsghdr *n)
{
char key[XATTR_SIZE_MAX], mask[XATTR_SIZE_MAX];
char key[FLOWER_OPTS_MAX], mask[FLOWER_OPTS_MAX];
struct rtattr *nest;
char *slash;
int err;
@@ -1364,7 +1367,7 @@ static int flower_parse_enc_opts_erspan(char *str, struct nlmsghdr *n)
slash = strchr(str, '/');
if (slash) {
*slash++ = '\0';
if (strlen(slash) > XATTR_SIZE_MAX)
if (strlen(slash) > FLOWER_OPTS_MAX)
return -1;
strcpy(mask, slash);
} else {
@@ -1376,7 +1379,7 @@ static int flower_parse_enc_opts_erspan(char *str, struct nlmsghdr *n)
strcpy(mask + index, ":0xffffffff:0xff:0xff");
}
if (strlen(str) > XATTR_SIZE_MAX)
if (strlen(str) > FLOWER_OPTS_MAX)
return -1;
strcpy(key, str);
@@ -1398,7 +1401,7 @@ static int flower_parse_enc_opts_erspan(char *str, struct nlmsghdr *n)
static int flower_parse_enc_opts_gtp(char *str, struct nlmsghdr *n)
{
char key[XATTR_SIZE_MAX], mask[XATTR_SIZE_MAX];
char key[FLOWER_OPTS_MAX], mask[FLOWER_OPTS_MAX];
struct rtattr *nest;
char *slash;
int err;
@@ -1406,13 +1409,13 @@ static int flower_parse_enc_opts_gtp(char *str, struct nlmsghdr *n)
slash = strchr(str, '/');
if (slash) {
*slash++ = '\0';
if (strlen(slash) > XATTR_SIZE_MAX)
if (strlen(slash) > FLOWER_OPTS_MAX)
return -1;
strcpy(mask, slash);
} else
strcpy(mask, "ff:ff");
if (strlen(str) > XATTR_SIZE_MAX)
if (strlen(str) > FLOWER_OPTS_MAX)
return -1;
strcpy(key, str);
@@ -1433,7 +1436,7 @@ static int flower_parse_enc_opts_gtp(char *str, struct nlmsghdr *n)
static int flower_parse_enc_opts_pfcp(char *str, struct nlmsghdr *n)
{
char key[XATTR_SIZE_MAX], mask[XATTR_SIZE_MAX];
char key[FLOWER_OPTS_MAX], mask[FLOWER_OPTS_MAX];
struct rtattr *nest;
char *slash;
int err;
@@ -1442,14 +1445,14 @@ static int flower_parse_enc_opts_pfcp(char *str, struct nlmsghdr *n)
slash = strchr(str, '/');
if (slash) {
*slash++ = '\0';
if (strlen(slash) > XATTR_SIZE_MAX)
if (strlen(slash) > FLOWER_OPTS_MAX)
return -1;
strcpy(mask, slash);
} else {
strcpy(mask, "ff:ffffffffffffffff");
}
if (strlen(str) > XATTR_SIZE_MAX)
if (strlen(str) > FLOWER_OPTS_MAX)
return -1;
strcpy(key, str);