Am 12. Dezember 2014 17:02:04 GMT+00:00, schrieb Arturo Borrero Gonzalez <arturo.borrero.glez@xxxxxxxxx>: >On 12 December 2014 at 16:29, Patrick McHardy <kaber@xxxxxxxxx> wrote: >> Looking at the redir bug report on netfilter-devel, I noticed some >> odd syntax for the redir statement. >> >> The changelog states: >> >> The syntax is: >> >> % nft add rule nat prerouting redirect [port] [nat_flags] >> >> The actual syntax though is: >> >> redir_stmt_arg : COLON expr >> >> What do we need that colon for? redirect by definition redirects to >> the local host, the argument is always only a port expression. > >Yes, there is a inconsistency between the commit message and the code. >My fault. > >I don't exactly remember where that syntax came from. I guess the >colon was used in consistency with other nat-like expressions. >Actually, I don't have a particular preference (the colon or not). > >Do you want me to change the syntax? I can do it this weekend. Just >let me know :-) Well, I don't think the colon is really bad, however it suggests an address can be put in front of it. I guess the reason is an ambiguity in the grammar with following expressions otherwise. Even though redirect is terminal the grammar so far doesn't know about it. From a readability POV I like a simple "to". >If you are going to change it yourself, I would suggest to also update >regression tests [0], which BTW seems broken due to the >random-fully/fully-random change. I missed that, will fix it up later. > >best regards. > >[0] >http://git.netfilter.org/nftables/tree/tests/regression/ip/redirect.t -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html