Open LemonCrab666 opened 3 weeks ago
I have the same issue and I find that allow_insert is always false, keeping the database empty. So I modified the code to force it try to insert everytime.
I have the same issue and I find that allow_insert is always false, keeping the database empty. So I modified the code to force it try to insert everytime.
I couldn't find any nlbwmo related repositories on your homepage. Can you share the ones you have modified?Thank you
I use a patch file and it may not be the best solution. Here it is
Index: nlbwmon-2024-02-21-c7616bcf/nfnetlink.c
===================================================================
--- nlbwmon-2024-02-21-c7616bcf.orig/nfnetlink.c
+++ nlbwmon-2024-02-21-c7616bcf/nfnetlink.c
@@ -78,10 +78,9 @@ struct delayed_record {
static void
database_insert_immediately(struct record *r)
{
- if (r->count != 0)
- database_insert(gdbh, r);
- else
- database_update(gdbh, r);
+ int err = 0;
+ err = database_insert(gdbh, r);
+ if (err < 0) fprintf(stderr, "failed to insert, count %lld, err %d\n", r->count, err);
}
static void
I use a patch file and it may not be the best solution. Here it is
Thank you for your contribution
I use a patch file and it may not be the best solution. Here it is
Index: nlbwmon-2024-02-21-c7616bcf/nfnetlink.c =================================================================== --- nlbwmon-2024-02-21-c7616bcf.orig/nfnetlink.c +++ nlbwmon-2024-02-21-c7616bcf/nfnetlink.c @@ -78,10 +78,9 @@ struct delayed_record { static void database_insert_immediately(struct record *r) { - if (r->count != 0) - database_insert(gdbh, r); - else - database_update(gdbh, r); + int err = 0; + err = database_insert(gdbh, r); + if (err < 0) fprintf(stderr, "failed to insert, count %lld, err %d\n", r->count, err); } static void
Do you have connection recorded with this patch.
No connection count either. It seems that any new connection is not captured in my system, thus no count and insert into database. I don't know whether it's a problem of netlink or nlbwmon. The patch just fixes the empty db problem but i don't know how to debug the loss of new connections.
Nlbwmon cannot work immediately after booting on Immortalwrt 23.05.3 When OpenWRT is set to the 1st of the following month, nlbwmon will start working immediately, but it will cease to function after a restart.Can you please advise on how to solve this problem