Merge tag 'perf-urgent-2022-08-06' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / samples / bpf / xdp_router_ipv4.bpf.c
index 248119c..0643330 100644 (file)
@@ -150,6 +150,15 @@ int xdp_router_ipv4_prog(struct xdp_md *ctx)
 
                                dest_mac = bpf_map_lookup_elem(&arp_table,
                                                               &prefix_value->gw);
+                               if (!dest_mac) {
+                                       /* Forward the packet to the kernel in
+                                        * order to trigger ARP discovery for
+                                        * the default gw.
+                                        */
+                                       if (rec)
+                                               NO_TEAR_INC(rec->xdp_pass);
+                                       return XDP_PASS;
+                               }
                        }
                }