pfctl: fix killing states by ID

Since the conversion to the new DIOCKILLSTATESNV the kernel no longer
exists the id and creatorid to be big-endian.
As a result killing states by id (i.e. `pfctl -k id -k 12345`) no longer
worked.

Reported by:	Özkan KIRIK
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
This commit is contained in:
Kristof Provost 2021-08-24 12:24:28 +02:00
parent 36fc383018
commit e59eff9ad3

View File

@ -908,7 +908,6 @@ pfctl_id_kill_states(int dev, const char *iface, int opts)
if ((sscanf(state_kill[1], "%jx/%x",
&kill.cmp.id, &kill.cmp.creatorid)) == 2)
HTONL(kill.cmp.creatorid);
else if ((sscanf(state_kill[1], "%jx", &kill.cmp.id)) == 1) {
kill.cmp.creatorid = 0;
} else {
@ -920,7 +919,6 @@ pfctl_id_kill_states(int dev, const char *iface, int opts)
usage();
}
kill.cmp.id = htobe64(kill.cmp.id);
if (pfctl_kill_states(dev, &kill, &killed))
err(1, "DIOCKILLSTATES");