netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] fix NF_QUEUE_NR() macro
@ 2005-08-11  7:13 Harald Welte
  2005-08-11 14:31 ` Ingo Oeser
  2005-08-11 22:31 ` David S. Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Harald Welte @ 2005-08-11  7:13 UTC (permalink / raw)
  To: David Miller; +Cc: Linux Netdev List, Netfilter Development Mailinglist


[-- Attachment #1.1: Type: text/plain, Size: 337 bytes --]

Hi Dave, please apply!

-- 
- Harald Welte <laforge@gnumonks.org>          	        http://gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
                                                  (ETSI EN 300 175-7 Ch. A6)

[-- Attachment #1.2: 44-nf_queue_nr.patch --]
[-- Type: text/plain, Size: 1001 bytes --]

[NETFILTER] Fix NF_QUEUE_NR() macro

I obviously wanted to use bitwise-or, not logical or.

Signed-off-by: Harald Welte <laforge@netfilter.org>

---
commit 359a4ba102b661dbd8da28b9dcb3330656a7a963
tree 3d1549cbff8af472bf761322b468ccd0d5be55c2
parent 5d6a0527049e43780fdaef065d0240a3338f92fd
author Harald Welte <laforge@netfilter.org> Di, 09 Aug 2005 09:32:02 +0200
committer Harald Welte <laforge@netfilter.org> Di, 09 Aug 2005 09:32:02 +0200

 include/linux/netfilter.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -29,7 +29,7 @@
 #define NF_VERDICT_QMASK 0xffff0000
 #define NF_VERDICT_QBITS 16
 
-#define NF_QUEUE_NR(x) ((x << NF_VERDICT_QBITS) & NF_VERDICT_QMASK || NF_QUEUE)
+#define NF_QUEUE_NR(x) ((x << NF_VERDICT_QBITS) & NF_VERDICT_QMASK | NF_QUEUE)
 
 /* only for userspace compatibility */
 #ifndef __KERNEL__

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] fix NF_QUEUE_NR() macro
  2005-08-11  7:13 [PATCH 2/2] fix NF_QUEUE_NR() macro Harald Welte
@ 2005-08-11 14:31 ` Ingo Oeser
  2005-08-11 19:26   ` Harald Welte
  2005-08-11 21:46   ` Herbert Xu
  2005-08-11 22:31 ` David S. Miller
  1 sibling, 2 replies; 7+ messages in thread
From: Ingo Oeser @ 2005-08-11 14:31 UTC (permalink / raw)
  To: Harald Welte, David Miller, Linux Netdev List,
	Netfilter Development Mailinglist

Harald Welte wrote:
> Hi Dave, please apply!

What about using a brace more:

>diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
>--- a/include/linux/netfilter.h
>+++ b/include/linux/netfilter.h
>@@ -29,7 +29,7 @@
> #define NF_VERDICT_QMASK 0xffff0000
> #define NF_VERDICT_QBITS 16
> 
>-#define NF_QUEUE_NR(x) ((x << NF_VERDICT_QBITS) & NF_VERDICT_QMASK || NF_QUEUE)
>+#define NF_QUEUE_NR(x) ((x << NF_VERDICT_QBITS) & NF_VERDICT_QMASK | NF_QUEUE)

#define NF_QUEUE_NR(x) ((x << NF_VERDICT_QBITS) & (NF_VERDICT_QMASK | NF_QUEUE))

I know we are cool and know operator precedence even after 10 beer, but some people
consider it difficult to understand without :-)


Regards

Ingo Oeser

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] fix NF_QUEUE_NR() macro
  2005-08-11 14:31 ` Ingo Oeser
@ 2005-08-11 19:26   ` Harald Welte
  2005-08-11 21:46   ` Herbert Xu
  1 sibling, 0 replies; 7+ messages in thread
From: Harald Welte @ 2005-08-11 19:26 UTC (permalink / raw)
  To: Ingo Oeser; +Cc: Linux Netdev List, Netfilter Development Mailinglist

[-- Attachment #1: Type: text/plain, Size: 703 bytes --]

On Thu, Aug 11, 2005 at 04:31:24PM +0200, Ingo Oeser wrote:
> Harald Welte wrote:
> > Hi Dave, please apply!
> 
> What about using a brace more:

I wouldn't mind the extra brace, but I don't want to make this more
difficult for Dave.  So it's his call whether he would manually edit the
line before applying the patch ;)

-- 
- Harald Welte <laforge@netfilter.org>                 http://netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] fix NF_QUEUE_NR() macro
  2005-08-11 14:31 ` Ingo Oeser
  2005-08-11 19:26   ` Harald Welte
@ 2005-08-11 21:46   ` Herbert Xu
  2005-08-11 22:40     ` Harald Welte
  2005-08-11 22:43     ` David S. Miller
  1 sibling, 2 replies; 7+ messages in thread
From: Herbert Xu @ 2005-08-11 21:46 UTC (permalink / raw)
  To: Ingo Oeser; +Cc: netdev, netfilter-devel, laforge

Ingo Oeser <netdev@axxeo.de> wrote:
> 
> What about using a brace more:
> 
>>diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
>>--- a/include/linux/netfilter.h
>>+++ b/include/linux/netfilter.h
>>@@ -29,7 +29,7 @@
>> #define NF_VERDICT_QMASK 0xffff0000
>> #define NF_VERDICT_QBITS 16
>> 
>>-#define NF_QUEUE_NR(x) ((x << NF_VERDICT_QBITS) & NF_VERDICT_QMASK || NF_QUEUE)
>>+#define NF_QUEUE_NR(x) ((x << NF_VERDICT_QBITS) & NF_VERDICT_QMASK | NF_QUEUE)
> 
> #define NF_QUEUE_NR(x) ((x << NF_VERDICT_QBITS) & (NF_VERDICT_QMASK | NF_QUEUE))

Actually, these two versions are different.  & is higher than | so
Harald's version is actually 

#define NF_QUEUE_NR(x) (((x << NF_VERDICT_QBITS) & NF_VERDICT_QMASK) | NF_QUEUE)

Which is it?

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] fix NF_QUEUE_NR() macro
  2005-08-11  7:13 [PATCH 2/2] fix NF_QUEUE_NR() macro Harald Welte
  2005-08-11 14:31 ` Ingo Oeser
@ 2005-08-11 22:31 ` David S. Miller
  1 sibling, 0 replies; 7+ messages in thread
From: David S. Miller @ 2005-08-11 22:31 UTC (permalink / raw)
  To: laforge; +Cc: netdev, netfilter-devel

From: Harald Welte <laforge@gnumonks.org>
Date: Thu, 11 Aug 2005 09:13:21 +0200

> [NETFILTER] Fix NF_QUEUE_NR() macro
> 
> I obviously wanted to use bitwise-or, not logical or.
> 
> Signed-off-by: Harald Welte <laforge@netfilter.org>

Applied.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] fix NF_QUEUE_NR() macro
  2005-08-11 21:46   ` Herbert Xu
@ 2005-08-11 22:40     ` Harald Welte
  2005-08-11 22:43     ` David S. Miller
  1 sibling, 0 replies; 7+ messages in thread
From: Harald Welte @ 2005-08-11 22:40 UTC (permalink / raw)
  To: Herbert Xu; +Cc: netdev, netfilter-devel, Ingo Oeser

[-- Attachment #1: Type: text/plain, Size: 1547 bytes --]

On Fri, Aug 12, 2005 at 07:46:55AM +1000, Herbert Xu wrote:
> Ingo Oeser <netdev@axxeo.de> wrote:
> > 
> > What about using a brace more:
> > 
> >>diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
> >>--- a/include/linux/netfilter.h
> >>+++ b/include/linux/netfilter.h
> >>@@ -29,7 +29,7 @@
> >> #define NF_VERDICT_QMASK 0xffff0000
> >> #define NF_VERDICT_QBITS 16
> >> 
> >>-#define NF_QUEUE_NR(x) ((x << NF_VERDICT_QBITS) & NF_VERDICT_QMASK || NF_QUEUE)
> >>+#define NF_QUEUE_NR(x) ((x << NF_VERDICT_QBITS) & NF_VERDICT_QMASK | NF_QUEUE)
> > 
> > #define NF_QUEUE_NR(x) ((x << NF_VERDICT_QBITS) & (NF_VERDICT_QMASK | NF_QUEUE))
> 
> Actually, these two versions are different.  & is higher than | so
> Harald's version is actually 
> 
> #define NF_QUEUE_NR(x) (((x << NF_VERDICT_QBITS) & NF_VERDICT_QMASK) | NF_QUEUE)
> 
> Which is it?

the latter.  So my original patch is right (and is also confirmed to
work in tests by some users and myself), I 'just' didn't review Ingo's
alternative line (embarrassing).

We have that saying in german: "I didn't see the wood because of all the
trees".  Somehow I feel like that now...

-- 
- Harald Welte <laforge@netfilter.org>                 http://netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] fix NF_QUEUE_NR() macro
  2005-08-11 21:46   ` Herbert Xu
  2005-08-11 22:40     ` Harald Welte
@ 2005-08-11 22:43     ` David S. Miller
  1 sibling, 0 replies; 7+ messages in thread
From: David S. Miller @ 2005-08-11 22:43 UTC (permalink / raw)
  To: herbert; +Cc: netdev, netfilter-devel, netdev, laforge

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Fri, 12 Aug 2005 07:46:55 +1000

> Actually, these two versions are different.  & is higher than | so
> Harald's version is actually 
> 
> #define NF_QUEUE_NR(x) (((x << NF_VERDICT_QBITS) & NF_VERDICT_QMASK) | NF_QUEUE)
> 
> Which is it?

It's the former that is the intended version.

I put Harald's patch in as-is, if people want to pretty it
up please do so with a follow-on patch but I really don't
think it matters :-)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-08-11 22:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-11  7:13 [PATCH 2/2] fix NF_QUEUE_NR() macro Harald Welte
2005-08-11 14:31 ` Ingo Oeser
2005-08-11 19:26   ` Harald Welte
2005-08-11 21:46   ` Herbert Xu
2005-08-11 22:40     ` Harald Welte
2005-08-11 22:43     ` David S. Miller
2005-08-11 22:31 ` David S. Miller

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).