Repository navigation
Commit 8ca3037
bpf, sockmap: Allow inserting listening TCP sockets into sockmap
In order for sockmap/sockhash types to become generic collections for
storing TCP sockets we need to loosen the checks during map update, while
tightening the checks in redirect helpers.
Currently sock{map,hash} require the TCP socket to be in established state,
which prevents inserting listening sockets.
Change the update pre-checks so the socket can also be in listening state.
Since it doesn't make sense to redirect with sock{map,hash} to listening
sockets, add appropriate socket state checks to BPF redirect helpers too.
Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20200218171023.844439-5-jakub@cloudflare.com1 parent e802515 commit 8ca3037
2 files changed
Lines changed: 45 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
394 | | - | |
| 394 | + | |
| 395 | + | |
395 | 396 | | |
396 | 397 | | |
397 | 398 | | |
| |||
400 | 401 | | |
401 | 402 | | |
402 | 403 | | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
403 | 414 | | |
404 | 415 | | |
405 | 416 | | |
| |||
423 | 434 | | |
424 | 435 | | |
425 | 436 | | |
426 | | - | |
| 437 | + | |
427 | 438 | | |
428 | 439 | | |
429 | 440 | | |
| |||
460 | 471 | | |
461 | 472 | | |
462 | 473 | | |
| 474 | + | |
463 | 475 | | |
464 | 476 | | |
465 | 477 | | |
466 | | - | |
467 | | - | |
468 | | - | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
469 | 481 | | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
470 | 485 | | |
471 | 486 | | |
472 | 487 | | |
| |||
483 | 498 | | |
484 | 499 | | |
485 | 500 | | |
| 501 | + | |
| 502 | + | |
486 | 503 | | |
487 | 504 | | |
488 | | - | |
489 | | - | |
490 | | - | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
491 | 508 | | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
492 | 512 | | |
493 | 513 | | |
494 | 514 | | |
| |||
748 | 768 | | |
749 | 769 | | |
750 | 770 | | |
751 | | - | |
| 771 | + | |
752 | 772 | | |
753 | 773 | | |
754 | 774 | | |
| |||
916 | 936 | | |
917 | 937 | | |
918 | 938 | | |
| 939 | + | |
919 | 940 | | |
920 | 941 | | |
921 | 942 | | |
922 | | - | |
923 | | - | |
924 | | - | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
925 | 946 | | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
926 | 950 | | |
927 | 951 | | |
928 | 952 | | |
| |||
939 | 963 | | |
940 | 964 | | |
941 | 965 | | |
| 966 | + | |
| 967 | + | |
942 | 968 | | |
943 | 969 | | |
944 | | - | |
945 | | - | |
946 | | - | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
947 | 973 | | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
948 | 977 | | |
949 | 978 | | |
950 | 979 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
756 | 756 | | |
757 | 757 | | |
758 | 758 | | |
759 | | - | |
760 | | - | |
761 | | - | |
762 | | - | |
763 | | - | |
| 759 | + | |
764 | 760 | | |
765 | 761 | | |
766 | 762 | | |
| |||
0 commit comments