Open GoogleCodeExporter opened 9 years ago
Original comment by harald....@gmail.com
on 19 Jan 2011 at 10:16
A short update: I'm currently working on version 3 of the app (complete rewrite
of some main-functions) and I will integrate exactly this as a selectable
option in settings. Thanks again for the patch!
Original comment by harald....@gmail.com
on 25 Jan 2011 at 12:34
Cool, thanks!
Original comment by mkas...@gmail.com
on 26 Jan 2011 at 5:50
Mmmh ... I've implemented that now ... but I get errors when enabling mss
clamping.
iptables -t mangle -I FORWARD -s 192.168.2.0/24 -p tcp --tcp-flags SYN,RST SYN
-j TCPMSS --clamp-mss-to-pmtu]
getsockopt for multiport failed strangely: No such file or directory
getsockopt for multiport failed strangely: No such file or directory
FIX ME! implement getprotobyname() bionic/libc/bionic/stubs.c:378
iptables v1.3.7: Unknown arg `--clamp-mss-to-pmtu'
Try `iptables -h' or 'iptables --help' for more information.
That's on a nexus one running cyanogenmod and I've tried various versions of
the iptables-binary (from froyo-aosp).
Oh ... wait ... CONFIG_NETFILTER_XT_MATCH_TCPMSS is not enabled in the
cyanogenmod-kernel.
Original comment by harald....@gmail.com
on 10 Feb 2011 at 10:21
OK, I see what's going on.
The "Unknown arg `--clamp-mss-to-pmtu'" error means that Froyo iptables doesn't
have TCPMSS support either. Turns out it does (and probably previous versions
as well), it's just not compiled by default.
Attached is a patch for external/iptables/Android.mk to enable building of
TCPMSS support in iptables. It's against android-2.2.2_r1, but the version
shouldn't matter.
You can test an iptables binary for support with "strings iptables | grep
clamp-mss-to-pmtu". If you see a few strings in the result, the binary should
be good.
Now, for the command to actually take effect you'll need support for both
CONFIG_NETFILTER_XT_TARGET_TCPMSS and CONFIG_IP_NF_MANGLE in the kernel.
They're enabled in stock Samsung kernels, but not HTC, and maybe not
CyanogenMod either.
CONFIG_NETFILTER_XT_MATCH_TCPMSS is something else entirely and shouldn't be
necessary.
Original comment by mkas...@gmail.com
on 13 Feb 2011 at 4:55
Attachments:
Ok. Here we go ...
http://android-wifi-tether.googlecode.com/files/wifi_tether_v3_0-pre5.apk
There is now an option in "settings" to enable mss clamping.
(You only see this option if CONFIG_NETFILTER_XT_TARGET_TCPMSS is enabled in
kernel and /proc/config.gz exists.)
I don't know what device you have (v3 doesn't support the same range of
different devices like the old 2.0-tree) ...
Thanks again for the patch and all your help.
Original comment by harald....@gmail.com
on 14 Feb 2011 at 9:42
Cool, it works! The only caveat is that I had to compile a new kernel since
the stock Epic (which is the phone I have) Eclair kernel doesn't have IKCONFIG
(/proc/config.gz) support.
So I checked the stock kernel sources for a number of other Samsung Android
devices (I9000, Captivate, Vibrant, & Fascinate) since I suspect these are the
ones that would largely support MSS clamping out-of-the-box. Like the Epic,
the Eclair sources have TCPMSS support but not IKCONFIG. One option would be
to whitelist these devices, but it's probably not the best idea for the reason
below.
I also checked out the Froyo kernel sources for the Samsung devices that have
an official Froyo release (I9000 & Vibrant). Again, they don't have IKCONFIG
enabled, but even more strangely is that TCPMSS support is compiled as a
module. It's strange since very few in tree drivers are compiled as modules.
What's worse, is that the module (xt_TCPMSS.ko) is found in neither the
initramfs nor /system in the stock firmware images. This appears to be the
case in the leaked Epic Froyo firmware as well. Lame.
Since Eclair is going away on Samsung devices, whitelisting probably doesn't
make sense when TCPMSS doesn't work in Froyo out-of-the-box. I suppose the
right thing to do would be to look for "CONFIG_NETFILTER_XT_TARGET_TCPMSS=y" in
/proc/config.gz as you already do--this covers custom kernels with TCPMSS
support compiled in--and also to check for "xt_TCPMSS" in /proc/modules, which,
if it exists, means the kernel has the appropriate module loaded.
I suppose loading the xt_TCPMSS.ko module is best left to the user as there's
no uniform place where it would exist.
Original comment by mkas...@gmail.com
on 17 Feb 2011 at 3:59
ahm. you have an epic 4g?
Original comment by harald....@gmail.com
on 17 Feb 2011 at 5:16
Yes, Sprint Epic 4G running DI18, latest official (Eclair) release with a few
kernel patches.
Original comment by mkas...@gmail.com
on 17 Feb 2011 at 8:56
Does it (version 3.0-preX) work in infrastructure/master-mode for you or ad-hoc
(peer-to-peer)?
Original comment by harald....@gmail.com
on 17 Feb 2011 at 10:06
3.0-pre9 works in ad-hoc mode, but does not work in infrastructure with default
settings (i.e., encryption off). Fails on the steps:
Loading WiFi firmware
Configuring softap
Starting softap
Activating WiFi interface
But passes the others.
Is there a way to get verbose output from the "tether" script?
Original comment by mkas...@gmail.com
on 18 Feb 2011 at 12:18
Original issue reported on code.google.com by
mkas...@gmail.com
on 18 Jan 2011 at 8:48Attachments: