Skip to content

Commit e0ffdbc

Browse files
Liping Zhangummakynes
authored andcommitted
netfilter: nft_fib_ipv4: initialize *dest to zero
Otherwise, if fib lookup fail, *dest will be filled with garbage value, so reverse path filtering will not work properly: # nft add rule x prerouting fib saddr oif eq 0 drop Fixes: f6d0cbc ("netfilter: nf_tables: add fib expression") Signed-off-by: Liping Zhang <[email protected]> Acked-by: Florian Westphal <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 1158343 commit e0ffdbc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/ipv4/netfilter/nft_fib_ipv4.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ void nft_fib4_eval(const struct nft_expr *expr, struct nft_regs *regs,
122122
fl4.saddr = get_saddr(iph->daddr);
123123
}
124124

125+
*dest = 0;
126+
125127
if (fib_lookup(nft_net(pkt), &fl4, &res, FIB_LOOKUP_IGNORE_LINKSTATE))
126128
return;
127129

0 commit comments

Comments
 (0)