git: 6f47a72d8ebf - main - libpfctl: fix pfctl_kill_states()

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Mon, 31 Jan 2022 18:13:40 UTC
The branch main has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=6f47a72d8ebf444641bda192b33eb217c9013811

commit 6f47a72d8ebf444641bda192b33eb217c9013811
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2022-01-31 17:31:53 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2022-01-31 18:13:26 +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")
---
 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 58bae146cf6a..66f7f61cc1fa 100644
--- a/lib/libpfctl/libpfctl.c
+++ b/lib/libpfctl/libpfctl.c
@@ -764,7 +764,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);