mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-04 07:31:11 +00:00
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:
parent
36fc383018
commit
e59eff9ad3
|
@ -908,7 +908,6 @@ pfctl_id_kill_states(int dev, const char *iface, int opts)
|
||||||
|
|
||||||
if ((sscanf(state_kill[1], "%jx/%x",
|
if ((sscanf(state_kill[1], "%jx/%x",
|
||||||
&kill.cmp.id, &kill.cmp.creatorid)) == 2)
|
&kill.cmp.id, &kill.cmp.creatorid)) == 2)
|
||||||
HTONL(kill.cmp.creatorid);
|
|
||||||
else if ((sscanf(state_kill[1], "%jx", &kill.cmp.id)) == 1) {
|
else if ((sscanf(state_kill[1], "%jx", &kill.cmp.id)) == 1) {
|
||||||
kill.cmp.creatorid = 0;
|
kill.cmp.creatorid = 0;
|
||||||
} else {
|
} else {
|
||||||
|
@ -920,7 +919,6 @@ pfctl_id_kill_states(int dev, const char *iface, int opts)
|
||||||
usage();
|
usage();
|
||||||
}
|
}
|
||||||
|
|
||||||
kill.cmp.id = htobe64(kill.cmp.id);
|
|
||||||
if (pfctl_kill_states(dev, &kill, &killed))
|
if (pfctl_kill_states(dev, &kill, &killed))
|
||||||
err(1, "DIOCKILLSTATES");
|
err(1, "DIOCKILLSTATES");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue