Re: [PATCH nft] netlink: Print value sizes on Relational expression size mismatch

2018-05-31 Thread Florian Westphal
Máté Eckl wrote: > On Thu, May 31, 2018 at 08:39:35PM +0200, Florian Westphal wrote: > > Máté Eckl wrote: > > > On Thu, May 31, 2018 at 04:48:58PM +0200, Pablo Neira Ayuso wrote: > > > > On Thu, May 31, 2018 at 01:42:17PM +0200, Máté Eckl wrote: > > > > > On Thu, May 31, 2018 at 10:57:49AM

Re: [PATCH nft] netlink: Print value sizes on Relational expression size mismatch

2018-05-31 Thread Máté Eckl
On Thu, May 31, 2018 at 08:39:35PM +0200, Florian Westphal wrote: > Máté Eckl wrote: > > On Thu, May 31, 2018 at 04:48:58PM +0200, Pablo Neira Ayuso wrote: > > > On Thu, May 31, 2018 at 01:42:17PM +0200, Máté Eckl wrote: > > > > On Thu, May 31, 2018 at 10:57:49AM +0200, Pablo Neira Ayuso wrote: >

Re: [PATCH nft] netlink: Print value sizes on Relational expression size mismatch

2018-05-31 Thread Florian Westphal
Máté Eckl wrote: > On Thu, May 31, 2018 at 04:48:58PM +0200, Pablo Neira Ayuso wrote: > > On Thu, May 31, 2018 at 01:42:17PM +0200, Máté Eckl wrote: > > > On Thu, May 31, 2018 at 10:57:49AM +0200, Pablo Neira Ayuso wrote: > > > > > I just wanted to make sure that the only accepted values are 0

Re: [PATCH nft] netlink: Print value sizes on Relational expression size mismatch

2018-05-31 Thread Máté Eckl
On Thu, May 31, 2018 at 04:48:58PM +0200, Pablo Neira Ayuso wrote: > On Thu, May 31, 2018 at 01:42:17PM +0200, Máté Eckl wrote: > > On Thu, May 31, 2018 at 10:57:49AM +0200, Pablo Neira Ayuso wrote: > > > > I just wanted to make sure that the only accepted values are 0 and 1 > > > > and I > > > >

Re: [PATCH nft] netlink: Print value sizes on Relational expression size mismatch

2018-05-31 Thread Pablo Neira Ayuso
On Thu, May 31, 2018 at 04:48:58PM +0200, Pablo Neira Ayuso wrote: > On Thu, May 31, 2018 at 01:42:17PM +0200, Máté Eckl wrote: > > On Thu, May 31, 2018 at 10:57:49AM +0200, Pablo Neira Ayuso wrote: > > > > I just wanted to make sure that the only accepted values are 0 and 1 > > > > and I > > > >

Re: [PATCH nft] netlink: Print value sizes on Relational expression size mismatch

2018-05-31 Thread Pablo Neira Ayuso
On Thu, May 31, 2018 at 01:42:17PM +0200, Máté Eckl wrote: > On Thu, May 31, 2018 at 10:57:49AM +0200, Pablo Neira Ayuso wrote: > > > I just wanted to make sure that the only accepted values are 0 and 1 and I > > > didn't find other way to provide this check. > > > > You can reject this from the

Re: [PATCH nft] netlink: Print value sizes on Relational expression size mismatch

2018-05-31 Thread Máté Eckl
On Thu, May 31, 2018 at 10:57:49AM +0200, Pablo Neira Ayuso wrote: > > I just wanted to make sure that the only accepted values are 0 and 1 and I > > didn't find other way to provide this check. > > You can reject this from the evaluation phase. Oh, earlier I didn't find how to do it, but now I

Re: [PATCH nft] netlink: Print value sizes on Relational expression size mismatch

2018-05-31 Thread Pablo Neira Ayuso
On Thu, May 31, 2018 at 08:07:04AM +0200, Máté Eckl wrote: > On Wed, May 30, 2018 at 08:56:46PM +0200, Pablo Neira Ayuso wrote: > > On Wed, May 30, 2018 at 08:54:41PM +0200, Florian Westphal wrote: > > > Pablo Neira Ayuso wrote: > > > > I suspect you're missing some code in the evaluation phase?

Re: [PATCH nft] netlink: Print value sizes on Relational expression size mismatch

2018-05-30 Thread Pablo Neira Ayuso
On Wed, May 30, 2018 at 08:54:41PM +0200, Florian Westphal wrote: > Pablo Neira Ayuso wrote: > > I suspect you're missing some code in the evaluation phase? > > > > So you get left->len 1 and right->len 4? > > Yes, meta template sets len of 1, where as RHS is 8 bit. > > This can be fixed up

Re: [PATCH nft] netlink: Print value sizes on Relational expression size mismatch

2018-05-30 Thread Florian Westphal
Pablo Neira Ayuso wrote: > I suspect you're missing some code in the evaluation phase? > > So you get left->len 1 and right->len 4? Yes, meta template sets len of 1, where as RHS is 8 bit. This can be fixed up during delinearization, in this case we can know that kernel actually stores 1 byte.

Re: [PATCH nft] netlink: Print value sizes on Relational expression size mismatch

2018-05-30 Thread Pablo Neira Ayuso
On Wed, May 30, 2018 at 04:01:12PM +0200, Máté Eckl wrote: > Not all of the ocurances are covered as this information is not > available in the scope where the error message is printed. > > Signed-off-by: Máté Eckl > --- > src/netlink_delinearize.c | 18 +- > 1 file changed, 13

Re: [PATCH nft] netlink: Print value sizes on Relational expression size mismatch

2018-05-30 Thread Florian Westphal
Máté Eckl wrote: > Not all of the ocurances are covered as this information is not > available in the scope where the error message is printed. Looks good to me, I'll apply in a few hours in case there are no further comments. -- To unsubscribe from this list: send the line "unsubscribe