* netfilter: REJECT: separate reusable code @ 2014-02-05 10:25 Patrick McHardy 2014-02-05 10:42 ` Pablo Neira Ayuso 0 siblings, 1 reply; 8+ messages in thread From: Patrick McHardy @ 2014-02-05 10:25 UTC (permalink / raw) To: Eric Leblond; +Cc: pablo, netfilter-devel Just noticed commit cc70d069 (netfilter: REJECT: separate reusable code). That doesn't look like a good idea to me at all. First of all, it introduces static non-inline functions into a header file, which is obviously wrong. But more importantly, it adds a symbol dependency of the reject module on IPv6. We've tried hard to get rid of all these in x_tables, lets please not re-add them in nftables. I think we should instead use AF-specific modules for things like that. We share basically no code except the boiler plate. I'd suggest to add an AF-specific expression type lookup mechanism that takes precedence over generic types. Any other opinions? I wouldn't mind taking care of this myself. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: netfilter: REJECT: separate reusable code 2014-02-05 10:25 netfilter: REJECT: separate reusable code Patrick McHardy @ 2014-02-05 10:42 ` Pablo Neira Ayuso 2014-02-05 10:53 ` Patrick McHardy 0 siblings, 1 reply; 8+ messages in thread From: Pablo Neira Ayuso @ 2014-02-05 10:42 UTC (permalink / raw) To: Patrick McHardy; +Cc: Eric Leblond, netfilter-devel On Wed, Feb 05, 2014 at 10:25:48AM +0000, Patrick McHardy wrote: > Just noticed commit cc70d069 (netfilter: REJECT: separate reusable code). > That doesn't look like a good idea to me at all. > > First of all, it introduces static non-inline functions into a header file, > which is obviously wrong. But more importantly, it adds a symbol dependency > of the reject module on IPv6. We've tried hard to get rid of all these in > x_tables, lets please not re-add them in nftables. Well, I think this is working at this moment, we can improve it of course. > I think we should instead use AF-specific modules for things like that. > We share basically no code except the boiler plate. I'd suggest to add > an AF-specific expression type lookup mechanism that takes precedence > over generic types. Yes, this looks like the way to go to me. How do you plan to handle this with the inet table? We don't have family context there. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: netfilter: REJECT: separate reusable code 2014-02-05 10:42 ` Pablo Neira Ayuso @ 2014-02-05 10:53 ` Patrick McHardy 2014-02-05 11:17 ` Pablo Neira Ayuso 0 siblings, 1 reply; 8+ messages in thread From: Patrick McHardy @ 2014-02-05 10:53 UTC (permalink / raw) To: Pablo Neira Ayuso; +Cc: Eric Leblond, netfilter-devel On Wed, Feb 05, 2014 at 11:42:47AM +0100, Pablo Neira Ayuso wrote: > On Wed, Feb 05, 2014 at 10:25:48AM +0000, Patrick McHardy wrote: > > Just noticed commit cc70d069 (netfilter: REJECT: separate reusable code). > > That doesn't look like a good idea to me at all. > > > > First of all, it introduces static non-inline functions into a header file, > > which is obviously wrong. But more importantly, it adds a symbol dependency > > of the reject module on IPv6. We've tried hard to get rid of all these in > > x_tables, lets please not re-add them in nftables. > > Well, I think this is working at this moment, we can improve it of > course. Sure. I'd just prefer to have it done right from the beginning instead of having to fix it up afterwards if we already know of these problems. It just takes more time this way. I wonder if we could add something that would break compilation for anything in net/netfilter depending on the ipv6 module. It keeps happening again and again. > > I think we should instead use AF-specific modules for things like that. > > We share basically no code except the boiler plate. I'd suggest to add > > an AF-specific expression type lookup mechanism that takes precedence > > over generic types. > > Yes, this looks like the way to go to me. > > How do you plan to handle this with the inet table? We don't have > family context there. Hmm good question indeed. We do have it at runtime, but this would obviously also mean we'd also have to dispatch at runtime. I guess an NFPROTO_INET specific reject module that dispatches to the IPv4 and IPv6 versions is the only possibility unless we want to add restrictions (which I don't). ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: netfilter: REJECT: separate reusable code 2014-02-05 10:53 ` Patrick McHardy @ 2014-02-05 11:17 ` Pablo Neira Ayuso 2014-02-05 11:49 ` Arturo Borrero Gonzalez 2014-02-05 12:01 ` Patrick McHardy 0 siblings, 2 replies; 8+ messages in thread From: Pablo Neira Ayuso @ 2014-02-05 11:17 UTC (permalink / raw) To: Patrick McHardy; +Cc: Eric Leblond, netfilter-devel On Wed, Feb 05, 2014 at 10:53:48AM +0000, Patrick McHardy wrote: > On Wed, Feb 05, 2014 at 11:42:47AM +0100, Pablo Neira Ayuso wrote: > > On Wed, Feb 05, 2014 at 10:25:48AM +0000, Patrick McHardy wrote: > > > Just noticed commit cc70d069 (netfilter: REJECT: separate reusable code). > > > That doesn't look like a good idea to me at all. > > > > > > First of all, it introduces static non-inline functions into a header file, > > > which is obviously wrong. But more importantly, it adds a symbol dependency > > > of the reject module on IPv6. We've tried hard to get rid of all these in > > > x_tables, lets please not re-add them in nftables. > > > > Well, I think this is working at this moment, we can improve it of > > course. > > Sure. I'd just prefer to have it done right from the beginning instead > of having to fix it up afterwards if we already know of these problems. > It just takes more time this way. > > I wonder if we could add something that would break compilation for > anything in net/netfilter depending on the ipv6 module. It keeps > happening again and again. We are using this trick thing in Kconfig: depends on (IPV6 || IPV6=n) and similar thing in NFT_REJECT depends on NF_TABLES_IPV6 || !NF_TABLES_IPV6 it's not nice, but it seems to work to avoid buildbot reports. > > > I think we should instead use AF-specific modules for things like that. > > > We share basically no code except the boiler plate. I'd suggest to add > > > an AF-specific expression type lookup mechanism that takes precedence > > > over generic types. > > > > Yes, this looks like the way to go to me. > > > > How do you plan to handle this with the inet table? We don't have > > family context there. > > Hmm good question indeed. We do have it at runtime, but this would > obviously also mean we'd also have to dispatch at runtime. > > I guess an NFPROTO_INET specific reject module that dispatches to > the IPv4 and IPv6 versions is the only possibility unless we want > to add restrictions (which I don't). I think that, once the infrastructure to provide expressions per family in place, a specific reject for inet is a good idea. It can reply depending on the packet family that it sees at _eval(...). I don't have any better idea on how to handle this case. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: netfilter: REJECT: separate reusable code 2014-02-05 11:17 ` Pablo Neira Ayuso @ 2014-02-05 11:49 ` Arturo Borrero Gonzalez 2014-02-05 11:50 ` Arturo Borrero Gonzalez 2014-02-05 12:04 ` Patrick McHardy 2014-02-05 12:01 ` Patrick McHardy 1 sibling, 2 replies; 8+ messages in thread From: Arturo Borrero Gonzalez @ 2014-02-05 11:49 UTC (permalink / raw) To: Pablo Neira Ayuso Cc: Patrick McHardy, Eric Leblond, Netfilter Development Mailing list On 5 February 2014 12:17, Pablo Neira Ayuso <pablo@netfilter.org> wrote: >> >> I guess an NFPROTO_INET specific reject module that dispatches to >> the IPv4 and IPv6 versions is the only possibility unless we want >> to add restrictions (which I don't). > > I think that, once the infrastructure to provide expressions per > family in place, a specific reject for inet is a good idea. It can > reply depending on the packet family that it sees at _eval(...). I > don't have any better idea on how to handle this case. Just wondering if this idea could be reused to allow nft_payload to fetch ip src/dst in a family independent way, so we can have dual stacked rules of this kind: nft add rule inet filter input ip daddr www.example.com accept or maybe: nft add rule inet filter input ip daddr { 1.1.1.1 : accept , ::1 : accept } -- Arturo Borrero González -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: netfilter: REJECT: separate reusable code 2014-02-05 11:49 ` Arturo Borrero Gonzalez @ 2014-02-05 11:50 ` Arturo Borrero Gonzalez 2014-02-05 12:04 ` Patrick McHardy 1 sibling, 0 replies; 8+ messages in thread From: Arturo Borrero Gonzalez @ 2014-02-05 11:50 UTC (permalink / raw) To: Pablo Neira Ayuso Cc: Patrick McHardy, Eric Leblond, Netfilter Development Mailing list On 5 February 2014 12:49, Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com> wrote: > > Just wondering if this idea could be reused to allow nft_payload to > fetch ip src/dst in a family independent way, so we can have dual > stacked rules of this kind: I meant dependant,. -- Arturo Borrero González -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: netfilter: REJECT: separate reusable code 2014-02-05 11:49 ` Arturo Borrero Gonzalez 2014-02-05 11:50 ` Arturo Borrero Gonzalez @ 2014-02-05 12:04 ` Patrick McHardy 1 sibling, 0 replies; 8+ messages in thread From: Patrick McHardy @ 2014-02-05 12:04 UTC (permalink / raw) To: Arturo Borrero Gonzalez Cc: Pablo Neira Ayuso, Eric Leblond, Netfilter Development Mailing list On Wed, Feb 05, 2014 at 12:49:01PM +0100, Arturo Borrero Gonzalez wrote: > On 5 February 2014 12:17, Pablo Neira Ayuso <pablo@netfilter.org> wrote: > >> > >> I guess an NFPROTO_INET specific reject module that dispatches to > >> the IPv4 and IPv6 versions is the only possibility unless we want > >> to add restrictions (which I don't). > > > > I think that, once the infrastructure to provide expressions per > > family in place, a specific reject for inet is a good idea. It can > > reply depending on the packet family that it sees at _eval(...). I > > don't have any better idea on how to handle this case. > > Just wondering if this idea could be reused to allow nft_payload to > fetch ip src/dst in a family independent way, so we can have dual > stacked rules of this kind: > > nft add rule inet filter input ip daddr www.example.com accept > > or maybe: > > nft add rule inet filter input ip daddr { 1.1.1.1 : accept , ::1 : accept } Nope, ip daddr implies meta nfproto == NFPROTO_IPV4. Also we have a length in the payload instruction. We might be able to do something by mapping IPv4 addresses into IPv6 address space. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: netfilter: REJECT: separate reusable code 2014-02-05 11:17 ` Pablo Neira Ayuso 2014-02-05 11:49 ` Arturo Borrero Gonzalez @ 2014-02-05 12:01 ` Patrick McHardy 1 sibling, 0 replies; 8+ messages in thread From: Patrick McHardy @ 2014-02-05 12:01 UTC (permalink / raw) To: Pablo Neira Ayuso; +Cc: Eric Leblond, netfilter-devel On Wed, Feb 05, 2014 at 12:17:13PM +0100, Pablo Neira Ayuso wrote: > On Wed, Feb 05, 2014 at 10:53:48AM +0000, Patrick McHardy wrote: > > On Wed, Feb 05, 2014 at 11:42:47AM +0100, Pablo Neira Ayuso wrote: > > > On Wed, Feb 05, 2014 at 10:25:48AM +0000, Patrick McHardy wrote: > > > > Just noticed commit cc70d069 (netfilter: REJECT: separate reusable code). > > > > That doesn't look like a good idea to me at all. > > > > > > > > First of all, it introduces static non-inline functions into a header file, > > > > which is obviously wrong. But more importantly, it adds a symbol dependency > > > > of the reject module on IPv6. We've tried hard to get rid of all these in > > > > x_tables, lets please not re-add them in nftables. > > > > > > Well, I think this is working at this moment, we can improve it of > > > course. > > > > Sure. I'd just prefer to have it done right from the beginning instead > > of having to fix it up afterwards if we already know of these problems. > > It just takes more time this way. > > > > I wonder if we could add something that would break compilation for > > anything in net/netfilter depending on the ipv6 module. It keeps > > happening again and again. > > We are using this trick thing in Kconfig: > > depends on (IPV6 || IPV6=n) > > and similar thing in NFT_REJECT > > depends on NF_TABLES_IPV6 || !NF_TABLES_IPV6 > > it's not nice, but it seems to work to avoid buildbot reports. That's not what I meant. I *want* to break compilation if anything in net/netfilter depends on a symbol of the IPV6 module. Its wrong, with the only exception being stuff for NFPROTO_INET. > > > > I think we should instead use AF-specific modules for things like that. > > > > We share basically no code except the boiler plate. I'd suggest to add > > > > an AF-specific expression type lookup mechanism that takes precedence > > > > over generic types. > > > > > > Yes, this looks like the way to go to me. > > > > > > How do you plan to handle this with the inet table? We don't have > > > family context there. > > > > Hmm good question indeed. We do have it at runtime, but this would > > obviously also mean we'd also have to dispatch at runtime. > > > > I guess an NFPROTO_INET specific reject module that dispatches to > > the IPv4 and IPv6 versions is the only possibility unless we want > > to add restrictions (which I don't). > > I think that, once the infrastructure to provide expressions per > family in place, a specific reject for inet is a good idea. It can > reply depending on the packet family that it sees at _eval(...). I > don't have any better idea on how to handle this case. Yes, that seems fine, its in fact pretty much what we're doing right now. ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-02-05 12:04 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-02-05 10:25 netfilter: REJECT: separate reusable code Patrick McHardy 2014-02-05 10:42 ` Pablo Neira Ayuso 2014-02-05 10:53 ` Patrick McHardy 2014-02-05 11:17 ` Pablo Neira Ayuso 2014-02-05 11:49 ` Arturo Borrero Gonzalez 2014-02-05 11:50 ` Arturo Borrero Gonzalez 2014-02-05 12:04 ` Patrick McHardy 2014-02-05 12:01 ` Patrick McHardy
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).