I believe that Netfilter will do this for you. Look at:
Owner match support (EXPERIMENTAL)
CONFIG_IP_NF_MATCH_OWNER
Packet owner matching allows you to match locally-generated packets
based on who created them: the user, group, process or session.
If you want to compile it as a module, say M here and read
Documentation/modules.txt. If unsure, say `N'.
-- Russell King (rmk@arm.linux.org.uk) The developer of ARM Linux http://www.arm.linux.org.uk/personal/aboutme.html- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/