]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove radius_packet_t
authorAlan T. DeKok <aland@freeradius.org>
Sun, 13 Jul 2025 15:43:05 +0000 (11:43 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 13 Jul 2025 18:05:39 +0000 (14:05 -0400)
structs require alignment.  But packets can come from anywhere,
and aren't always aligned.

src/bin/radsniff.c
src/bin/radsniff.h
src/protocols/radius/packet.c

index 1a5968c79d8995dbe707f7c6dcdc904fa77b46ed..fbe73282021bf82c176676afd3cb1af7594003b4 100644 (file)
@@ -1329,7 +1329,7 @@ static void rs_packet_process(uint64_t count, rs_event_t *event, struct pcap_pkt
        /*
         *      End of variable length bits, do basic check now to see if packet looks long enough
         */
-       len = (p - data) + sizeof(udp_header_t) + sizeof(radius_packet_t);      /* length value */
+       len = (p - data) + sizeof(udp_header_t) + RADIUS_HEADER_LENGTH; /* length value */
        if ((size_t) len > header->caplen) {
                REDEBUG("Packet too small, we require at least %zu bytes, captured %i bytes",
                        (size_t) len, header->caplen);
index 24f5e2b34fdd11eb519baf4996273bf84bff2871..2069fc2f4663963b3c87c2006b2357abf740757a 100644 (file)
@@ -97,14 +97,6 @@ typedef struct {
        uint64_t type[FR_RADIUS_CODE_MAX+ 1];
 } rs_counters_t;
 
-typedef struct CC_HINT(__packed__) {
-       uint8_t         code;
-       uint8_t         id;
-       uint8_t         length[2];
-       uint8_t         vector[RADIUS_AUTH_VECTOR_LENGTH];
-       uint8_t         data[];
-} radius_packet_t;
-
 /** Stats for a single interval
  *
  * And interval is defined as the time between a call to the stats output function.
index 74185ad566c5383b112b917636abb0632dbfd500..ca50d4546c8e9efff6fb2f73a2ffbf005e9b20e7 100644 (file)
@@ -31,15 +31,6 @@ RCSID("$Id$")
 
 #include <fcntl.h>
 
-typedef struct {
-       uint8_t code;
-       uint8_t id;
-       uint8_t length[2];
-       uint8_t vector[RADIUS_AUTH_VECTOR_LENGTH];
-       uint8_t data[1];
-} radius_packet_t;
-
-
 /*
  *     Some messages get printed out only in debugging mode.
  */