patch by Sylvain Rochet: fixed bug #36283 (PPP struct used on header size computation and not packed)

This commit is contained in:
goldsimon 2012-05-03 20:39:43 +02:00
parent 1704d21356
commit 3ac81e9d7c
2 changed files with 18 additions and 3 deletions

View File

@ -80,6 +80,10 @@ HISTORY
++ Bugfixes:
2012-05-03: Simon Goldschmidt (patch by )
* ppp.c: fixed bug #36283 (PPP struct used on header size computation and
not packed)
2012-05-03: Simon Goldschmidt (patch by David Empson)
* ppp.c: fixed bug #36388 (PPP: checksum-only in last pbuf leads to pbuf with
zero length)

View File

@ -1586,10 +1586,21 @@ pppSingleBuf(struct pbuf *p)
return q;
}
/** Input helper struct, must be packed since it is stored to pbuf->payload,
* which might be unaligned.
*/
#ifdef PACK_STRUCT_USE_INCLUDES
# include "arch/bpstruct.h"
#endif
PACK_STRUCT_BEGIN
struct pppInputHeader {
int unit;
u16_t proto;
};
PACK_STRUCT_FIELD(int unit);
PACK_STRUCT_FIELD(u16_t proto);
} PACK_STRUCT_STRUCT;
PACK_STRUCT_END
#ifdef PACK_STRUCT_USE_INCLUDES
# include "arch/epstruct.h"
#endif
/*
* Pass the processed input packet to the appropriate handler.