summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
Diffstat (limited to 'src/network')
-rw-r--r--src/network/bpf/sysctl_monitor/sysctl-monitor.bpf.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/network/bpf/sysctl_monitor/sysctl-monitor.bpf.c b/src/network/bpf/sysctl_monitor/sysctl-monitor.bpf.c
index ef154931ce..e0ec8489d2 100644
--- a/src/network/bpf/sysctl_monitor/sysctl-monitor.bpf.c
+++ b/src/network/bpf/sysctl_monitor/sysctl-monitor.bpf.c
@@ -36,23 +36,22 @@ struct str {
static long cut_last(u32 i, struct str *str) {
char *s;
- i = str->l - i - 1;
- s = str->s + i;
-
/* Sanity check for the preverifier */
if (i >= str->l)
- return 1;
+ return 1; /* exit from the loop */
+
+ i = str->l - i - 1;
+ s = str->s + i;
if (*s == 0)
- return 0;
+ return 0; /* continue */
if (*s == '\n' || *s == '\r' || *s == ' ' || *s == '\t') {
*s = 0;
-
- return 0;
+ return 0; /* continue */
}
- return 1;
+ return 1; /* exit from the loop */
}
/* Cut off trailing whitespace and newlines */