git: 5746abf94eb3 - stable/12 - libpfctl: fix pfctl_kill_states()

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Fri, 18 Feb 2022 10:46:06 UTC
The branch stable/12 has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=5746abf94eb38259e1be49d0b28f8d08143b2de4

commit 5746abf94eb38259e1be49d0b28f8d08143b2de4
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2022-01-31 17:31:53 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2022-02-18 10:15:31 +0000

    libpfctl: fix pfctl_kill_states()
    
    735748f30a changed the output of the states so that the creator id
    endianness would be consistent. This means that we need to convert the
    host endianness creatorid back to big-endian before we give it to the
    kernel.
    
    MFC after:      3 weeks
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    
    (cherry picked from commit 6f47a72d8ebf444641bda192b33eb217c9013811)
---
 lib/libpfctl/libpfctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c
index e77bdee93deb..61fce7d743f6 100644
--- a/lib/libpfctl/libpfctl.c
+++ b/lib/libpfctl/libpfctl.c
@@ -758,7 +758,7 @@ pfctl_nv_add_state_cmp(nvlist_t *nvl, const char *name,
 	nv = nvlist_create(0);
 
 	nvlist_add_number(nv, "id", cmp->id);
-	nvlist_add_number(nv, "creatorid", cmp->creatorid);
+	nvlist_add_number(nv, "creatorid", htonl(cmp->creatorid));
 	nvlist_add_number(nv, "direction", cmp->direction);
 
 	nvlist_add_nvlist(nvl, name, nv);