Date: Thu, 5 Dec 2013 12:18:48 +0400 From: Gleb Smirnoff <glebius@FreeBSD.org> To: Kajetan Staszkiewicz <vegeta@tuxpowered.net> Cc: "freebsd-pf@freebsd.org" <freebsd-pf@freebsd.org> Subject: Re: [patch] Source entries removing is awfully slow. Message-ID: <20131205081848.GQ48919@glebius.int.ru> In-Reply-To: <201312041529.21788.vegeta@tuxpowered.net> References: <201303081419.17743.vegeta@tuxpowered.net> <201312021728.58010.vegeta@tuxpowered.net> <20131202163927.GM48919@glebius.int.ru> <201312041529.21788.vegeta@tuxpowered.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Kajetan, On Wed, Dec 04, 2013 at 03:29:21PM +0100, Kajetan Staszkiewicz wrote: K> Dnia poniedziaĆek, 2 grudnia 2013 o 17:39:27 Gleb Smirnoff napisaĆ(a): K> K> > I won't object on any interface that is consistent and resides in the K> > '-K' and '-k' namespace. As said before, I am against utilizing new K> > letters for options to avoid clashing with pfctl syntax in OpenBSD. K> K> I have a nice commandline parser working, but I got blocked by one problem. As K> the parser is quite big and most options are common for -K and -k, the parser K> is just one function for both operation modes (and a similar thing for the K> loops going over IP addresses found by given host names). Unfortunately K> DIOCKILLSTATES and DIOCKILLSRCNODES are using separate structures. K> K> Whatever the parser reads, it puts the result in the following structure K> (defined only inside pfctl, not kernel): K> K> struct pfioc_universal_kill { K> sa_family_t puk_af; K> int puk_proto; K> struct pf_rule_addr puk_src; K> struct pf_rule_addr puk_dst; K> struct pf_rule_addr puk_rdr; K> struct pf_state_cmp puk_pfcmp; K> char puk_ifname[IFNAMSIZ]; K> char puk_label[PF_RULE_LABEL_SIZE]; K> char puk_table[PF_TABLE_NAME_SIZE]; K> u_int puk_killed_states; K> u_int puk_killed_src_nodes; K> }; K> K> Which later gets translated for every ioctl to pfioc_src_node_kill or K> pfioc_state_kill. K> K> To have the most clean and simple code it would make the most sense to use the K> aforementioned pfioc_universal_kill for both DIOCKILLSTATES and K> DIOCKILLSRCNODES. But that would be a change of kernel api which I assume can K> not take place inside major release, so translation of structures is currently K> the way to go. Please correct me if I am wrong. It is okay to add new API. So in head we will add new API/ABI, then remove obsoleted one. We will merge only addition to stable/10, not removal. The ABI constraints for stable branches are the following. Newer kernel must work with older utilities. So, 10.1 kernel will work with pfctl from 10.0, since old ioctls are still supported. -- Totus tuus, Glebius.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131205081848.GQ48919>