Skip to content
This repository has been archived by the owner on Oct 13, 2022. It is now read-only.

Fixes a few bugs I ran into while trying to port to TL-WR1043ND (AP83) #82

Merged
merged 12 commits into from Mar 22, 2016

Conversation

ranma
Copy link
Contributor

@ranma ranma commented Oct 19, 2015

Fixes a few bugs I ran into while trying to port to TL-WR1043ND (AP83) and followed up with a few other improvements that will make the code-merge for TL-WR1043ND easier or are independent of the TL-WR1043ND port.

Returning NULL leads to subtle corruption and malloc returning memory
addresses in the user mode space range (0x00000000-0x7fffffff).

This in turn also breaks everything that implicitly relies on malloc()ed
memory to be zeroed at the beginning (since the malloc arena is
initially zeroed).
Only the first sizeof(ptr) bytes were initialized correctly.
This leads to a crash in ag7250_send() if mac->next_tx is uninitialized
(if the memory returned by malloc() is not nulled).
The code only checks for existance, so -DCOMPRESSED_UBOOT=0
leads to "#ifdef COMPRESSED_UBOOT" protected sections to be wrongly
included.
Adds compatibility-macro for crc32.
Setting first arg (crc) to anything but 0 is not supported, but all
callers already conform to this.
This is asserted at compile time through macro trickery.

Reduces uncompressed code size by ~1KB:
Without this change: Data Size: 127348 Bytes = 124.36 kB = 0.12 MB
After this change: Data Size: 126084 Bytes = 123.13 kB = 0.12 MB
@ranma
Copy link
Contributor Author

ranma commented Oct 21, 2015

Tested to compile & work on MR3020 as of 2d3f5ed:
New image is smaller by ~1KB due to the smaller crc32 implementation.

@pepe2k
Copy link
Owner

pepe2k commented Nov 13, 2015

Hello @ranma,

Thanks for your contribution! I have already included your changes in my local repository.

Cheers,
Piotr

@pepe2k pepe2k merged commit 2d3f5ed into pepe2k:master Mar 22, 2016
@leleobhz
Copy link

@pepe2k - Is with this patch, TL-WR1043ND supported?

@pepe2k
Copy link
Owner

pepe2k commented Jul 19, 2016

@leleobhz nope

@leleobhz
Copy link

Do you have some intention to support it?

@pepe2k
Copy link
Owner

pepe2k commented Jul 19, 2016

Only >= v2.

@vinibali
Copy link

Hi @pepe2k!
Can we expect binaries for V2.0+ devices?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants