Augmented cookie format to store the seeds used to generate IPv4 and IPv6 addresses.

This ensures that if the IP previously used by a user is free, it will
be reassigned to him after a reconnection with the same cookie.
This commit is contained in:
Nikos Mavrogiannopoulos
2013-12-11 10:03:45 +01:00
parent 80a7ac124c
commit cb5092e820
5 changed files with 58 additions and 31 deletions

View File

@@ -96,6 +96,13 @@ struct proc_st {
char hostname[MAX_HOSTNAME_SIZE]; /* the requested hostname */
uint8_t cookie[COOKIE_SIZE]; /* the cookie associated with the session */
/* if the session is initiated by a cookie the following two are set
* and are considered when generating an IP address.
*/
uint8_t seeds_are_set; /* non zero if the following two elements are set */
uint8_t ipv4_seed[4];
uint8_t ipv6_seed[16];
void * auth_ctx; /* the context of authentication */
unsigned auth_status; /* PS_AUTH_ */
unsigned auth_reqs; /* the number of requests received */