Thread (8 messages) 8 messages, 2 authors, 2024-02-21

Re: [PATCH iproute2 v8 1/3] ss: add support for BPF socket-local storage

From: David Ahern <hidden>
Date: 2024-02-18 17:39:07

On 2/14/24 1:42 AM, Quentin Deslandes wrote:
+	if (info.type != BPF_MAP_TYPE_SK_STORAGE) {
+		fprintf(stderr, "ss: BPF map with ID %s has type '%s', expecting 'sk_storage'\n",
+			optarg, libbpf_bpf_map_type_str(info.type));
+		close(fd);
+		return -1;
+	}
ss.c: In function ‘bpf_map_opts_load_info’:
ss.c:3448:33: warning: implicit declaration of function
‘libbpf_bpf_map_type_str’ [-Wimplicit-function-declaration]
 3448 |                         optarg, libbpf_bpf_map_type_str(info.type));
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~
ss.c:3447:68: warning: format ‘%s’ expects argument of type ‘char *’,
but argument 4 has type ‘int’ [-Wformat=]
 3447 |                 fprintf(stderr, "ss: BPF map with ID %s has type
'%s', expecting 'sk_storage'\n",
      |                                                                   ~^
      |                                                                    |
      |
  char *
      |                                                                   %d
 3448 |                         optarg, libbpf_bpf_map_type_str(info.type));
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                 |
      |                                 int
    CC       lnstat_util.o
    LINK     lnstat
    LINK     ss
/usr/bin/ld: ss.o: in function `main':


Ubuntu 22.04 has libbpf-0.5 installed. I suspect version hook is needed.
e.g., something like this (but with the relevant version numbers):

#if (LIBBPF_MAJOR_VERSION > 0) || (LIBBPF_MINOR_VERSION >= 7)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help