Skip to content

Commit

Permalink
net: fib_rules: do not flow dissect local packets
Browse files Browse the repository at this point in the history
Rules matching on loopback iif do not need early flow dissection as the
packet originates from the host. Stop counting such rules in
fib_rule_requires_fldissect

Signed-off-by: Petar Penkov <ppenkov@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Petar Penkov authored and David S. Miller committed Jul 11, 2019
1 parent a131c2b commit 63f9ba1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/net/fib_rules.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ static inline bool fib_rule_port_range_compare(struct fib_rule_port_range *a,

static inline bool fib_rule_requires_fldissect(struct fib_rule *rule)
{
return rule->ip_proto ||
return rule->iifindex != LOOPBACK_IFINDEX && (rule->ip_proto ||
fib_rule_port_range_set(&rule->sport_range) ||
fib_rule_port_range_set(&rule->dport_range);
fib_rule_port_range_set(&rule->dport_range));
}

struct fib_rules_ops *fib_rules_register(const struct fib_rules_ops *,
Expand Down

0 comments on commit 63f9ba1

Please sign in to comment.