I was porting PPTPD to ARM board, recently. After tested with other platforms including X86.
It always workable with any client, but only invalid on my target board ...
It takes my around week to figure out the problem.
M.., eventually. I find the problem: memory alignment issues on ARM.
A struct gre_header points to a char buf[]. and char does NOT ficking aligned memory.
This problem delays my schedule almost 1 week....
I just modified as:
int decaps_gre(....)
static unsigned char buffer[PACKT_MAX + 64] __attribute__ ((aligned(4)));
GOT IT! I fixed this bug.
But I want to know: Why compile does not alignment global static varibles? a risk might occurred on some platforms.
沒有留言:
張貼留言