h2o_socket_ebpf_lookup_flags: do not abort when eBPF map operations fail
@@ -1774,20 +1774,17 @@ uint64_t h2o_socket_ebpf_lookup_flags(h2o_loop_t *loop, int (*init_key)(h2o_ebpf
// make sure a possible old flags is not set,
// otherwise the subsequent logic will be unreliable.
- if (ebpf_map_delete(return_map_fd, &tid) != 0) {
- if (errno != ENOENT) {
- char buf[128];
- h2o_fatal("BPF_MAP_DELETE failed: %s", h2o_strerror_r(errno, buf, sizeof(buf)));
- }
- }
+ if (ebpf_map_delete(return_map_fd, &tid) == 0) {
H2O_SOCKET_LOOKUP_FLAGS(tid, flags, &key);
if (ebpf_map_lookup(return_map_fd, &tid, &flags) != 0) {
if (errno == ENOENT)
h2o_error_printf(
- "Warning: BPF handler for h2o:socket_lookup did not set a return flags via h2o_return map");
+ "Warning: BPF handler for h2o:socket_lookup_flags did not set return flags via h2o_return map");
else
h2o_perror("BPF_MAP_LOOKUP failed");
}
+ } else if (errno != ENOENT)
+ h2o_perror("BPF_MAP_DELETE failed");
}
}
