Re: [conntrack-utils PATCH r7285 04/11] added alarm_pending()

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

 



Max Kellermann wrote:
> +int alarm_pending(struct alarm_list *alarm, struct timeval *tv)
> +{
> +	if (list_empty(&alarm->head))
> +		return 0;
> +
> +	if (tv != NULL)
> +		*tv = alarm->tv;

This introduces an extra copy.

> diff --git a/src/cache_timer.c b/src/cache_timer.c
> index 86bb8fc..a7afbe2 100644
> --- a/src/cache_timer.c
> +++ b/src/cache_timer.c
> @@ -60,8 +60,11 @@ static int timer_dump(struct us_conntrack *u, void *data, char *buf, int type)
>  	if (type == NFCT_O_XML)
>  		return 0;
>  
> +	if (!alarm_pending(alarm, &tmp))
> +		return 0;

I cannot think of a situation where alarm_pending returns true at the
moment.

-- 
"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