Add socket-mark-id support for marking sockets.#10349
Add socket-mark-id support for marking sockets.#10349yossigo merged 6 commits intoredis:unstablefrom
Conversation
1e512b6 to
1f1bb97
Compare
|
@devnexen Generally this looks good to me, but I'd like to consider if this should be a FreeBSD-specific feature or something more generic that we implement also on Linux (as a connection mark maybe? not sure, need to look into that). |
|
that might be a tricky decision indeed, might be a risk to give a false sense of equivalence, so far I have not seen anything even remotely ressemblant on Linux, socket options in this system have very different contexts (but which can be used in redis though but as system specific like controlling thp support in some sense). |
adding the possibility to tag sockets with an ID when netfiltering filters above operates in that level.
1f1bb97 to
b7adc13
Compare
|
finally taking back what I said, I found some equivalence :) |
|
@devnexen It sounded this ID is the equivalent of a conn mark but I didn't have the bandwidth to dig deep and validate, thank you! |
|
Calling @redis/core-team for approval, this is a small change but potentially high value in some environments - see top comments. |
There was a problem hiding this comment.
are we sure we wanna return OK here?
alternatively, maybe we should add an isValid callback to the config, and fail the configuration when this is not supported?
|
In fact Linux is supported (finally). Originally not planned but found a way. |
|
ohh, i missed it. |
There was a problem hiding this comment.
SO_MARK (since Linux 2.6.25)
Check with #ifdef SO_MARK?
b7adc13 to
1c92baa
Compare
1c92baa to
ba1d2e7
Compare
ba1d2e7 to
7487ced
Compare
7487ced to
4d96b47
Compare
* A bit more generalized, OS-agnostic terms. * Avoid any setsockopt() call by default.
|
@devnexen I've slightly modified the PR to be more generalized, and avoid calling |
|
Yes I ve seen it, it s fine by me. |
Add a configuration option to attach an operating system-specific identifier to Redis sockets, supporting advanced network configurations using iptables (Linux) or ipfw (FreeBSD).
Add a configuration option to attach an operating system-specific identifier to Redis sockets, supporting advanced network configurations using iptables (Linux) or ipfw (FreeBSD).