From: Liping Zhang <[email protected]>

Otherwise, DHCP Discover packets(0.0.0.0->255.255.255.255) may be
dropped incorrectly.

Signed-off-by: Liping Zhang <[email protected]>
Acked-by: Florian Westphal <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>

https://jira.sw.ru/browse/PSBM-125002
(cherry picked from commit 3b760dcb0fd304873dfde9ff072a49f893c6f5c4)
Signed-off-by: Pavel Tikhomirov <[email protected]>
---
 net/ipv4/netfilter/nft_fib_ipv4.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/net/ipv4/netfilter/nft_fib_ipv4.c 
b/net/ipv4/netfilter/nft_fib_ipv4.c
index 1c82b94a88158..d938edfc06c90 100644
--- a/net/ipv4/netfilter/nft_fib_ipv4.c
+++ b/net/ipv4/netfilter/nft_fib_ipv4.c
@@ -101,12 +101,13 @@ void nft_fib4_eval(const struct nft_expr *expr, struct 
nft_regs *regs,
        }
 
        iph = ip_hdr(pkt->skb);
-       if (ipv4_is_multicast(iph->daddr) &&
-           ipv4_is_zeronet(iph->saddr) &&
-           ipv4_is_local_multicast(iph->daddr)) {
-               nft_fib_store_result(dest, priv->result, pkt,
-                                    get_ifindex(pkt->skb->dev));
-               return;
+       if (ipv4_is_zeronet(iph->saddr)) {
+               if (ipv4_is_lbcast(iph->daddr) ||
+                   ipv4_is_local_multicast(iph->daddr)) {
+                       nft_fib_store_result(dest, priv->result, pkt,
+                                            get_ifindex(pkt->skb->dev));
+                       return;
+               }
        }
 
        if (priv->flags & NFTA_FIB_F_MARK)
-- 
2.26.2

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to