Re: [PATCH] resolve byte order mess in ip_input/ip_output/pfil(9)

2012-10-06 Thread Gleb Smirnoff
On Fri, Oct 05, 2012 at 05:05:16PM +0200, Ermal Lu?i wrote: E> > E> speaking of pf(4) side of things please do not loose the VIMAGE calls! E> > E> > Yeah, can you explain please why do we need them here? The pfil hooks E> > are always run already in some defined VNET context, don't they? E> E> fro

Re: [PATCH] resolve byte order mess in ip_input/ip_output/pfil(9)

2012-10-05 Thread Gleb Smirnoff
On Fri, Oct 05, 2012 at 05:05:16PM +0200, Ermal Lu?i wrote: E> > E> speaking of pf(4) side of things please do not loose the VIMAGE calls! E> > E> > Yeah, can you explain please why do we need them here? The pfil hooks E> > are always run already in some defined VNET context, don't they? E> > E> E

Re: [PATCH] resolve byte order mess in ip_input/ip_output/pfil(9)

2012-10-05 Thread Ermal Luçi
On Fri, Oct 5, 2012 at 3:12 PM, Gleb Smirnoff wrote: > Ermal, > > On Fri, Oct 05, 2012 at 03:01:38PM +0200, Ermal Lu?i wrote: > E> it would be better to switch to net byte order allover rather than > E> trade one for the other. > E> This makes it even more tricky to understand the code than it i

Re: [PATCH] resolve byte order mess in ip_input/ip_output/pfil(9)

2012-10-05 Thread Alexander V. Chernikov
On 05.10.2012 15:47, Gleb Smirnoff wrote: Hello, once the pfil(9) API was introduced in FreeBSD, our main packet filter, the ipfw(4) worked in host byte order, that's why the pfil(9) API was violated: the AF_INET hooks were entered with packet in host byte order. Moreover, when we put

Re: [PATCH] resolve byte order mess in ip_input/ip_output/pfil(9)

2012-10-05 Thread Luigi Rizzo
On Fri, Oct 5, 2012 at 6:12 AM, Gleb Smirnoff wrote: > Ermal, > > On Fri, Oct 05, 2012 at 03:01:38PM +0200, Ermal Lu?i wrote: > E> it would be better to switch to net byte order allover rather than > E> trade one for the other. > E> This makes it even more tricky to understand the code than it

Re: [PATCH] resolve byte order mess in ip_input/ip_output/pfil(9)

2012-10-05 Thread Gleb Smirnoff
Ermal, On Fri, Oct 05, 2012 at 03:01:38PM +0200, Ermal Lu?i wrote: E> it would be better to switch to net byte order allover rather than E> trade one for the other. E> This makes it even more tricky to understand the code than it is. E> If you do the work its better to do the full thing in one s

Re: [PATCH] resolve byte order mess in ip_input/ip_output/pfil(9)

2012-10-05 Thread Ermal Luçi
Hello Gleb, it would be better to switch to net byte order allover rather than trade one for the other. This makes it even more tricky to understand the code than it is. If you do the work its better to do the full thing in one shot and switch to netbyte order. speaking of pf(4) side of things pl

[PATCH] resolve byte order mess in ip_input/ip_output/pfil(9)

2012-10-05 Thread Gleb Smirnoff
Hello, once the pfil(9) API was introduced in FreeBSD, our main packet filter, the ipfw(4) worked in host byte order, that's why the pfil(9) API was violated: the AF_INET hooks were entered with packet in host byte order. If you look into pfil(9) manpage you'll see that it still declares op