Enable support for SO_MARK on Linux via compile-time flag#38
Enable support for SO_MARK on Linux via compile-time flag#38grandrew wants to merge 2 commits intorofl0r:masterfrom
Conversation
|
i'm not very happy with this PR tbh, not only is it linux-specific, it clutters the entire code with ifdefs. this could be done a lot less intrusive in the style the existing config_log option is implemented with a single ifdef block that defines a function mark_packet() which does the call, or is nop if compiled out, same for a couple defines for string pieces like but then the question is whether what is done here couldnt be achieved by other means, for example making your iptables rule based on port of outgoing packet, pid, using a virtual interface that's used for binding only the proxy, etc. |
|
Thanks for the feedback and the styling ideas! I can fix to match Let's discuss the rationale. If you're going to achieve same policybased routing using nftables you would need to:
Having SO_MARK support directly in microsocks is what I expected from a "micro" way of doing a proxy |
This adds the
-m <mark_id>option. SO_MARK allows to "mark" all outgoing packets with Linux-stack internal "tag". This enables the Linux network rules to identify these packets and make all sorts of decisions regarding routing and other packet processing.Special compile flag is needed to enable.