Lines Matching +full:0 +full:xfd000000
15 bpf_htonl((((__u32)(a) & 0xffU) << 24) | \
16 (((__u32)(b) & 0xffU) << 16) | \
17 (((__u32)(c) & 0xffU) << 8) | \
18 (((__u32)(d) & 0xffU) << 0))
50 PROG1 = 0,
55 SERVER_A = 0,
68 static const __u32 SRC_IP4 = IP4(127, 0, 0, 2);
69 static const __u32 SRC_IP6[] = IP6(0xfd000000, 0x0, 0x0, 0x00000002);
72 static const __u32 DST_IP4 = IP4(127, 0, 0, 1);
73 static const __u32 DST_IP6[] = IP6(0xfd000000, 0x0, 0x0, 0x00000001);
107 /* Redirect packets destined for port DST_PORT to socket at redir_map[0]. */
121 err = bpf_sk_assign(ctx, sk, 0); in redir_port()
126 /* Redirect packets destined for DST_IP4 address to socket at redir_map[0]. */
144 err = bpf_sk_assign(ctx, sk, 0); in redir_ip4()
149 /* Redirect packets destined for DST_IP6 address to socket at redir_map[0]. */
160 if (ctx->local_ip6[0] != DST_IP6[0] || in redir_ip6()
170 err = bpf_sk_assign(ctx, sk, 0); in redir_ip6()
185 err = bpf_sk_assign(ctx, sk, 0); in select_sock_a()
211 err = bpf_sk_select_reuseport(ctx, &redir_map, &key, 0); in select_sock_b()
226 err = bpf_sk_assign(ctx, sk, 0); in sk_assign_eexist()
234 err = bpf_sk_assign(ctx, sk, 0); in sk_assign_eexist()
259 err = bpf_sk_assign(ctx, sk, 0); in sk_assign_replace_flag()
269 bpf_printk("sk_assign returned %d, expected 0\n", err); in sk_assign_replace_flag()
289 err = bpf_sk_assign(ctx, NULL, 0); in sk_assign_null()
291 bpf_printk("sk_assign returned %d, expected 0\n", err); in sk_assign_null()
300 bpf_printk("sk_assign returned %d, expected 0\n", err); in sk_assign_null()
306 err = bpf_sk_assign(ctx, NULL, 0); in sk_assign_null()
340 err = bpf_sk_assign(ctx, sk1, 0); in access_ctx_sk()
400 if (LSB(ctx->family, 0) != (v4 ? AF_INET : AF_INET6) || in ctx_narrow_access()
401 LSB(ctx->family, 1) != 0 || LSB(ctx->family, 2) != 0 || LSB(ctx->family, 3) != 0) in ctx_narrow_access()
403 if (LSW(ctx->family, 0) != (v4 ? AF_INET : AF_INET6)) in ctx_narrow_access()
407 if (LSB(ctx->protocol, 0) != IPPROTO_TCP || in ctx_narrow_access()
408 LSB(ctx->protocol, 1) != 0 || LSB(ctx->protocol, 2) != 0 || LSB(ctx->protocol, 3) != 0) in ctx_narrow_access()
410 if (LSW(ctx->protocol, 0) != IPPROTO_TCP) in ctx_narrow_access()
414 if (LSB(ctx->remote_port, 0) != ((SRC_PORT >> 0) & 0xff) || in ctx_narrow_access()
415 LSB(ctx->remote_port, 1) != ((SRC_PORT >> 8) & 0xff)) in ctx_narrow_access()
417 if (LSW(ctx->remote_port, 0) != SRC_PORT) in ctx_narrow_access()
432 if (LSB(ctx->local_port, 0) != ((DST_PORT >> 0) & 0xff) || in ctx_narrow_access()
433 LSB(ctx->local_port, 1) != ((DST_PORT >> 8) & 0xff) || in ctx_narrow_access()
434 LSB(ctx->local_port, 2) != 0 || LSB(ctx->local_port, 3) != 0) in ctx_narrow_access()
436 if (LSW(ctx->local_port, 0) != DST_PORT) in ctx_narrow_access()
442 if (LSB(ctx->remote_ip4, 0) != ((SRC_IP4 >> 0) & 0xff) || in ctx_narrow_access()
443 LSB(ctx->remote_ip4, 1) != ((SRC_IP4 >> 8) & 0xff) || in ctx_narrow_access()
444 LSB(ctx->remote_ip4, 2) != ((SRC_IP4 >> 16) & 0xff) || in ctx_narrow_access()
445 LSB(ctx->remote_ip4, 3) != ((SRC_IP4 >> 24) & 0xff)) in ctx_narrow_access()
447 if (LSW(ctx->remote_ip4, 0) != ((SRC_IP4 >> 0) & 0xffff) || in ctx_narrow_access()
448 LSW(ctx->remote_ip4, 1) != ((SRC_IP4 >> 16) & 0xffff)) in ctx_narrow_access()
452 if (LSB(ctx->local_ip4, 0) != ((DST_IP4 >> 0) & 0xff) || in ctx_narrow_access()
453 LSB(ctx->local_ip4, 1) != ((DST_IP4 >> 8) & 0xff) || in ctx_narrow_access()
454 LSB(ctx->local_ip4, 2) != ((DST_IP4 >> 16) & 0xff) || in ctx_narrow_access()
455 LSB(ctx->local_ip4, 3) != ((DST_IP4 >> 24) & 0xff)) in ctx_narrow_access()
457 if (LSW(ctx->local_ip4, 0) != ((DST_IP4 >> 0) & 0xffff) || in ctx_narrow_access()
458 LSW(ctx->local_ip4, 1) != ((DST_IP4 >> 16) & 0xffff)) in ctx_narrow_access()
462 if (LSB(ctx->remote_ip4, 0) != 0 || LSB(ctx->remote_ip4, 1) != 0 || in ctx_narrow_access()
463 LSB(ctx->remote_ip4, 2) != 0 || LSB(ctx->remote_ip4, 3) != 0) in ctx_narrow_access()
465 if (LSW(ctx->remote_ip4, 0) != 0 || LSW(ctx->remote_ip4, 1) != 0) in ctx_narrow_access()
468 if (LSB(ctx->local_ip4, 0) != 0 || LSB(ctx->local_ip4, 1) != 0 || in ctx_narrow_access()
469 LSB(ctx->local_ip4, 2) != 0 || LSB(ctx->local_ip4, 3) != 0) in ctx_narrow_access()
471 if (LSW(ctx->local_ip4, 0) != 0 || LSW(ctx->local_ip4, 1) != 0) in ctx_narrow_access()
478 if (LSB(ctx->remote_ip6[0], 0) != ((SRC_IP6[0] >> 0) & 0xff) || in ctx_narrow_access()
479 LSB(ctx->remote_ip6[0], 1) != ((SRC_IP6[0] >> 8) & 0xff) || in ctx_narrow_access()
480 LSB(ctx->remote_ip6[0], 2) != ((SRC_IP6[0] >> 16) & 0xff) || in ctx_narrow_access()
481 LSB(ctx->remote_ip6[0], 3) != ((SRC_IP6[0] >> 24) & 0xff) || in ctx_narrow_access()
482 LSB(ctx->remote_ip6[1], 0) != ((SRC_IP6[1] >> 0) & 0xff) || in ctx_narrow_access()
483 LSB(ctx->remote_ip6[1], 1) != ((SRC_IP6[1] >> 8) & 0xff) || in ctx_narrow_access()
484 LSB(ctx->remote_ip6[1], 2) != ((SRC_IP6[1] >> 16) & 0xff) || in ctx_narrow_access()
485 LSB(ctx->remote_ip6[1], 3) != ((SRC_IP6[1] >> 24) & 0xff) || in ctx_narrow_access()
486 LSB(ctx->remote_ip6[2], 0) != ((SRC_IP6[2] >> 0) & 0xff) || in ctx_narrow_access()
487 LSB(ctx->remote_ip6[2], 1) != ((SRC_IP6[2] >> 8) & 0xff) || in ctx_narrow_access()
488 LSB(ctx->remote_ip6[2], 2) != ((SRC_IP6[2] >> 16) & 0xff) || in ctx_narrow_access()
489 LSB(ctx->remote_ip6[2], 3) != ((SRC_IP6[2] >> 24) & 0xff) || in ctx_narrow_access()
490 LSB(ctx->remote_ip6[3], 0) != ((SRC_IP6[3] >> 0) & 0xff) || in ctx_narrow_access()
491 LSB(ctx->remote_ip6[3], 1) != ((SRC_IP6[3] >> 8) & 0xff) || in ctx_narrow_access()
492 LSB(ctx->remote_ip6[3], 2) != ((SRC_IP6[3] >> 16) & 0xff) || in ctx_narrow_access()
493 LSB(ctx->remote_ip6[3], 3) != ((SRC_IP6[3] >> 24) & 0xff)) in ctx_narrow_access()
495 if (LSW(ctx->remote_ip6[0], 0) != ((SRC_IP6[0] >> 0) & 0xffff) || in ctx_narrow_access()
496 LSW(ctx->remote_ip6[0], 1) != ((SRC_IP6[0] >> 16) & 0xffff) || in ctx_narrow_access()
497 LSW(ctx->remote_ip6[1], 0) != ((SRC_IP6[1] >> 0) & 0xffff) || in ctx_narrow_access()
498 LSW(ctx->remote_ip6[1], 1) != ((SRC_IP6[1] >> 16) & 0xffff) || in ctx_narrow_access()
499 LSW(ctx->remote_ip6[2], 0) != ((SRC_IP6[2] >> 0) & 0xffff) || in ctx_narrow_access()
500 LSW(ctx->remote_ip6[2], 1) != ((SRC_IP6[2] >> 16) & 0xffff) || in ctx_narrow_access()
501 LSW(ctx->remote_ip6[3], 0) != ((SRC_IP6[3] >> 0) & 0xffff) || in ctx_narrow_access()
502 LSW(ctx->remote_ip6[3], 1) != ((SRC_IP6[3] >> 16) & 0xffff)) in ctx_narrow_access()
505 if (LSB(ctx->local_ip6[0], 0) != ((DST_IP6[0] >> 0) & 0xff) || in ctx_narrow_access()
506 LSB(ctx->local_ip6[0], 1) != ((DST_IP6[0] >> 8) & 0xff) || in ctx_narrow_access()
507 LSB(ctx->local_ip6[0], 2) != ((DST_IP6[0] >> 16) & 0xff) || in ctx_narrow_access()
508 LSB(ctx->local_ip6[0], 3) != ((DST_IP6[0] >> 24) & 0xff) || in ctx_narrow_access()
509 LSB(ctx->local_ip6[1], 0) != ((DST_IP6[1] >> 0) & 0xff) || in ctx_narrow_access()
510 LSB(ctx->local_ip6[1], 1) != ((DST_IP6[1] >> 8) & 0xff) || in ctx_narrow_access()
511 LSB(ctx->local_ip6[1], 2) != ((DST_IP6[1] >> 16) & 0xff) || in ctx_narrow_access()
512 LSB(ctx->local_ip6[1], 3) != ((DST_IP6[1] >> 24) & 0xff) || in ctx_narrow_access()
513 LSB(ctx->local_ip6[2], 0) != ((DST_IP6[2] >> 0) & 0xff) || in ctx_narrow_access()
514 LSB(ctx->local_ip6[2], 1) != ((DST_IP6[2] >> 8) & 0xff) || in ctx_narrow_access()
515 LSB(ctx->local_ip6[2], 2) != ((DST_IP6[2] >> 16) & 0xff) || in ctx_narrow_access()
516 LSB(ctx->local_ip6[2], 3) != ((DST_IP6[2] >> 24) & 0xff) || in ctx_narrow_access()
517 LSB(ctx->local_ip6[3], 0) != ((DST_IP6[3] >> 0) & 0xff) || in ctx_narrow_access()
518 LSB(ctx->local_ip6[3], 1) != ((DST_IP6[3] >> 8) & 0xff) || in ctx_narrow_access()
519 LSB(ctx->local_ip6[3], 2) != ((DST_IP6[3] >> 16) & 0xff) || in ctx_narrow_access()
520 LSB(ctx->local_ip6[3], 3) != ((DST_IP6[3] >> 24) & 0xff)) in ctx_narrow_access()
522 if (LSW(ctx->local_ip6[0], 0) != ((DST_IP6[0] >> 0) & 0xffff) || in ctx_narrow_access()
523 LSW(ctx->local_ip6[0], 1) != ((DST_IP6[0] >> 16) & 0xffff) || in ctx_narrow_access()
524 LSW(ctx->local_ip6[1], 0) != ((DST_IP6[1] >> 0) & 0xffff) || in ctx_narrow_access()
525 LSW(ctx->local_ip6[1], 1) != ((DST_IP6[1] >> 16) & 0xffff) || in ctx_narrow_access()
526 LSW(ctx->local_ip6[2], 0) != ((DST_IP6[2] >> 0) & 0xffff) || in ctx_narrow_access()
527 LSW(ctx->local_ip6[2], 1) != ((DST_IP6[2] >> 16) & 0xffff) || in ctx_narrow_access()
528 LSW(ctx->local_ip6[3], 0) != ((DST_IP6[3] >> 0) & 0xffff) || in ctx_narrow_access()
529 LSW(ctx->local_ip6[3], 1) != ((DST_IP6[3] >> 16) & 0xffff)) in ctx_narrow_access()
533 if (LSB(ctx->remote_ip6[0], 0) != 0 || LSB(ctx->remote_ip6[0], 1) != 0 || in ctx_narrow_access()
534 LSB(ctx->remote_ip6[0], 2) != 0 || LSB(ctx->remote_ip6[0], 3) != 0 || in ctx_narrow_access()
535 LSB(ctx->remote_ip6[1], 0) != 0 || LSB(ctx->remote_ip6[1], 1) != 0 || in ctx_narrow_access()
536 LSB(ctx->remote_ip6[1], 2) != 0 || LSB(ctx->remote_ip6[1], 3) != 0 || in ctx_narrow_access()
537 LSB(ctx->remote_ip6[2], 0) != 0 || LSB(ctx->remote_ip6[2], 1) != 0 || in ctx_narrow_access()
538 LSB(ctx->remote_ip6[2], 2) != 0 || LSB(ctx->remote_ip6[2], 3) != 0 || in ctx_narrow_access()
539 LSB(ctx->remote_ip6[3], 0) != 0 || LSB(ctx->remote_ip6[3], 1) != 0 || in ctx_narrow_access()
540 LSB(ctx->remote_ip6[3], 2) != 0 || LSB(ctx->remote_ip6[3], 3) != 0) in ctx_narrow_access()
542 if (LSW(ctx->remote_ip6[0], 0) != 0 || LSW(ctx->remote_ip6[0], 1) != 0 || in ctx_narrow_access()
543 LSW(ctx->remote_ip6[1], 0) != 0 || LSW(ctx->remote_ip6[1], 1) != 0 || in ctx_narrow_access()
544 LSW(ctx->remote_ip6[2], 0) != 0 || LSW(ctx->remote_ip6[2], 1) != 0 || in ctx_narrow_access()
545 LSW(ctx->remote_ip6[3], 0) != 0 || LSW(ctx->remote_ip6[3], 1) != 0) in ctx_narrow_access()
548 if (LSB(ctx->local_ip6[0], 0) != 0 || LSB(ctx->local_ip6[0], 1) != 0 || in ctx_narrow_access()
549 LSB(ctx->local_ip6[0], 2) != 0 || LSB(ctx->local_ip6[0], 3) != 0 || in ctx_narrow_access()
550 LSB(ctx->local_ip6[1], 0) != 0 || LSB(ctx->local_ip6[1], 1) != 0 || in ctx_narrow_access()
551 LSB(ctx->local_ip6[1], 2) != 0 || LSB(ctx->local_ip6[1], 3) != 0 || in ctx_narrow_access()
552 LSB(ctx->local_ip6[2], 0) != 0 || LSB(ctx->local_ip6[2], 1) != 0 || in ctx_narrow_access()
553 LSB(ctx->local_ip6[2], 2) != 0 || LSB(ctx->local_ip6[2], 3) != 0 || in ctx_narrow_access()
554 LSB(ctx->local_ip6[3], 0) != 0 || LSB(ctx->local_ip6[3], 1) != 0 || in ctx_narrow_access()
555 LSB(ctx->local_ip6[3], 2) != 0 || LSB(ctx->local_ip6[3], 3) != 0) in ctx_narrow_access()
557 if (LSW(ctx->remote_ip6[0], 0) != 0 || LSW(ctx->remote_ip6[0], 1) != 0 || in ctx_narrow_access()
558 LSW(ctx->remote_ip6[1], 0) != 0 || LSW(ctx->remote_ip6[1], 1) != 0 || in ctx_narrow_access()
559 LSW(ctx->remote_ip6[2], 0) != 0 || LSW(ctx->remote_ip6[2], 1) != 0 || in ctx_narrow_access()
560 LSW(ctx->remote_ip6[3], 0) != 0 || LSW(ctx->remote_ip6[3], 1) != 0) in ctx_narrow_access()
567 bpf_sk_assign(ctx, sk, 0); in ctx_narrow_access()
585 err = bpf_sk_assign(ctx, sk, 0); in sk_assign_esocknosupport()
636 err = bpf_sk_assign(ctx, sk, 0); in select_server_a()