Skip to content

Commit

Permalink
net/sched: act_ct: Fix adding udp port mangle operation
Browse files Browse the repository at this point in the history
BugLink: https://bugs.launchpad.net/bugs/1902137

[ Upstream commit 47b5d2a ]

Need to use the udp header type and not tcp.

Fixes: 9c26ba9 ("net/sched: act_ct: Instantiate flow table entry actions")
Signed-off-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Paul Blakey <paulb@nvidia.com>
Link: https://lore.kernel.org/r/20201019090244.3015186-1-roid@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Ian May <ian.may@canonical.com>
  • Loading branch information
roidayan authored and smb49 committed Nov 9, 2020
1 parent c7b6d8f commit 480709c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/sched/act_ct.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ tcf_ct_flow_table_add_action_nat_udp(const struct nf_conntrack_tuple *tuple,
__be16 target_dst = target.dst.u.udp.port;

if (target_src != tuple->src.u.udp.port)
tcf_ct_add_mangle_action(action, FLOW_ACT_MANGLE_HDR_TYPE_TCP,
tcf_ct_add_mangle_action(action, FLOW_ACT_MANGLE_HDR_TYPE_UDP,
offsetof(struct udphdr, source),
0xFFFF, be16_to_cpu(target_src));
if (target_dst != tuple->dst.u.udp.port)
tcf_ct_add_mangle_action(action, FLOW_ACT_MANGLE_HDR_TYPE_TCP,
tcf_ct_add_mangle_action(action, FLOW_ACT_MANGLE_HDR_TYPE_UDP,
offsetof(struct udphdr, dest),
0xFFFF, be16_to_cpu(target_dst));
}
Expand Down

0 comments on commit 480709c

Please sign in to comment.