diff --git a/CHANGELOG b/CHANGELOG index 404798ca..18e33041 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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) diff --git a/src/netif/ppp/ppp.c b/src/netif/ppp/ppp.c index d880310e..2a346575 100644 --- a/src/netif/ppp/ppp.c +++ b/src/netif/ppp/ppp.c @@ -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.