OSDN Git Service

NAT: Disable FORWARD by default and set postroute before FORWARD.
authorJP Abgrall <jpa@google.com>
Fri, 15 Mar 2013 03:07:17 +0000 (20:07 -0700)
committerJP Abgrall <jpa@google.com>
Fri, 15 Mar 2013 03:07:17 +0000 (20:07 -0700)
commit659692a56cca02822a43b792baba2632d39eb739
treeb35c35b539465f50a07638b147912bd84d9aaad4
parent4ae80dea9cbf1fe1b33037aeb5feb04daeba8ee0
NAT: Disable FORWARD by default and set postroute before FORWARD.

[Adaptation from https://android-review.googlesource.com/#/c/50223 ]

For NAT table, only the first packet of data flow
hits the rules in this table. If forward is
enabled before postrouting in NAT, packet may be
forwarded without hit rules in NAT table. Phone
will not get responses for such packets because
source IP address is not translated.
How to reproduce:
1) Enable usb tethering;
2) Start ping test on PC;
3) Disable data on Phone;
4) NAT is disabled since data service is lost;
5) Enable data on Phone;
6) Ping can not recover on PC;
7) Capture tcpdump data on phone, source IP
   Address is not translated for ICMP packets.
Test result:
Run steps 1-5 in "How to reproduce", Ping session
on PC can be recovered after data is enabled.
CQ00027191

Change-Id: I1c3bcbb3d69eb7e2f61d720fa17086ee0da22fa0
NatController.cpp