[netfilter-cvslog] r6301 - branches/ulog/ulogd2/input/packet

laforge at netfilter.org laforge at netfilter.org
Thu Dec 8 08:27:08 CET 2005


Author: laforge at netfilter.org
Date: 2005-12-08 08:27:02 +0100 (Thu, 08 Dec 2005)
New Revision: 6301

Modified:
   branches/ulog/ulogd2/input/packet/ulogd_inppkt_NFLOG.c
Log:
more verbose error reporting


Modified: branches/ulog/ulogd2/input/packet/ulogd_inppkt_NFLOG.c
===================================================================
--- branches/ulog/ulogd2/input/packet/ulogd_inppkt_NFLOG.c	2005-12-08 07:25:17 UTC (rev 6300)
+++ branches/ulog/ulogd2/input/packet/ulogd_inppkt_NFLOG.c	2005-12-08 07:27:02 UTC (rev 6301)
@@ -312,22 +312,35 @@
 		goto out_handle;
 
 	if (unbind_ce(upi->config_kset).u.value > 0) {
-		ulogd_log(ULOGD_NOTICE, "forcing unbind of existing log handler for "
-			  "protocol %d\n", af_ce(upi->config_kset).u.value);
-		nflog_unbind_pf(ui->nful_h, af_ce(upi->config_kset).u.value);
+		ulogd_log(ULOGD_NOTICE, "forcing unbind of existing log "
+			  "handler for protocol %d\n", 
+			  af_ce(upi->config_kset).u.value);
+		if (nflog_unbind_pf(ui->nful_h, 
+				    af_ce(upi->config_kset).u.value) < 0) {
+			ulogd_log(ULOGD_ERROR, "unable to force-unbind "
+				  "existing log handler for protocol %d\n",
+			  	  af_ce(upi->config_kset).u.value);
+			goto out_handle;
+		}
 	}
 
 	ulogd_log(ULOGD_DEBUG, "binding to protocol family %d\n",
 		  af_ce(upi->config_kset).u.value);
-	if (nflog_bind_pf(ui->nful_h, af_ce(upi->config_kset).u.value) < 0)
+	if (nflog_bind_pf(ui->nful_h, af_ce(upi->config_kset).u.value) < 0) {
+		ulogd_log(ULOGD_ERROR, "unable to bind to protocol family %d\n",
+			  af_ce(upi->config_kset).u.value);
 		goto out_bind_pf;
+	}
 
 	ulogd_log(ULOGD_DEBUG, "binding to log group %d\n",
 		  group_ce(upi->config_kset).u.value);
 	ui->nful_gh = nflog_bind_group(ui->nful_h,
 				       group_ce(upi->config_kset).u.value);
-	if (!ui->nful_gh)
+	if (!ui->nful_gh) {
+		ulogd_log(ULOGD_ERROR, "unable to bind to log group %d\n",
+			  group_ce(upi->config_kset).u.value);
 		goto out_bind;
+	}
 
 	nflog_set_mode(ui->nful_gh, NFULNL_COPY_PACKET, 0xffff);
 




More information about the netfilter-cvslog mailing list