Skip to content

fix(bpf): UPF eBPF FAR Program crashing due to non-check of the return value for `bpf_map_lookup_element`

Franck MESSAOUDI requested to merge fix-bpf_map_lookup_return_value into develop

Signed-off-by: Franck Messaoudi franck.messaoudi@openairinterface.org

This merge is fixing the crash of UPF eBPF FAR Program due to the non check of the return value for bpf_map_lookup_element:

map_element = bpf_map_lookup_elem(&m_upf_interfaces, &reference); if (map_element != NULL) { p_ip->saddr = map_element->ipv4_address; bpf_debug("Map Values: IP:%d, port:%d\n", map_element->ipv4_address, map_element->port); bpf_debug("IP SRC:%d\n", p_ip->saddr); } else { bpf_debug("N3 Interface NOT Found! \n"); return XDP_DROP; }

Merge request reports