Skip to content

Commit 0a47d7e

Browse files
committed
use FR_MAX_PACKET_CODE instead of PW_CODE_MAX
as rad_packet_ok() already tosses packets >= FR_MAX_PACKET_CODE
1 parent 399f6ae commit 0a47d7e

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/include/radsniff.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ typedef struct rs_stats_value_tmpl rs_stats_value_tmpl_t;
9090
#endif
9191

9292
typedef struct rs_counters {
93-
uint64_t type[PW_CODE_MAX];
93+
uint64_t type[FR_MAX_PACKET_CODE];
9494
} rs_counters_t;
9595

9696
/** Stats for a single interval
@@ -150,7 +150,7 @@ typedef struct rs_malformed {
150150
typedef struct rs_stats {
151151
int intervals; //!< Number of stats intervals.
152152

153-
rs_latency_t exchange[PW_CODE_MAX]; //!< We end up allocating ~16K, but memory is cheap so
153+
rs_latency_t exchange[FR_MAX_PACKET_CODE]; //!< We end up allocating ~16K, but memory is cheap so
154154
//!< what the hell. This is required because instances of
155155
//!< FreeRADIUS delay Access-Rejects, which would artificially
156156
//!< increase latency stats for Access-Requests.

src/main/radsniff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1530,7 +1530,7 @@ static void rs_packet_process(uint64_t count, rs_event_t *event, struct pcap_pkt
15301530
* CoA and Disconnect Messages, as we get the average latency across both
15311531
* response types.
15321532
*
1533-
* It also justifies allocating PW_CODE_MAX instances of rs_latency_t.
1533+
* It also justifies allocating FR_MAX_PACKET_CODE instances of rs_latency_t.
15341534
*/
15351535
rs_stats_update_latency(&stats->exchange[current->code], &latency);
15361536
rs_stats_update_latency(&stats->exchange[original->expect->code], &latency);

0 commit comments

Comments
 (0)