Skip to content

Commit

Permalink
netfilter: nf_flow_table_offload: fix incorrect ethernet dst address
Browse files Browse the repository at this point in the history
Ethernet destination for original traffic takes the source ethernet address
in the reply direction. For reply traffic, this takes the source
ethernet address of the original direction.

Fixes: c29f74e ("netfilter: nf_flow_table: hardware offload support")
Signed-off-by: wenxu <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
  • Loading branch information
wenxu authored and ummakynes committed Jan 5, 2020
1 parent 8ca7960 commit 1b67e50
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/netfilter/nf_flow_table_offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,16 @@ static int flow_offload_eth_dst(struct net *net,
enum flow_offload_tuple_dir dir,
struct nf_flow_rule *flow_rule)
{
const struct flow_offload_tuple *tuple = &flow->tuplehash[dir].tuple;
struct flow_action_entry *entry0 = flow_action_entry_next(flow_rule);
struct flow_action_entry *entry1 = flow_action_entry_next(flow_rule);
const void *daddr = &flow->tuplehash[!dir].tuple.src_v4;
const struct dst_entry *dst_cache;
struct neighbour *n;
u32 mask, val;
u16 val16;

n = dst_neigh_lookup(tuple->dst_cache, &tuple->dst_v4);
dst_cache = flow->tuplehash[dir].tuple.dst_cache;
n = dst_neigh_lookup(dst_cache, daddr);
if (!n)
return -ENOENT;

Expand Down

0 comments on commit 1b67e50

Please sign in to comment.