diff mbox series

[ulogd,1/2] NFLOG: add NFULNL_CFG_F_CONNTRACK flag

Message ID 20211012111529.81354-1-chamas@h4.dion.ne.jp
State Changes Requested
Delegated to: Pablo Neira
Headers show
Series [ulogd,1/2] NFLOG: add NFULNL_CFG_F_CONNTRACK flag | expand

Commit Message

Ken-ichirou MATSUZAWA Oct. 12, 2021, 11:15 a.m. UTC
acquiring conntrack information by specifying 'attack_conntrack=1'

Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp>
---
 input/packet/ulogd_inppkt_NFLOG.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Comments

Jeremy Sowden Oct. 30, 2021, 12:59 p.m. UTC | #1
On 2021-10-12, at 20:15:30 +0900, Ken-ichirou MATSUZAWA wrote:
> acquiring conntrack information by specifying 'attack_conntrack=1'

"attach_conntrack=1"

> Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp>
> ---
>  input/packet/ulogd_inppkt_NFLOG.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/input/packet/ulogd_inppkt_NFLOG.c b/input/packet/ulogd_inppkt_NFLOG.c
> index c314433..ea6fb0e 100644
> --- a/input/packet/ulogd_inppkt_NFLOG.c
> +++ b/input/packet/ulogd_inppkt_NFLOG.c
> @@ -33,7 +33,7 @@ struct nflog_input {
>  /* configuration entries */
>
>  static struct config_keyset libulog_kset = {
> -	.num_ces = 11,
> +	.num_ces = 12,
>  	.ces = {
>  		{
>  			.key 	 = "bufsize",
> @@ -102,6 +102,12 @@ static struct config_keyset libulog_kset = {
>  			.options = CONFIG_OPT_NONE,
>  			.u.value = 0,
>  		},
> +		{
> +			.key     = "attach_conntrack",
> +			.type    = CONFIG_TYPE_INT,
> +			.options = CONFIG_OPT_NONE,
> +			.u.value = 0,
> +		},
>  	}
>  };
>
> @@ -116,6 +122,7 @@ static struct config_keyset libulog_kset = {
>  #define nlsockbufmaxsize_ce(x) (x->ces[8])
>  #define nlthreshold_ce(x) (x->ces[9])
>  #define nltimeout_ce(x) (x->ces[10])
> +#define attach_conntrack_ce(x) (x->ces[11])
>
>  enum nflog_keys {
>  	NFLOG_KEY_RAW_MAC = 0,
> @@ -597,6 +604,8 @@ static int start(struct ulogd_pluginstance *upi)
>  		flags = NFULNL_CFG_F_SEQ;
>  	if (seq_global_ce(upi->config_kset).u.value != 0)
>  		flags |= NFULNL_CFG_F_SEQ_GLOBAL;

You have used spaces, not tabs here:

> +        if (attach_conntrack_ce(upi->config_kset).u.value != 0)
> +                flags |= NFULNL_CFG_F_CONNTRACK;
>  	if (flags) {
>  		if (nflog_set_flags(ui->nful_gh, flags) < 0)
>  			ulogd_log(ULOGD_ERROR, "unable to set flags 0x%x\n",
> --
> 2.30.2
>
>
diff mbox series

Patch

diff --git a/input/packet/ulogd_inppkt_NFLOG.c b/input/packet/ulogd_inppkt_NFLOG.c
index c314433..ea6fb0e 100644
--- a/input/packet/ulogd_inppkt_NFLOG.c
+++ b/input/packet/ulogd_inppkt_NFLOG.c
@@ -33,7 +33,7 @@  struct nflog_input {
 /* configuration entries */
 
 static struct config_keyset libulog_kset = {
-	.num_ces = 11,
+	.num_ces = 12,
 	.ces = {
 		{
 			.key 	 = "bufsize",
@@ -102,6 +102,12 @@  static struct config_keyset libulog_kset = {
 			.options = CONFIG_OPT_NONE,
 			.u.value = 0,
 		},
+		{
+			.key     = "attach_conntrack",
+			.type    = CONFIG_TYPE_INT,
+			.options = CONFIG_OPT_NONE,
+			.u.value = 0,
+		},
 	}
 };
 
@@ -116,6 +122,7 @@  static struct config_keyset libulog_kset = {
 #define nlsockbufmaxsize_ce(x) (x->ces[8])
 #define nlthreshold_ce(x) (x->ces[9])
 #define nltimeout_ce(x) (x->ces[10])
+#define attach_conntrack_ce(x) (x->ces[11])
 
 enum nflog_keys {
 	NFLOG_KEY_RAW_MAC = 0,
@@ -597,6 +604,8 @@  static int start(struct ulogd_pluginstance *upi)
 		flags = NFULNL_CFG_F_SEQ;
 	if (seq_global_ce(upi->config_kset).u.value != 0)
 		flags |= NFULNL_CFG_F_SEQ_GLOBAL;
+        if (attach_conntrack_ce(upi->config_kset).u.value != 0)
+                flags |= NFULNL_CFG_F_CONNTRACK;
 	if (flags) {
 		if (nflog_set_flags(ui->nful_gh, flags) < 0)
 			ulogd_log(ULOGD_ERROR, "unable to set flags 0x%x\n",