Re: [ULOGD PATCH 2/3] Add event output and make event mask configurable in NFCT.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Eric Leblond wrote:
> This patch contains two linked modifications in NFCT input plugin:
>  - event mask is now configurable though the event_mask configuration variable
>  - event type is now stored in the ct.event output key. This can be used to
>  display the information or to use it to implement some tracking algorithm in
>  userspace.

Just minor a cleanup glitch.

> @@ -559,28 +575,38 @@ static int event_handler(void *arg, unsigned int flags, int type,
>  {
>  	struct nfct_conntrack *ct = arg;
>  	struct ulogd_pluginstance *upi = data;
> -	struct ulogd_pluginstance *npi = NULL;
> +	struct ulogd_key *kret = upi->output.keys;
>  	struct nfct_pluginstance *cpi = 
>  				(struct nfct_pluginstance *) upi->private;
> +	struct ct_timestamp *ts = NULL;
> +	struct ulogd_pluginstance *npi = NULL;
>  	int ret = 0;
>  
> +
>  	if (type == NFCT_MSG_NEW) {
> -		if (usehash_ce(upi->config_kset).u.value != 0)
> +		if (usehash_ce(upi->config_kset).u.value != 0) {
>  			ct_hash_add(cpi->ct_active, ct->id);
> +			return 0;
> +		}
>  	} else if (type == NFCT_MSG_DESTROY) {
> -		struct ct_timestamp *ts = NULL;
> -
>  		if (usehash_ce(upi->config_kset).u.value != 0)
>  			ts = ct_hash_get(cpi->ct_active, ct->id);
> +	}
>  
> -		llist_for_each_entry(npi, &upi->plist, plist) {
> -			ret = propagate_ct(npi, ct, flags, ts);
> -			if (ret != 0)
> -				return ret;
> -		}
> -		return propagate_ct(upi, ct, flags, ts);
> +	llist_for_each_entry(npi, &upi->plist, plist) {
> +		kret = npi->output.keys;
> +		kret[NFCT_CT_EVENT].u.value.ui32 = type;
> +		kret[NFCT_CT_EVENT].flags |= ULOGD_RETF_VALID;

Better move this ^^^^ inside propagate_ct()?

-- 
"Los honestos son inadaptados sociales" -- Les Luthiers
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux