Add a uint16_t control buffer type, as a union.
Then adapt the code using it. Make putting uint16_t easier in the buffer. Pleases gcc better. Signed-off-by: Benjamin Cama <benoar@dolka.fr>
This commit is contained in:
parent
036223c418
commit
639b43bffc
2 changed files with 42 additions and 39 deletions
5
l2tpns.h
5
l2tpns.h
|
|
@ -242,7 +242,10 @@ typedef struct controls // control message
|
|||
{
|
||||
struct controls *next; // next in queue
|
||||
uint16_t length; // length
|
||||
uint8_t buf[MAXCONTROL];
|
||||
union {
|
||||
uint8_t buf[MAXCONTROL];
|
||||
uint16_t buf16[MAXCONTROL/2];
|
||||
} __attribute__ ((__transparent_union__));
|
||||
}
|
||||
controlt;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue