diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2014-05-13 13:17:33 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-13 18:35:08 -0400 |
commit | e110861f86094cd78cc85593b873970092deb43a (patch) | |
tree | 535ecba8f65cefb68da0846ff54801bb32bf3c9e /net/ipv4/sysctl_net_ipv4.c | |
parent | 87e067cda6df60b55cea0239c2f3cee81e9f46df (diff) |
net: add a sysctl to reflect the fwmark on replies
Kernel-originated IP packets that have no user socket associated
with them (e.g., ICMP errors and echo replies, TCP RSTs, etc.)
are emitted with a mark of zero. Add a sysctl to make them have
the same mark as the packet they are replying to.
This allows an administrator that wishes to do so to use
mark-based routing, firewalling, etc. for these replies by
marking the original packets inbound.
Tested using user-mode linux:
- ICMP/ICMPv6 echo replies and errors.
- TCP RST packets (IPv4 and IPv6).
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/sysctl_net_ipv4.c')
-rw-r--r-- | net/ipv4/sysctl_net_ipv4.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index 5cde8f263d40..f50d51850285 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c | |||
@@ -838,6 +838,13 @@ static struct ctl_table ipv4_net_table[] = { | |||
838 | .mode = 0644, | 838 | .mode = 0644, |
839 | .proc_handler = proc_dointvec, | 839 | .proc_handler = proc_dointvec, |
840 | }, | 840 | }, |
841 | { | ||
842 | .procname = "fwmark_reflect", | ||
843 | .data = &init_net.ipv4.sysctl_fwmark_reflect, | ||
844 | .maxlen = sizeof(int), | ||
845 | .mode = 0644, | ||
846 | .proc_handler = proc_dointvec, | ||
847 | }, | ||
841 | { } | 848 | { } |
842 | }; | 849 | }; |
843 | 850 | ||