4 Jul 22:15
pppoe problem on an arm-based device.
Richard Ray Zhang <zhr_buaa <at> 263.net>
2006-07-04 20:15:48 GMT
2006-07-04 20:15:48 GMT
Hi, all
I encountered a problem with pppoe on an arm-based device.
The target environment is arm-linux 2.4.18, glibc 2.3.3.
The cross-compiler is armv4l-linux-gnu-gcc 3.4.2.
I have cross-compiled pppd 2.4.3 and rp-pppoe 3.8 to device.
I can dial the normal 56K modem correctly by pppd. I think that the pppd
should be correct.
When I dial the ADSL modem, I found that the PADI packet was incorrect.
The PADI header generated by device is bigger than the correct one,
which is generated by PC. After checking the code, I found the ethhdr in
PPPoEPacketStruct was aligned incorrectly. So, I changed the
PPPoEPacketStruct as the following codes.
--------------------code modification-----------------------
typedef struct __attribute__ ((packed)) PPPoEPacketStruct {
struct __attribute__ ((packed)){
unsigned char h_dest[ETH_ALEN]; /* destination eth addr
*/
unsigned char h_source[ETH_ALEN]; /* source ether addr
*/
unsigned short h_proto; /* packet type ID field
*/
} ethHdr; /* Ethernet header */
#ifdef PACK_BITFIELDS_REVERSED
unsigned int type:4; /* PPPoE Type (must be 1) */
unsigned int ver:4; /* PPPoE Version (must be 1) */
#else
(Continue reading)
RSS Feed