Hello Yasuoka,
</snip>
> - interface is not selected properly if selected table entry specifies
> an interface.
to be honest I don't quite understand what's going on here.
can you share some details of configuration/scenario, which
triggers the bug your diff is fixing?
the part of your change, which I'm not able to figure out is
this single line:
> + if (pf_map_addr_states_increase(af, rpool, naddr) == -1)
> + return (1);
> + /* revert the kif which was set by pfr_pool_get() */
> + rpool->kif = kif;
> break;
> }
your fix changes behavior, which is there since least-state
option has been introduced. I believe it does not matter
for case when route-to specifies single interface such as:
route-to 192.168.1.10@em0 least-states
I'm not sure what will happen in situation, when there are more interfaces
specified in combination with sticky-address:
route-to {192.168.1.10@em0, 192.168.1.20@em1} last-states sticky-address
the resulting code does not look quite right with your diff applied:
602 } while (pf_match_addr(1, &faddr, rmask, &rpool->counter,
af) &&
603 (states > 0));
604
605 if (pf_map_addr_states_increase(af, rpool, naddr) == -1)
606 return (1);
607 /* revert the kif which was set by pfr_pool_get() */
608 rpool->kif = kif;
609 break;
610 }
611
612 if (rpool->opts & PF_POOL_STICKYADDR) {
613 if (sns[type] != NULL) {
614 pf_remove_src_node(sns[type]);
615 sns[type] = NULL;
616 }
617 if (pf_insert_src_node(&sns[type], r, type, af, saddr,
naddr,
618 rpool->kif))
619 return (1);
620 }
at line 608 new code reverts kif set by pfr_pool_get(). At line 617
(executed when sticky-address is set) the original code passes kif chosen be
pfr_pool_get(). You diff changes that behavior. So my question is simple:
is that intentional change?
thanks and
regards
sashan