tomilius, a note about good patches.
I could not apply your patch completely at the moment, the reason is that new packages or updated packages, which are coming from sources - I mean ebtables, iptables, dnsmasq should not go directly to gateway (as this directory gets constructed from the actual sources), instead .tar.gz and .tar.bz2 should go to the wl500g-1.9.2.7-5 dir, patches against these sources should go to the same dir.
Just think of how I'm maintaining this stuff.
On the other hand if you patch something from the router directory (I mean sources which was not converted yet), make a diff against original gateway dir and your version (this applies to Makefile - and your patch is fine in this case). The same applies to kernel - your patch is fine.
I hope you are now understand the things I'm talking about. As otherwise before using your patch I would need to convert iptables/ebtables/dnsmasq to proper things and check for any customizations you've done, but this requires too many time...