1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
2 // Copyright (c) 2020 Cloudflare
9 #include <sys/socket.h>
11 #include <bpf/bpf_endian.h>
12 #include <bpf/bpf_helpers.h>
14 #define IP4(a, b, c, d) \
15 bpf_htonl((((__u32)(a) & 0xffU) << 24) | \
16 (((__u32)(b) & 0xffU) << 16) | \
17 (((__u32)(c) & 0xffU) << 8) | \
18 (((__u32)(d) & 0xffU) << 0))
19 #define IP6(aaaa, bbbb, cccc, dddd) \
20 { bpf_htonl(aaaa), bpf_htonl(bbbb), bpf_htonl(cccc), bpf_htonl(dddd) }
22 /* Macros for least-significant byte and word accesses. */
23 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
24 #define LSE_INDEX(index, size) (index)
26 #define LSE_INDEX(index, size) ((size) - (index) - 1)
28 #define LSB(value, index) \
29 (((__u8 *)&(value))[LSE_INDEX((index), sizeof(value))])
30 #define LSW(value, index) \
31 (((__u16 *)&(value))[LSE_INDEX((index), sizeof(value) / 2)])
36 __uint(type
, BPF_MAP_TYPE_SOCKMAP
);
37 __uint(max_entries
, MAX_SOCKS
);
40 } redir_map
SEC(".maps");
43 __uint(type
, BPF_MAP_TYPE_ARRAY
);
44 __uint(max_entries
, 2);
47 } run_map
SEC(".maps");
59 /* Addressable key/value constants for convenience */
60 static const int KEY_PROG1
= PROG1
;
61 static const int KEY_PROG2
= PROG2
;
62 static const int PROG_DONE
= 1;
64 static const __u32 KEY_SERVER_A
= SERVER_A
;
65 static const __u32 KEY_SERVER_B
= SERVER_B
;
67 static const __u16 DST_PORT
= 7007; /* Host byte order */
68 static const __u32 DST_IP4
= IP4(127, 0, 0, 1);
69 static const __u32 DST_IP6
[] = IP6(0xfd000000, 0x0, 0x0, 0x00000001);
71 SEC("sk_lookup/lookup_pass")
72 int lookup_pass(struct bpf_sk_lookup
*ctx
)
77 SEC("sk_lookup/lookup_drop")
78 int lookup_drop(struct bpf_sk_lookup
*ctx
)
83 SEC("sk_reuseport/reuse_pass")
84 int reuseport_pass(struct sk_reuseport_md
*ctx
)
89 SEC("sk_reuseport/reuse_drop")
90 int reuseport_drop(struct sk_reuseport_md
*ctx
)
95 /* Redirect packets destined for port DST_PORT to socket at redir_map[0]. */
96 SEC("sk_lookup/redir_port")
97 int redir_port(struct bpf_sk_lookup
*ctx
)
102 if (ctx
->local_port
!= DST_PORT
)
105 sk
= bpf_map_lookup_elem(&redir_map
, &KEY_SERVER_A
);
109 err
= bpf_sk_assign(ctx
, sk
, 0);
111 return err
? SK_DROP
: SK_PASS
;
114 /* Redirect packets destined for DST_IP4 address to socket at redir_map[0]. */
115 SEC("sk_lookup/redir_ip4")
116 int redir_ip4(struct bpf_sk_lookup
*ctx
)
121 if (ctx
->family
!= AF_INET
)
123 if (ctx
->local_port
!= DST_PORT
)
125 if (ctx
->local_ip4
!= DST_IP4
)
128 sk
= bpf_map_lookup_elem(&redir_map
, &KEY_SERVER_A
);
132 err
= bpf_sk_assign(ctx
, sk
, 0);
134 return err
? SK_DROP
: SK_PASS
;
137 /* Redirect packets destined for DST_IP6 address to socket at redir_map[0]. */
138 SEC("sk_lookup/redir_ip6")
139 int redir_ip6(struct bpf_sk_lookup
*ctx
)
144 if (ctx
->family
!= AF_INET6
)
146 if (ctx
->local_port
!= DST_PORT
)
148 if (ctx
->local_ip6
[0] != DST_IP6
[0] ||
149 ctx
->local_ip6
[1] != DST_IP6
[1] ||
150 ctx
->local_ip6
[2] != DST_IP6
[2] ||
151 ctx
->local_ip6
[3] != DST_IP6
[3])
154 sk
= bpf_map_lookup_elem(&redir_map
, &KEY_SERVER_A
);
158 err
= bpf_sk_assign(ctx
, sk
, 0);
160 return err
? SK_DROP
: SK_PASS
;
163 SEC("sk_lookup/select_sock_a")
164 int select_sock_a(struct bpf_sk_lookup
*ctx
)
169 sk
= bpf_map_lookup_elem(&redir_map
, &KEY_SERVER_A
);
173 err
= bpf_sk_assign(ctx
, sk
, 0);
175 return err
? SK_DROP
: SK_PASS
;
178 SEC("sk_lookup/select_sock_a_no_reuseport")
179 int select_sock_a_no_reuseport(struct bpf_sk_lookup
*ctx
)
184 sk
= bpf_map_lookup_elem(&redir_map
, &KEY_SERVER_A
);
188 err
= bpf_sk_assign(ctx
, sk
, BPF_SK_LOOKUP_F_NO_REUSEPORT
);
190 return err
? SK_DROP
: SK_PASS
;
193 SEC("sk_reuseport/select_sock_b")
194 int select_sock_b(struct sk_reuseport_md
*ctx
)
196 __u32 key
= KEY_SERVER_B
;
199 err
= bpf_sk_select_reuseport(ctx
, &redir_map
, &key
, 0);
200 return err
? SK_DROP
: SK_PASS
;
203 /* Check that bpf_sk_assign() returns -EEXIST if socket already selected. */
204 SEC("sk_lookup/sk_assign_eexist")
205 int sk_assign_eexist(struct bpf_sk_lookup
*ctx
)
211 sk
= bpf_map_lookup_elem(&redir_map
, &KEY_SERVER_B
);
214 err
= bpf_sk_assign(ctx
, sk
, 0);
219 sk
= bpf_map_lookup_elem(&redir_map
, &KEY_SERVER_A
);
222 err
= bpf_sk_assign(ctx
, sk
, 0);
223 if (err
!= -EEXIST
) {
224 bpf_printk("sk_assign returned %d, expected %d\n",
229 ret
= SK_PASS
; /* Success, redirect to KEY_SERVER_B */
236 /* Check that bpf_sk_assign(BPF_SK_LOOKUP_F_REPLACE) can override selection. */
237 SEC("sk_lookup/sk_assign_replace_flag")
238 int sk_assign_replace_flag(struct bpf_sk_lookup
*ctx
)
244 sk
= bpf_map_lookup_elem(&redir_map
, &KEY_SERVER_A
);
247 err
= bpf_sk_assign(ctx
, sk
, 0);
252 sk
= bpf_map_lookup_elem(&redir_map
, &KEY_SERVER_B
);
255 err
= bpf_sk_assign(ctx
, sk
, BPF_SK_LOOKUP_F_REPLACE
);
257 bpf_printk("sk_assign returned %d, expected 0\n", err
);
261 ret
= SK_PASS
; /* Success, redirect to KEY_SERVER_B */
268 /* Check that bpf_sk_assign(sk=NULL) is accepted. */
269 SEC("sk_lookup/sk_assign_null")
270 int sk_assign_null(struct bpf_sk_lookup
*ctx
)
272 struct bpf_sock
*sk
= NULL
;
277 err
= bpf_sk_assign(ctx
, NULL
, 0);
279 bpf_printk("sk_assign returned %d, expected 0\n", err
);
283 sk
= bpf_map_lookup_elem(&redir_map
, &KEY_SERVER_B
);
286 err
= bpf_sk_assign(ctx
, sk
, BPF_SK_LOOKUP_F_REPLACE
);
288 bpf_printk("sk_assign returned %d, expected 0\n", err
);
294 err
= bpf_sk_assign(ctx
, NULL
, 0);
297 err
= bpf_sk_assign(ctx
, NULL
, BPF_SK_LOOKUP_F_REPLACE
);
300 err
= bpf_sk_assign(ctx
, sk
, BPF_SK_LOOKUP_F_REPLACE
);
304 ret
= SK_PASS
; /* Success, redirect to KEY_SERVER_B */
311 /* Check that selected sk is accessible through context. */
312 SEC("sk_lookup/access_ctx_sk")
313 int access_ctx_sk(struct bpf_sk_lookup
*ctx
)
315 struct bpf_sock
*sk1
= NULL
, *sk2
= NULL
;
320 /* Try accessing unassigned (NULL) ctx->sk field */
321 if (ctx
->sk
&& ctx
->sk
->family
!= AF_INET
)
324 /* Assign a value to ctx->sk */
325 sk1
= bpf_map_lookup_elem(&redir_map
, &KEY_SERVER_A
);
328 err
= bpf_sk_assign(ctx
, sk1
, 0);
334 /* Access ctx->sk fields */
335 if (ctx
->sk
->family
!= AF_INET
||
336 ctx
->sk
->type
!= SOCK_STREAM
||
337 ctx
->sk
->state
!= BPF_TCP_LISTEN
)
340 /* Reset selection */
341 err
= bpf_sk_assign(ctx
, NULL
, BPF_SK_LOOKUP_F_REPLACE
);
347 /* Assign another socket */
348 sk2
= bpf_map_lookup_elem(&redir_map
, &KEY_SERVER_B
);
351 err
= bpf_sk_assign(ctx
, sk2
, BPF_SK_LOOKUP_F_REPLACE
);
357 /* Access reassigned ctx->sk fields */
358 if (ctx
->sk
->family
!= AF_INET
||
359 ctx
->sk
->type
!= SOCK_STREAM
||
360 ctx
->sk
->state
!= BPF_TCP_LISTEN
)
363 ret
= SK_PASS
; /* Success, redirect to KEY_SERVER_B */
372 /* Check narrow loads from ctx fields that support them.
374 * Narrow loads of size >= target field size from a non-zero offset
375 * are not covered because they give bogus results, that is the
376 * verifier ignores the offset.
378 SEC("sk_lookup/ctx_narrow_access")
379 int ctx_narrow_access(struct bpf_sk_lookup
*ctx
)
385 v4
= (ctx
->family
== AF_INET
);
387 /* Narrow loads from family field */
388 if (LSB(ctx
->family
, 0) != (v4
? AF_INET
: AF_INET6
) ||
389 LSB(ctx
->family
, 1) != 0 || LSB(ctx
->family
, 2) != 0 || LSB(ctx
->family
, 3) != 0)
391 if (LSW(ctx
->family
, 0) != (v4
? AF_INET
: AF_INET6
))
394 /* Narrow loads from protocol field */
395 if (LSB(ctx
->protocol
, 0) != IPPROTO_TCP
||
396 LSB(ctx
->protocol
, 1) != 0 || LSB(ctx
->protocol
, 2) != 0 || LSB(ctx
->protocol
, 3) != 0)
398 if (LSW(ctx
->protocol
, 0) != IPPROTO_TCP
)
401 /* Narrow loads from remote_port field. Expect non-0 value. */
402 if (LSB(ctx
->remote_port
, 0) == 0 && LSB(ctx
->remote_port
, 1) == 0 &&
403 LSB(ctx
->remote_port
, 2) == 0 && LSB(ctx
->remote_port
, 3) == 0)
405 if (LSW(ctx
->remote_port
, 0) == 0)
408 /* Narrow loads from local_port field. Expect DST_PORT. */
409 if (LSB(ctx
->local_port
, 0) != ((DST_PORT
>> 0) & 0xff) ||
410 LSB(ctx
->local_port
, 1) != ((DST_PORT
>> 8) & 0xff) ||
411 LSB(ctx
->local_port
, 2) != 0 || LSB(ctx
->local_port
, 3) != 0)
413 if (LSW(ctx
->local_port
, 0) != DST_PORT
)
416 /* Narrow loads from IPv4 fields */
418 /* Expect non-0.0.0.0 in remote_ip4 */
419 if (LSB(ctx
->remote_ip4
, 0) == 0 && LSB(ctx
->remote_ip4
, 1) == 0 &&
420 LSB(ctx
->remote_ip4
, 2) == 0 && LSB(ctx
->remote_ip4
, 3) == 0)
422 if (LSW(ctx
->remote_ip4
, 0) == 0 && LSW(ctx
->remote_ip4
, 1) == 0)
425 /* Expect DST_IP4 in local_ip4 */
426 if (LSB(ctx
->local_ip4
, 0) != ((DST_IP4
>> 0) & 0xff) ||
427 LSB(ctx
->local_ip4
, 1) != ((DST_IP4
>> 8) & 0xff) ||
428 LSB(ctx
->local_ip4
, 2) != ((DST_IP4
>> 16) & 0xff) ||
429 LSB(ctx
->local_ip4
, 3) != ((DST_IP4
>> 24) & 0xff))
431 if (LSW(ctx
->local_ip4
, 0) != ((DST_IP4
>> 0) & 0xffff) ||
432 LSW(ctx
->local_ip4
, 1) != ((DST_IP4
>> 16) & 0xffff))
435 /* Expect 0.0.0.0 IPs when family != AF_INET */
436 if (LSB(ctx
->remote_ip4
, 0) != 0 || LSB(ctx
->remote_ip4
, 1) != 0 ||
437 LSB(ctx
->remote_ip4
, 2) != 0 || LSB(ctx
->remote_ip4
, 3) != 0)
439 if (LSW(ctx
->remote_ip4
, 0) != 0 || LSW(ctx
->remote_ip4
, 1) != 0)
442 if (LSB(ctx
->local_ip4
, 0) != 0 || LSB(ctx
->local_ip4
, 1) != 0 ||
443 LSB(ctx
->local_ip4
, 2) != 0 || LSB(ctx
->local_ip4
, 3) != 0)
445 if (LSW(ctx
->local_ip4
, 0) != 0 || LSW(ctx
->local_ip4
, 1) != 0)
449 /* Narrow loads from IPv6 fields */
451 /* Expect non-:: IP in remote_ip6 */
452 if (LSB(ctx
->remote_ip6
[0], 0) == 0 && LSB(ctx
->remote_ip6
[0], 1) == 0 &&
453 LSB(ctx
->remote_ip6
[0], 2) == 0 && LSB(ctx
->remote_ip6
[0], 3) == 0 &&
454 LSB(ctx
->remote_ip6
[1], 0) == 0 && LSB(ctx
->remote_ip6
[1], 1) == 0 &&
455 LSB(ctx
->remote_ip6
[1], 2) == 0 && LSB(ctx
->remote_ip6
[1], 3) == 0 &&
456 LSB(ctx
->remote_ip6
[2], 0) == 0 && LSB(ctx
->remote_ip6
[2], 1) == 0 &&
457 LSB(ctx
->remote_ip6
[2], 2) == 0 && LSB(ctx
->remote_ip6
[2], 3) == 0 &&
458 LSB(ctx
->remote_ip6
[3], 0) == 0 && LSB(ctx
->remote_ip6
[3], 1) == 0 &&
459 LSB(ctx
->remote_ip6
[3], 2) == 0 && LSB(ctx
->remote_ip6
[3], 3) == 0)
461 if (LSW(ctx
->remote_ip6
[0], 0) == 0 && LSW(ctx
->remote_ip6
[0], 1) == 0 &&
462 LSW(ctx
->remote_ip6
[1], 0) == 0 && LSW(ctx
->remote_ip6
[1], 1) == 0 &&
463 LSW(ctx
->remote_ip6
[2], 0) == 0 && LSW(ctx
->remote_ip6
[2], 1) == 0 &&
464 LSW(ctx
->remote_ip6
[3], 0) == 0 && LSW(ctx
->remote_ip6
[3], 1) == 0)
466 /* Expect DST_IP6 in local_ip6 */
467 if (LSB(ctx
->local_ip6
[0], 0) != ((DST_IP6
[0] >> 0) & 0xff) ||
468 LSB(ctx
->local_ip6
[0], 1) != ((DST_IP6
[0] >> 8) & 0xff) ||
469 LSB(ctx
->local_ip6
[0], 2) != ((DST_IP6
[0] >> 16) & 0xff) ||
470 LSB(ctx
->local_ip6
[0], 3) != ((DST_IP6
[0] >> 24) & 0xff) ||
471 LSB(ctx
->local_ip6
[1], 0) != ((DST_IP6
[1] >> 0) & 0xff) ||
472 LSB(ctx
->local_ip6
[1], 1) != ((DST_IP6
[1] >> 8) & 0xff) ||
473 LSB(ctx
->local_ip6
[1], 2) != ((DST_IP6
[1] >> 16) & 0xff) ||
474 LSB(ctx
->local_ip6
[1], 3) != ((DST_IP6
[1] >> 24) & 0xff) ||
475 LSB(ctx
->local_ip6
[2], 0) != ((DST_IP6
[2] >> 0) & 0xff) ||
476 LSB(ctx
->local_ip6
[2], 1) != ((DST_IP6
[2] >> 8) & 0xff) ||
477 LSB(ctx
->local_ip6
[2], 2) != ((DST_IP6
[2] >> 16) & 0xff) ||
478 LSB(ctx
->local_ip6
[2], 3) != ((DST_IP6
[2] >> 24) & 0xff) ||
479 LSB(ctx
->local_ip6
[3], 0) != ((DST_IP6
[3] >> 0) & 0xff) ||
480 LSB(ctx
->local_ip6
[3], 1) != ((DST_IP6
[3] >> 8) & 0xff) ||
481 LSB(ctx
->local_ip6
[3], 2) != ((DST_IP6
[3] >> 16) & 0xff) ||
482 LSB(ctx
->local_ip6
[3], 3) != ((DST_IP6
[3] >> 24) & 0xff))
484 if (LSW(ctx
->local_ip6
[0], 0) != ((DST_IP6
[0] >> 0) & 0xffff) ||
485 LSW(ctx
->local_ip6
[0], 1) != ((DST_IP6
[0] >> 16) & 0xffff) ||
486 LSW(ctx
->local_ip6
[1], 0) != ((DST_IP6
[1] >> 0) & 0xffff) ||
487 LSW(ctx
->local_ip6
[1], 1) != ((DST_IP6
[1] >> 16) & 0xffff) ||
488 LSW(ctx
->local_ip6
[2], 0) != ((DST_IP6
[2] >> 0) & 0xffff) ||
489 LSW(ctx
->local_ip6
[2], 1) != ((DST_IP6
[2] >> 16) & 0xffff) ||
490 LSW(ctx
->local_ip6
[3], 0) != ((DST_IP6
[3] >> 0) & 0xffff) ||
491 LSW(ctx
->local_ip6
[3], 1) != ((DST_IP6
[3] >> 16) & 0xffff))
494 /* Expect :: IPs when family != AF_INET6 */
495 if (LSB(ctx
->remote_ip6
[0], 0) != 0 || LSB(ctx
->remote_ip6
[0], 1) != 0 ||
496 LSB(ctx
->remote_ip6
[0], 2) != 0 || LSB(ctx
->remote_ip6
[0], 3) != 0 ||
497 LSB(ctx
->remote_ip6
[1], 0) != 0 || LSB(ctx
->remote_ip6
[1], 1) != 0 ||
498 LSB(ctx
->remote_ip6
[1], 2) != 0 || LSB(ctx
->remote_ip6
[1], 3) != 0 ||
499 LSB(ctx
->remote_ip6
[2], 0) != 0 || LSB(ctx
->remote_ip6
[2], 1) != 0 ||
500 LSB(ctx
->remote_ip6
[2], 2) != 0 || LSB(ctx
->remote_ip6
[2], 3) != 0 ||
501 LSB(ctx
->remote_ip6
[3], 0) != 0 || LSB(ctx
->remote_ip6
[3], 1) != 0 ||
502 LSB(ctx
->remote_ip6
[3], 2) != 0 || LSB(ctx
->remote_ip6
[3], 3) != 0)
504 if (LSW(ctx
->remote_ip6
[0], 0) != 0 || LSW(ctx
->remote_ip6
[0], 1) != 0 ||
505 LSW(ctx
->remote_ip6
[1], 0) != 0 || LSW(ctx
->remote_ip6
[1], 1) != 0 ||
506 LSW(ctx
->remote_ip6
[2], 0) != 0 || LSW(ctx
->remote_ip6
[2], 1) != 0 ||
507 LSW(ctx
->remote_ip6
[3], 0) != 0 || LSW(ctx
->remote_ip6
[3], 1) != 0)
510 if (LSB(ctx
->local_ip6
[0], 0) != 0 || LSB(ctx
->local_ip6
[0], 1) != 0 ||
511 LSB(ctx
->local_ip6
[0], 2) != 0 || LSB(ctx
->local_ip6
[0], 3) != 0 ||
512 LSB(ctx
->local_ip6
[1], 0) != 0 || LSB(ctx
->local_ip6
[1], 1) != 0 ||
513 LSB(ctx
->local_ip6
[1], 2) != 0 || LSB(ctx
->local_ip6
[1], 3) != 0 ||
514 LSB(ctx
->local_ip6
[2], 0) != 0 || LSB(ctx
->local_ip6
[2], 1) != 0 ||
515 LSB(ctx
->local_ip6
[2], 2) != 0 || LSB(ctx
->local_ip6
[2], 3) != 0 ||
516 LSB(ctx
->local_ip6
[3], 0) != 0 || LSB(ctx
->local_ip6
[3], 1) != 0 ||
517 LSB(ctx
->local_ip6
[3], 2) != 0 || LSB(ctx
->local_ip6
[3], 3) != 0)
519 if (LSW(ctx
->remote_ip6
[0], 0) != 0 || LSW(ctx
->remote_ip6
[0], 1) != 0 ||
520 LSW(ctx
->remote_ip6
[1], 0) != 0 || LSW(ctx
->remote_ip6
[1], 1) != 0 ||
521 LSW(ctx
->remote_ip6
[2], 0) != 0 || LSW(ctx
->remote_ip6
[2], 1) != 0 ||
522 LSW(ctx
->remote_ip6
[3], 0) != 0 || LSW(ctx
->remote_ip6
[3], 1) != 0)
526 /* Success, redirect to KEY_SERVER_B */
527 sk
= bpf_map_lookup_elem(&redir_map
, &KEY_SERVER_B
);
529 bpf_sk_assign(ctx
, sk
, 0);
535 /* Check that sk_assign rejects SERVER_A socket with -ESOCKNOSUPPORT */
536 SEC("sk_lookup/sk_assign_esocknosupport")
537 int sk_assign_esocknosupport(struct bpf_sk_lookup
*ctx
)
543 sk
= bpf_map_lookup_elem(&redir_map
, &KEY_SERVER_A
);
547 err
= bpf_sk_assign(ctx
, sk
, 0);
548 if (err
!= -ESOCKTNOSUPPORT
) {
549 bpf_printk("sk_assign returned %d, expected %d\n",
550 err
, -ESOCKTNOSUPPORT
);
554 ret
= SK_PASS
; /* Success, pass to regular lookup */
561 SEC("sk_lookup/multi_prog_pass1")
562 int multi_prog_pass1(struct bpf_sk_lookup
*ctx
)
564 bpf_map_update_elem(&run_map
, &KEY_PROG1
, &PROG_DONE
, BPF_ANY
);
568 SEC("sk_lookup/multi_prog_pass2")
569 int multi_prog_pass2(struct bpf_sk_lookup
*ctx
)
571 bpf_map_update_elem(&run_map
, &KEY_PROG2
, &PROG_DONE
, BPF_ANY
);
575 SEC("sk_lookup/multi_prog_drop1")
576 int multi_prog_drop1(struct bpf_sk_lookup
*ctx
)
578 bpf_map_update_elem(&run_map
, &KEY_PROG1
, &PROG_DONE
, BPF_ANY
);
582 SEC("sk_lookup/multi_prog_drop2")
583 int multi_prog_drop2(struct bpf_sk_lookup
*ctx
)
585 bpf_map_update_elem(&run_map
, &KEY_PROG2
, &PROG_DONE
, BPF_ANY
);
589 static __always_inline
int select_server_a(struct bpf_sk_lookup
*ctx
)
594 sk
= bpf_map_lookup_elem(&redir_map
, &KEY_SERVER_A
);
598 err
= bpf_sk_assign(ctx
, sk
, 0);
606 SEC("sk_lookup/multi_prog_redir1")
607 int multi_prog_redir1(struct bpf_sk_lookup
*ctx
)
611 ret
= select_server_a(ctx
);
612 bpf_map_update_elem(&run_map
, &KEY_PROG1
, &PROG_DONE
, BPF_ANY
);
616 SEC("sk_lookup/multi_prog_redir2")
617 int multi_prog_redir2(struct bpf_sk_lookup
*ctx
)
621 ret
= select_server_a(ctx
);
622 bpf_map_update_elem(&run_map
, &KEY_PROG2
, &PROG_DONE
, BPF_ANY
);
626 char _license
[] SEC("license") = "Dual BSD/GPL";
627 __u32 _version
SEC("version") = 1;