Re: [PATCH v4 2/2] netfilter: nft_meta: support for time matching

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

 



Ander Juaristi <a@xxxxxxxxxxxx> wrote:
> +++ b/net/netfilter/nft_meta.c
> @@ -28,6 +28,27 @@
>  
>  static DEFINE_PER_CPU(struct rnd_state, nft_prandom_state);
>  
> +static u8 nft_meta_weekday(unsigned long secs)
> +{
> +	u8 wday;
> +	unsigned int dse;
> +
> +	secs -= 60 * sys_tz.tz_minuteswest;
> +	dse = secs / 86400;

This will probably fail to compile (link) on 32bit arches.
You need to use do_div() here.

> +	wday = (4 + dse) % 7;

This is fine, as this only involves 32bit integers.



[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux