Hello,

On Sat, Nov 07, 2026 at 03:49:10PM +0100, Pim van Pelt wrote:
</snip>
> IPv6 including NAT44/NAT66 for these, but they incorrectly report NAT64
> flows as inbound only.
> It's not critical but it's more than cosmetic; the pflow data is incorrect
> for NAT64 flows and it disagrees with sflow data coming from routers
> upstream, which makes pflow hard to use.
> 

    understood. It can be pain. after spending some more time to
    get af-to translated packet inspected for second time I've realized
    that approach invites lot more problems. given you need to have
    stats consistent I wonder if diff below would help you.

    the idea is to generate two pflow regular nat records when pf(4)
    exports af-to state. I don't have pflow set up readily available
    at the moment so the diff is compile tested only.

    also I'm not pflow expert, so take it as experimental hack.
    let me know if it is heading in right direction.

thanks and
regards
sashan

--------8<---------------8<---------------8<------------------8<--------
diff --git a/sys/net/if_pflow.c b/sys/net/if_pflow.c
index fced85a3186..5f2fe466151 100644
--- a/sys/net/if_pflow.c
+++ b/sys/net/if_pflow.c
@@ -958,6 +958,8 @@ export_pflow(struct pf_state *st)
                case PFLOW_PROTO_10:
                        if (sk->af == AF_INET || sk->af == AF_INET6)
                                export_pflow_if(st, sk, skw, sc);
+                       if (sk->af != skw->af)
+                               export_pflow_if(st, skw, sk, sc);
                        break;
                default: /* NOTREACHED */
                        break;

Reply via email to