netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Florian Westphal <fw@strlen.de>
Cc: Ander Juaristi <a@juaristi.eus>, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH v4 2/2] netfilter: nft_meta: support for time matching
Date: Tue, 13 Aug 2019 21:15:21 +0200	[thread overview]
Message-ID: <20190813191521.k3smpru2sf2rvewf@breakpoint.cc> (raw)
In-Reply-To: <20190813191406.lhsz3y4bbmuzixxi@breakpoint.cc>

Florian Westphal <fw@strlen.de> wrote:
> Ander Juaristi <a@juaristi.eus> 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.

Scratch that, this will work fine (unsigned long is not a 64 bit
type in that case).

  reply	other threads:[~2019-08-13 19:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-13 18:38 [PATCH v4 1/2] netfilter: Introduce new 64-bit helper functions Ander Juaristi
2019-08-13 18:38 ` [PATCH v4 2/2] netfilter: nft_meta: support for time matching Ander Juaristi
2019-08-13 19:10   ` Pablo Neira Ayuso
2019-08-13 19:14   ` Florian Westphal
2019-08-13 19:15     ` Florian Westphal [this message]
2019-08-13 18:58 ` [PATCH v4 1/2] netfilter: Introduce new 64-bit helper functions Pablo Neira Ayuso
2019-08-15  9:46   ` Ander Juaristi
2019-08-15  9:56     ` Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190813191521.k3smpru2sf2rvewf@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=a@juaristi.eus \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).