net/ipv4: Initialize proto and ports in flow struct
Updating the FIB tracepoint for the recent change to allow rules using
the protocol and ports exposed a few places where the entries in the flow
struct are not initialized.
For __fib_validate_source add the call to fib4_rules_early_flow_dissect
since it is invoked for the input path. For netfilter, add the memset on
the flow struct to avoid future problems like this. In ip_route_input_slow
need to set the fields if the skb dissection does not happen.
Fixes: bfff486265
("net: fib_rules: support for match on ip_proto, sport and dport")
Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
8ab6ffba14
commit
5a847a6e14
@@ -1961,8 +1961,13 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
|
||||
fl4.saddr = saddr;
|
||||
fl4.flowi4_uid = sock_net_uid(net, NULL);
|
||||
|
||||
if (fib4_rules_early_flow_dissect(net, skb, &fl4, &_flkeys))
|
||||
if (fib4_rules_early_flow_dissect(net, skb, &fl4, &_flkeys)) {
|
||||
flkeys = &_flkeys;
|
||||
} else {
|
||||
fl4.flowi4_proto = 0;
|
||||
fl4.fl4_sport = 0;
|
||||
fl4.fl4_dport = 0;
|
||||
}
|
||||
|
||||
err = fib_lookup(net, &fl4, res, 0);
|
||||
if (err != 0) {
|
||||
|
Reference in New Issue
Block a user