we have a hacked copy of pf_norm.c that we want to send somewhere to start discussion on, though
the reassemble tcp option does 3 things, 2 of which are okay on a modern internet, and the third thing causes problems with hosts behind load balancers that change their tcp timestamp behavior
so we have to do this kind of shit:
===================================================================
RCS file: /cvs/src/sys/net/pf_norm.c,v
retrieving revision 1.224
diff -u -p -u -r1.224 pf_norm.c
--- net/pf_norm.c 22 Aug 2022 20:35:39 -0000 1.224
+++ net/pf_norm.c 3 Jan 2023 17:28:32 -0000
@@ -1294,8 +1294,8 @@ pf_normalize_tcp_stateful(struct pf_pdes
if (got_ts) {
/* Huh? Multiple timestamps!? */
- if (pf_status.debug >= LOG_NOTICE) {
- log(LOG_NOTICE,
+ if (pf_status.debug >= LOG_ERR) {
+ log(LOG_ERR,
"pf: %s: multiple TS??", __func__);
pf_print_state(state);
addlog("\n");
@@ -1469,23 +1469,23 @@ pf_normalize_tcp_stateful(struct pf_pdes
* an old timestamp.
*/
- DPFPRINTF(LOG_NOTICE, "Timestamp failed %c%c%c%c",
+ DPFPRINTF(LOG_ERR, "Timestamp failed %c%c%c%c",
SEQ_LT(tsval, dst->scrub->pfss_tsecr) ? '0' : ' ',
SEQ_GT(tsval, src->scrub->pfss_tsval +
tsval_from_last) ? '1' : ' ',
SEQ_GT(tsecr, dst->scrub->pfss_tsval) ? '2' : ' ',
SEQ_LT(tsecr, dst->scrub->pfss_tsval0)? '3' : ' ');
- DPFPRINTF(LOG_NOTICE, " tsval: %u tsecr: %u "
+ DPFPRINTF(LOG_ERR, " tsval: %u tsecr: %u "
"+ticks: %u idle: %llu.%06lus", tsval, tsecr,
tsval_from_last, (long long)delta_ts.tv_sec,
delta_ts.tv_usec);
- DPFPRINTF(LOG_NOTICE, " src->tsval: %u tsecr: %u",
+ DPFPRINTF(LOG_ERR, " src->tsval: %u tsecr: %u",
src->scrub->pfss_tsval, src->scrub->pfss_tsecr);
- DPFPRINTF(LOG_NOTICE, " dst->tsval: %u tsecr: %u "
+ DPFPRINTF(LOG_ERR, " dst->tsval: %u tsecr: %u "
"tsval0: %u", dst->scrub->pfss_tsval,
dst->scrub->pfss_tsecr, dst->scrub->pfss_tsval0);
- if (pf_status.debug >= LOG_NOTICE) {
- log(LOG_NOTICE, "pf: ");
+ if (pf_status.debug >= LOG_ERR) {
+ log(LOG_ERR, "pf: ");
pf_print_state(state);
pf_print_flags(th->th_flags);
addlog("\n");
@@ -1531,16 +1531,14 @@ pf_normalize_tcp_stateful(struct pf_pdes
* Hey! Someone tried to sneak a packet in. Or the
* stack changed its RFC1323 behavior?!?!
*/
- if (pf_status.debug >= LOG_NOTICE) {
- log(LOG_NOTICE,
+ if (pf_status.debug >= LOG_ERR) {
+ log(LOG_ERR,
"pf: did not receive expected RFC1323 "
"timestamp");
pf_print_state(state);
pf_print_flags(th->th_flags);
addlog("\n");
}
- REASON_SET(reason, PFRES_TS);
- return (PF_DROP);
}
}