Re: Fwd: eBPF sockhash datastructure and stream_parser/stream_verdict programs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Let's say I'm writing a simple SOCKS4/4a server(yes, obsolete, but
still does it's job), no authorization(although it wouldn't matter).
So I need to read some data from the client: ip and port and maybe
domain if it's 4A. Then I connect to the ip/domain:port and send a
success response. Meanwhile the IP/Domain:port I connected to, before
sending success to the client might send some data, like if the target
was an SSH server, it sends a version string right away if you connect
to it. So it could be missed if I then put client and target socket
into a sockmap/hash and tell them to redirect traffic to each other.
I've tried very hard to figure out a way to use eBPF stream_verdict or
sk_msg_verdict to redirect traffic right when I need it, but I think
it is impossible. Do I have to do SOCKS4/4A parsing inside
stream_parser and communicate with my userspace program via a ring
buffer about the results? But I'm not sure how that could help with
missing bytes. I guess I got interested after I read that article on
cloudflare blog about sockmap
https://blog.cloudflare.com/sockmap-tcp-splicing-of-the-future/ , but
their example of an echo server is plagued with the same problem, if
you put a delay, before socket addition to a sockmap.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux