summaryrefslogtreecommitdiffstats
path: root/net/ipv4/netfilter
diff options
context:
space:
mode:
authorPau Espin Pedrol <pau.espin@tessares.net>2017-01-06 20:33:27 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2017-01-09 18:01:03 +0100
commitcc31d43b4154ad5a7d8aa5543255a93b7e89edc2 (patch)
tree964f49666b06bf3c1cb918aaeb70d5bd6affa74d /net/ipv4/netfilter
parent03430fa10b99e95e3a15eb7c00978fb1652f3b24 (diff)
downloadlinux-cc31d43b4154ad5a7d8aa5543255a93b7e89edc2.tar.gz
linux-cc31d43b4154ad5a7d8aa5543255a93b7e89edc2.tar.xz
netfilter: use fwmark_reflect in nf_send_reset
Otherwise, RST packets generated by ipt_REJECT always have mark 0 when the routing is checked later in the same code path. Fixes: e110861f8609 ("net: add a sysctl to reflect the fwmark on replies") Cc: Lorenzo Colitti <lorenzo@google.com> Signed-off-by: Pau Espin Pedrol <pau.espin@tessares.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/ipv4/netfilter')
-rw-r--r--net/ipv4/netfilter/nf_reject_ipv4.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv4/netfilter/nf_reject_ipv4.c b/net/ipv4/netfilter/nf_reject_ipv4.c
index fd8220213afc..146d86105183 100644
--- a/net/ipv4/netfilter/nf_reject_ipv4.c
+++ b/net/ipv4/netfilter/nf_reject_ipv4.c
@@ -126,6 +126,8 @@ void nf_send_reset(struct net *net, struct sk_buff *oldskb, int hook)
/* ip_route_me_harder expects skb->dst to be set */
skb_dst_set_noref(nskb, skb_dst(oldskb));
+ nskb->mark = IP4_REPLY_MARK(net, oldskb->mark);
+
skb_reserve(nskb, LL_MAX_HEADER);
niph = nf_reject_iphdr_put(nskb, oldskb, IPPROTO_TCP,
ip4_dst_hoplimit(skb_dst(nskb)));