From 4129938c2164cf5b9063f423fa63e8d3ecba9a1b Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Sun, 17 Mar 2019 19:51:14 +0100 Subject: [PATCH] util-ebpf: log level fixes and code cleaning --- src/util-ebpf.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/util-ebpf.c b/src/util-ebpf.c index 846ecd2ea8..2a918d3148 100644 --- a/src/util-ebpf.c +++ b/src/util-ebpf.c @@ -420,14 +420,14 @@ int EBPFLoadFile(const char *iface, const char *path, const char * section, } bpf_map_data->array[bpf_map_data->last].unlink = 0; if (config->flags & EBPF_PINNED_MAPS) { - SCLogNotice("Pinning: %d to %s", bpf_map_data->array[bpf_map_data->last].fd, + SCLogConfig("Pinning: %d to %s", bpf_map_data->array[bpf_map_data->last].fd, bpf_map_data->array[bpf_map_data->last].name); char buf[1024]; snprintf(buf, sizeof(buf), "/sys/fs/bpf/suricata-%s-%s", iface, bpf_map_data->array[bpf_map_data->last].name); int ret = bpf_obj_pin(bpf_map_data->array[bpf_map_data->last].fd, buf); if (ret != 0) { - SCLogError(SC_ERR_AFP_CREATE, "Can not pin: %s", strerror(errno)); + SCLogWarning(SC_ERR_AFP_CREATE, "Can not pin: %s", strerror(errno)); } /* Don't unlink pinned maps in XDP mode to avoid a state reset */ if (config->flags & EBPF_XDP_CODE) { @@ -778,11 +778,7 @@ int EBPFCheckBypassedFlowTimeout(struct flows_stats *bypassstats, LiveDevice *ldev = NULL, *ndev; struct ebpf_timeout_config *cfg = (struct ebpf_timeout_config *)data; - if (cfg == NULL) { - SCLogError(SC_ERR_INVALID_VALUE, - "Programming error, contact developer"); - return 0; - } + BUG_ON(cfg == NULL); while(LiveDeviceForEach(&ldev, &ndev)) { tcount = EBPFForEachFlowV4Table(ldev, "flow_table_v4",