Skip to contentSkip to conversation

nf_log: Add stackable loggers support

PATCH New Gregor Maier 1 participant 1 message Feb 28, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nf_log: Add stackable loggers support

Hello,

Here's a patch that will add support for stackable loggers to nf_log.c

Sorry for not RTFM the FAQ on how to submit patches in the first place.

cu
Gregor

=================================================================
[PATCH] nf_log: Add support for stackable loggers

More than one logger can be registered per PF. Registered loggers are stored in a list. nf_log_unregister_pf needs the logger to unregister as second parameter. nf_log_register still return -EEXIST if the logger is already registered.
To be able to register a logger to more than one PF a container struct nf_logging_node is used as nodes in the list.
The /proc interface will display all registered logger seperated by spaces

include/linux/netfilter.h +1 -1
diff -aur linux-2.6.16-rc4.orig/include/linux/netfilter.h linux-2.6.16-rc4.yyy/include/linux/netfilter.h
@@ -157,7 +157,7 @@
 
 /* Function to register/unregister log function. */
 int nf_log_register(int pf, struct nf_logger *logger);
-int nf_log_unregister_pf(int pf);
+int nf_log_unregister_pf(int pf, struct nf_logger *logger);
 void nf_log_unregister_logger(struct nf_logger *logger);
 
 /* Calls the registered backend logging function */
net/netfilter/nf_log.c +72 -30

179 lines not on this page · raw message

net/netfilter/nfnetlink_log.c +1 -1
diff -aur linux-2.6.16-rc4.orig/net/netfilter/nfnetlink_log.c linux-2.6.16-rc4.yyy/net/netfilter/nfnetlink_log.c
@@ -808,7 +808,7 @@
 			UDEBUG("unregistering log handler for pf=%u\n", pf);
 			/* This is a bug and a feature.  We cannot unregister
 			 * other handlers, like nfnetlink_inst can */
-			nf_log_unregister_pf(pf);
+			nf_log_unregister_pf(pf, &nfulnl_logger);
 			break;
 		default:
 			ret = -EINVAL;