Lance Yang <lance.yang@xxxxxxxxx> wrote: > > There is no need for 'syslog' to be active for 'log_invalid' to be > > useful as long as the system in question has e.g. ulogd running > > and listening to nflog messages. > > > > If anything, the modprobe should be done only when no logger > > is registered. > > Yes, could we load the module only when no logger exists? Something > like: > > + if (nf_logger_find_get(NFPROTO_IPV4, NF_LOG_TYPE_LOG) != 0) > + request_module("%s", "nf_log_syslog"); This function bumps the module refcount, so if the logger exists you would need to call nf_logger_put() too. I'd add a new, simpler helper, that only returns if any logger is active. bool nf_log_is_registered(int pf); or something like that.