Skip to content

Commit 775a324

Browse files
authored
Fix format specifier for ip_source bitfield in header_rewrite (#12677)
Use PRIu64 with explicit cast to uint64_t to match the bitfield's underlying type and ensure cross-platform compatibility. This fixes build failures on Ubuntu 20.04.
1 parent 7f00a1c commit 775a324

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plugins/header_rewrite/conditions.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <unistd.h>
2626
#include <arpa/inet.h>
2727
#include <cctype>
28+
#include <cinttypes>
2829
#include <sstream>
2930
#include <array>
3031
#include <atomic>
@@ -1768,7 +1769,7 @@ getClientAddr(TSHttpTxn txnp, int txn_private_slot)
17681769
TSHttpTxnVerifiedAddrGet(txnp, &addr);
17691770
break;
17701771
default:
1771-
Dbg(pi_dbg_ctl, "Unknown IP source (%d) was specified", private_data.ip_source);
1772+
Dbg(pi_dbg_ctl, "Unknown IP source (%" PRIu64 ") was specified", static_cast<uint64_t>(private_data.ip_source));
17721773
addr = TSHttpTxnClientAddrGet(txnp);
17731774
break;
17741775
}

0 commit comments

Comments
 (0)