Previously : http://marc.info/?l=openbsd-misc&m=127479158820937&w=2

I am trying to make sticky-address work on 4.9-current, where this rule :

pass in on $int_if from $int_net route-to { ($ispA_if $ispA_gw) ($ispB_if $ispB_gw) } round-robin sticky-address

evaluates to :

table <__automatic_ff7c0220_0> const { 192.168.1.1@em0 192.168.2.1@em1 }
pass in on bge0 inet from 192.168.0.0/24 to any flags S/SA keep state route-to <__automatic_ff7c0220_0> round-robin

So sticky-address goes to the void.

After digging I found it's after apply_redirspec(&r->route, r, rroute, 2, dst_port) in parse.y, rs->pool_opts.opts is always 0 so we keep only rs->pool_opts.type in rpool->opts. A fake redirspec is callocated, so I did try to initialize it with current values, see following diff. The sticky-address flag is then well propagated, but my system then panic in pf_remove_src_node after a couple of seconds.

Before digging further, is this the right way ? Am I missing something ? Comments and hints welcome.

--
Index: parse.y
===================================================================
RCS file: /cvs/openbsd/src/sbin/pfctl/parse.y,v
retrieving revision 1.597
diff -u -r1.597 parse.y
--- parse.y     31 Dec 2010 12:15:31 -0000      1.597
+++ parse.y     23 Mar 2011 16:46:32 -0000
@@ -2061,6 +2061,8 @@
                                    sizeof(*$8.rroute.rdr))) == NULL)
                                        err(1, "$8.rroute.rdr");
                                $8.rroute.rdr->host = $8.route.host;
+ $8.rroute.pool_opts.type = $8.route.pool_opts & PF_POOL_TYPEMASK; + $8.rroute.pool_opts.opts = $8.route.pool_opts;
                        }
                        if ($8.queues.qname != NULL) {
                                if (strlcpy(r.qname, $8.queues.qname,

Reply via email to