eap: Use pen_t instead of uint32_t for vendor ID

This commit is contained in:
Tobias Brunner
2022-09-21 13:53:44 +02:00
parent 8f5ff23d6c
commit f6e6fcd2f6
29 changed files with 60 additions and 59 deletions
+2 -2
View File
@@ -142,7 +142,7 @@ eap_vendor_type_t *eap_vendor_type_from_string(char *str)
enumerator_t *enumerator;
eap_vendor_type_t *result = NULL;
eap_type_t type = 0;
uint32_t vendor = 0;
pen_t vendor = 0;
char *part, *end;
/* parse EAP method string of the form: [eap-]type[-vendor] */
@@ -170,7 +170,7 @@ eap_vendor_type_t *eap_vendor_type_from_string(char *str)
}
errno = 0;
vendor = strtoul(part, &end, 0);
if (*end != '\0' || errno)
if (*end != '\0' || errno || vendor >= PEN_UNASSIGNED)
{
DBG1(DBG_LIB, "invalid EAP vendor: %s", part);
type = 0;
+2 -1
View File
@@ -28,6 +28,7 @@ typedef enum eap_type_t eap_type_t;
typedef struct eap_vendor_type_t eap_vendor_type_t;
#include <library.h>
#include <pen/pen.h>
/**
* EAP code, type of an EAP message
@@ -99,7 +100,7 @@ struct eap_vendor_type_t {
/**
* Vendor Id
*/
uint32_t vendor;
pen_t vendor;
};
/**