summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* cleanup - remove config.candroid11-devMaciej Żenczykowski2020-06-044-46/+11
| | | | | | | | | | | | | Test: git grep 'config[.]c' comes up empty Bug: 144730808 Test: atest clatd_test netd_integration_test Signed-off-by: Maciej Żenczykowski <maze@google.com> Original-Change: https://android-review.googlesource.com/1323172 Merged-In: I8500881852f1255a69b49eba6354777883fe438f Change-Id: I8500881852f1255a69b49eba6354777883fe438f
* cleanup - remove tun.hMaciej Żenczykowski2020-06-047-40/+9
| | | | | | | | | | | | | | | | Longer term we should probably just merge the clat_config and tun_data structs, but not just yet. Test: git grep '(^|[^_])tun[.]h' comes up empty Bug: 144730808 Test: atest clatd_test netd_integration_test Signed-off-by: Maciej Żenczykowski <maze@google.com> Original-Change: https://android-review.googlesource.com/1323171 Merged-In: I7c3a986584aa3d02519545fb928457b61247ed14 Change-Id: I7c3a986584aa3d02519545fb928457b61247ed14
* cleanup - remove send_tun()Maciej Żenczykowski2020-06-042-12/+1
| | | | | | | | | | | | | Test: git grep send_tun comes up empty Bug: 144730808 Test: atest clatd_test netd_integration_test Signed-off-by: Maciej Żenczykowski <maze@google.com> Original-Change: https://android-review.googlesource.com/1322978 Merged-In: If81ca18bf5a33549b532de0d6406e32f4560c93a Change-Id: If81ca18bf5a33549b532de0d6406e32f4560c93a
* cleanup - read_config() and ipv4_local_prefixlenMaciej Żenczykowski2020-06-045-48/+5
| | | | | | | | | | | | | Test: git grep 'read_config|ipv4_local_prefixlen|default_pdp_interface' comes up empty Bug: 144730808 Test: atest clatd_test netd_integration_test Signed-off-by: Maciej Żenczykowski <maze@google.com> Original-Change: https://android-review.googlesource.com/1322226 Merged-In: I67b70fe298f69ac51dfbc5daf4078b842fb62808 Change-Id: I67b70fe298f69ac51dfbc5daf4078b842fb62808
* cleanup - config_item_ip() and DEFAULT_IPV4_LOCAL_SUBNETMaciej Żenczykowski2020-06-042-33/+0
| | | | | | | | | | | | | Test: git grep 'config_item_ip|DEFAULT_IPV4_LOCAL_SUBNET' comes up empty Bug: 144730808 Test: atest clatd_test netd_integration_test Signed-off-by: Maciej Żenczykowski <maze@google.com> Original-Change: https://android-review.googlesource.com/1322225 Merged-In: I0cb3fe5bae5f663d07a8cb63f2dd9ef9ca1a6dd8 Change-Id: I0cb3fe5bae5f663d07a8cb63f2dd9ef9ca1a6dd8
* cleanup - config_item_ip6()Maciej Żenczykowski2020-06-041-27/+0
| | | | | | | | | | | | | Test: git grep config_item_ip6 comes up empty Bug: 144730808 Test: atest clatd_test netd_integration_test Signed-off-by: Maciej Żenczykowski <maze@google.com> Original-Change: https://android-review.googlesource.com/1322224 Merged-In: I0338f7ac29fdb0de56bd4a500e2a827cab2c47f7 Change-Id: I0338f7ac29fdb0de56bd4a500e2a827cab2c47f7
* cleanup - config_item_int16() & DEFAULT_IPV4_LOCAL_PREFIXLENMaciej Żenczykowski2020-06-042-47/+1
| | | | | | | | | | | | | Test: git grep 'config_item_int16|DEFAULT_IPV4_LOCAL_PREFIXLEN' comes up empty Bug: 144730808 Test: atest clatd_test netd_integration_test Signed-off-by: Maciej Żenczykowski <maze@google.com> Original-Change: https://android-review.googlesource.com/1322223 Merged-In: I71716cdcba382bc5fb1efa5000189f63a57015c9 Change-Id: I71716cdcba382bc5fb1efa5000189f63a57015c9
* cleanup - config_item_str()Maciej Żenczykowski2020-06-041-17/+0
| | | | | | | | | | | | | Test: git grep config_item_str comes up empty Bug: 144730808 Test: atest clatd_test netd_integration_test Signed-off-by: Maciej Żenczykowski <maze@google.com> Original-Change: https://android-review.googlesource.com/1322222 Merged-In: I1a8f21e55534457718ea58cdab15266b9f232fd3 Change-Id: I1a8f21e55534457718ea58cdab15266b9f232fd3
* cleanup - ipv6_host_id and is_dynamic_iidMaciej Żenczykowski2020-06-043-19/+0
| | | | | | | | | | | | | Test: git grep 'ipv6_host_id|is_dynamic_iid' comes up empty Bug: 144730808 Test: atest clatd_test netd_integration_test Signed-off-by: Maciej Żenczykowski <maze@google.com> Original-Change: https://android-review.googlesource.com/1322221 Merged-In: Ie3ed4583a95f15165a05412a556bae99dc07706b Change-Id: Ie3ed4583a95f15165a05412a556bae99dc07706b
* cleanup - dump_config()Maciej Żenczykowski2020-06-041-19/+0
| | | | | | | | | | | | | Test: git grep dump_config comes up empty Bug: 144730808 Test: atest clatd_test netd_integration_test Signed-off-by: Maciej Żenczykowski <maze@google.com> Original-Change: https://android-review.googlesource.com/1322220 Merged-In: I781bbb0523211349893d947a500edf0eb12dedfd Change-Id: I781bbb0523211349893d947a500edf0eb12dedfd
* Delete the clatd code that assigns IPv4 and IPv6 addresses.Maciej Żenczykowski2020-06-025-375/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The IPv4 and IPv6 address assignment code, and its tests, were migrated to ClatdController in Q, and this code has been unused since then. This code is not only unused, it also *should* never be used, because if it were, many parts of 464xlat on Android would not work as expected. This includes 464xlat BPF offload and data usage accounting, both of which require netd to know exactly which IPv4 and IPv6 addresses are used by clatd at any given time. Most of the code is deleted, but the function to generate random checksum-neutral IIDs was moved to the tests instead. This change does not delete the configuration file parsing code. That will be done in a follow-up CL. Bug: 144730808 Bug: 150738490 Test: atest clatd_test Test: atest netd_integration_test Test: IPv6-only wifi continues to work Original-Change: https://android-review.googlesource.com/1320923 Merged-In: I8265e9bb04d44ed1dda445fa91881fcd1601dc47 Change-Id: I8265e9bb04d44ed1dda445fa91881fcd1601dc47
* Remove DNS64 detection code from clatd.Lorenzo Colitti2020-06-029-205/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This has been unused since Q, when the NAT64 prefix started being detected and passed in by netd instead. Many things depend on the prefix being correct, including clat BPF offload and DNS64 synthesis, and doing DNS64 detection in clatd provides no way to make these work. Additionally, R now supports getting the NAT64 prefix via the RA, which makes DNS64 detection in clatd even less useful. This CL removes all the DNS64 detection code. The new code parses the prefix in main.c, and if the prefix is not valid, refuses to start. This also lets us remove the -n <netid> parameter which was only used for DNS64 detection. It also removes a dependency on dnsproxyd_protocol_headers, which should be depended on by as few parts of the system as possible. Test: m Bug: 144730808 Bug: 151895202 Test: IPv6-only wifi continues to work Original-Change: https://android-review.googlesource.com/1320917 Merged-In: I892f364d6cbfe76277686387e35c04d3d6eb5ecc Change-Id: I892f364d6cbfe76277686387e35c04d3d6eb5ecc
* Use dnsproxyd_protocol_headers instead of libnetd_client_headers for ↵Luke Huang2020-05-282-2/+2
| | | | | | | | | | NETID_USE_LOCAL_NAMESERVERS NETID_USE_LOCAL_NAMESERVERS is no longer in libnetd_client_headers Bug: 151895202 Test: build Change-Id: I064f60fa4edf5a1b2ad7f8a127ab531f0ab0c52c
* clatd: don't 'pretend' to disable IPV6_CHECKSUMMaciej Żenczykowski2020-04-021-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code is not needed. The comment doesn't match the functionality as implemented: 0 means *ON* at offset 0 - not clear when this would make sense. 2 means on at offset 2 - this would be correct for IPPROTO_ICMPV6 4 means on at offset 4 - thus would be correct for IPPROTO_MH -1 would actually mean off, but that's also the socket creation default. In practice this doesn't even matter, because this socket is used only for transmit and sockets like this one which are created via socket(AF_INET6, SOCK_RAW, IPPROTO_RAW) default to having IPV6_HDRINCL enabled which doesn't even support transmit checksum calculation. This is because on a header inclusive RAW6 socket rawv6_sendmsg (which is the core implementation for all write operations on AF_INET6 raw sockets) calls into rawv6_send_hdrinc instead of ip6_append_data and ip6_flush_pending_frames/rawv6_push_pending_frames and simply never even references the socket field that the IPV6_CHECKSUM socket option changes (easy to check by checking accesses to raw6_sk(sk)->checksum). Also: it would be hard to make it support it due to checksum offset being protocol dependent and thus not even a constant on all protocol capable (ie. IPPROTO_RAW) sockets. Test: built, flashed to flame verified ipv4 clat functionality with no offload Bug: 150730674 Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I62990f427c24cf62a38bd63d5c9d9dea4f0dc2f6 Merged-In: I62990f427c24cf62a38bd63d5c9d9dea4f0dc2f6
* remove ClatdTest.ConfigureIpv6Address am: 5e5d29d88b am: 97bd0e95d7 am: ↵Automerger Merge Worker2020-01-311-20/+0
|\ | | | | | | | | | | 5a4ef6ef73 Change-Id: I50ac24424450fd7f08f057cfeaecd89199ce665a
| * remove ClatdTest.ConfigureIpv6Address am: 5e5d29d88b am: 97bd0e95d7Automerger Merge Worker2020-01-311-20/+0
| |\ | | | | | | | | | Change-Id: I8c096dcd39599d26fb937e2bc59a8a6cefcb4cce
| | * remove ClatdTest.ConfigureIpv6Address am: 5e5d29d88bandroid-r-preview-4android-r-preview-3android-r-preview-2Automerger Merge Worker2020-01-311-20/+0
| | |\ | | | | | | | | | | | | Change-Id: I17fab7a7042e113c0687e33aab88d320b696be78
| | | * remove ClatdTest.ConfigureIpv6Addressandroid-r-preview-1Maciej Żenczykowski2020-01-301-20/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test isn't useful, because we always select the ipv6 address within netd and pass it in via cli. (and then we rename ClatdTest.ConfigureIpv6AddressCommandLine to ClatdTest.ConfigureIpv6Address) Test: builds Bug: 144730808 Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I5dbf1cd2a253a48de187faafa7c259ceab7dba67
* | | | Derive mtu from ipv6 route to ipv4 /96 prefix instead of device am: ↵Automerger Merge Worker2020-01-229-112/+68
|\| | | | | | | | | | | | | | | | | | | | | | | b00113f49a am: e0417af9df am: 70ef3ae950 Change-Id: Ib0d47dad170342c176b3f13154f8cc64b5ef615b
| * | | Derive mtu from ipv6 route to ipv4 /96 prefix instead of device am: ↵Automerger Merge Worker2020-01-229-112/+68
| |\| | | | | | | | | | | | | | | | | | | | | | b00113f49a am: e0417af9df Change-Id: I7674ffab9f8bb652d3a384c431dc06bfb49b49ba
| | * | Derive mtu from ipv6 route to ipv4 /96 prefix instead of deviceMaciej enczykowski2020-01-219-112/+68
| |/| | | | |/ | | | | | | | | | | | | am: b00113f49a Change-Id: Ib8d9b9a6a23f78cda1024e3a35408c73eea20af5
| | * Derive mtu from ipv6 route to ipv4 /96 prefix instead of deviceMaciej Żenczykowski2020-01-209-112/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test: builds, atest, still needs testing on real network x86 clatd_test -------------- clatd_test (19 Tests) ... [6/19] ClatdTest#DetectMtu: PASSED (0ms) ... Bug: 147935930 Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I3d11ba082dabf70089867146acd84f6436953663
* | | remove configuration option 'plat_from_dns64_hostname' am: b6b5104bab am: ↵Maciej enczykowski2019-11-303-19/+2
|\| | | | | | | | | | | | | | | | | | | | | | | 6021ef919b am: 4b4a836778 Change-Id: I177d6035a26667ed39d4adb68e4fcb9d32b8b4b7
| * | remove configuration option 'plat_from_dns64_hostname' am: b6b5104babMaciej enczykowski2019-11-303-19/+2
| |\| | | | | | | | | | | | | | | | am: 6021ef919b Change-Id: Ife3a794d7230ffb7b22ebe303f012634817201ef
| | * remove configuration option 'plat_from_dns64_hostname'Maciej enczykowski2019-11-303-19/+2
| | |\ | | | | | | | | | | | | | | | | | | | | am: b6b5104bab Change-Id: I6d48e97a03d770d95824c59151e9ef54e5bb037d
| | | * remove configuration option 'plat_from_dns64_hostname'Maciej Żenczykowski2019-11-303-19/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RFC 7050 has been a standard for so long, and is likely used by so many other implementations, that it doesn't seem to make sense to use anything else then 'ipv4only.arpa' (also that's what netd uses, and this code here is really dead, since in Q we moved the detection out of clatd and into netd). Test: builds, 'git grep free_config' comes up empty 'git grep plat_from_dns64_hostname' comes up empty Bug: 144730808 Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: Ibf0c8d5e2cec6359fba1f7dd8867bd2742f362b4
* | | | remove configuration option 'mtu' am: 3cedd1d5dd am: 63dfc75a79Maciej enczykowski2019-11-301-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | am: a382560baa Change-Id: Ib8d95a7498e8ee8671f6aa4238cc6630821c82d0
| * | | remove configuration option 'mtu' am: 3cedd1d5ddMaciej enczykowski2019-11-301-1/+1
| |\| | | | | | | | | | | | | | | | | | | | | | am: 63dfc75a79 Change-Id: I22896b84bc5f0e33f1e6c9780e3f60365116e76e
| | * | remove configuration option 'mtu'Maciej enczykowski2019-11-301-1/+1
| | |\| | | | | | | | | | | | | | | | | | | | | am: 3cedd1d5dd Change-Id: I18ba029b860c0d054e062fb76fcd61c227e58684
| | | * remove configuration option 'mtu'Maciej Żenczykowski2019-11-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This isn't useful because anyone wanting to set the IPv6 MTU can simply set that by setting the IPv6 MTU on the interface. Test: builds Bug: 144730808 Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: Id140dc9865d33b66b120b932cb16e4d4fa70fc47
* | | | remove configuration option 'ipv4mtu' am: 7c3b5dcb95 am: b430caf8b8Maciej enczykowski2019-11-301-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | am: f87df0b5ce Change-Id: Ie5d042da6ba53c349ca14ad66d9991c35be77216
| * | | remove configuration option 'ipv4mtu' am: 7c3b5dcb95Maciej enczykowski2019-11-301-1/+1
| |\| | | | | | | | | | | | | | | | | | | | | | am: b430caf8b8 Change-Id: I7626c61b7b258d6dd7cfe311231942ebb6ae423d
| | * | remove configuration option 'ipv4mtu'Maciej enczykowski2019-11-301-1/+1
| | |\| | | | | | | | | | | | | | | | | | | | | am: 7c3b5dcb95 Change-Id: I4b905db53d15bc664cc3bd035978eebc7c4b73b3
| | | * remove configuration option 'ipv4mtu'Maciej Żenczykowski2019-11-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifying the MTU in a per-device configuration file is in general incorrect because different networks have different MTUs. Carriers or operators that want to lower the MTU can lower the IPv6 MTU (from which the IPv4 MTU is automatically calculated), or set the MTU manually from Nat464Xlat or ConnectivityService. Doing it this way has the benefit of supporting different MTUs for different networks. Test: builds Bug: 144730808 Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: Ia6005421e81fc0007067d9774e28f9aae64d1160
* | | | clatd - move bind() post bpf filter attach am: 69c840fe53 am: 2591639189Maciej enczykowski2019-11-272-12/+14
|\| | | | | | | | | | | | | | | | | | | | | | | am: 03badb1bef Change-Id: I763952f63a8711f2e0e61c52ca20a05eec342cb5
| * | | clatd - move bind() post bpf filter attach am: 69c840fe53Maciej enczykowski2019-11-272-12/+14
| |\| | | | | | | | | | | | | | | | | | | | | | am: 2591639189 Change-Id: Ie34338cdd62ce5b74e9f340a5a40f5fcec18b4ec
| | * | clatd - move bind() post bpf filter attachMaciej enczykowski2019-11-272-12/+14
| | |\| | | | | | | | | | | | | | | | | | | | | am: 69c840fe53 Change-Id: Ic6b8f600533321b834d8b5604a8e4246dd51c3c9
| | | * clatd - move bind() post bpf filter attachMaciej Żenczykowski2019-11-272-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a minor race where the ingress ipv6 raw socket can receive/deliver packets prior to the bpf filter being setup to filter them out. Test: builds, booted on crosshatch, clat continues to work Bug: 144635476 Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I47a4f908d1d365937885d36902fa6a92c53d1ebf
* | | | remove clatd_microbenchmark.c am: badfbedcad am: 0f08b92e18Maciej enczykowski2019-11-274-294/+0
|\| | | | | | | | | | | | | | | | | | | | | | | am: 7c309ec8ce Change-Id: I035b215eea82d0686d14058cef146e64a60adb01
| * | | remove clatd_microbenchmark.c am: badfbedcadMaciej enczykowski2019-11-274-294/+0
| |\| | | | | | | | | | | | | | | | | | | | | | am: 0f08b92e18 Change-Id: I4d48f09bb64ae21545d0ea81eafbb64f3f30be0b
| | * | remove clatd_microbenchmark.cMaciej enczykowski2019-11-274-294/+0
| | |\| | | | | | | | | | | | | | | | | | | | | am: badfbedcad Change-Id: I6f97eff2233f01493985efeebb66cb9bf7cf802e
| | | * remove clatd_microbenchmark.cMaciej Żenczykowski2019-11-264-294/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the era of ebpf offload the speed of writing packets via tun and reading via udp socket aren't all that important. Test: builds Bug: 144730808 Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: Ie2b49c8b109052b9212d3b21fd16784a464e2a1b
* | | | external: android-clat: fix -Wreorder-init-list am: 75f4dc6ec7 am: 769cb08b99Nick Desaulniers2019-11-191-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | am: 63b6883a96 Change-Id: Ibc9e3540caed769d23f7061379522d66db0d58d3
| * | | external: android-clat: fix -Wreorder-init-list am: 75f4dc6ec7Nick Desaulniers2019-11-191-2/+2
| |\| | | | | | | | | | | | | | | | | | | | | | am: 769cb08b99 Change-Id: Ia24582c1d0fc5b3620751194ce2c245feeb5309a
| | * | external: android-clat: fix -Wreorder-init-listNick Desaulniers2019-11-191-2/+2
| | |\| | | | | | | | | | | | | | | | | | | | | am: 75f4dc6ec7 Change-Id: I9b2cfdefc7c5cbe279f21d71b826c5c8156d8c3a
| | | * external: android-clat: fix -Wreorder-init-listNick Desaulniers2019-11-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C++20 will require members in a designated initializer to be in order unlike C99. Bug: 139945549 Test: mm Change-Id: I5d94739894a5882f571c1e0ddf069725f0c246e8 Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
* | | | make clat checksum tests more reliable am: f037e77296 am: 83f9e3705aMaciej enczykowski2019-11-121-2/+4
|\| | | | | | | | | | | | | | | | | | | | | | | am: 3e4917dbbd Change-Id: I33e9b1034f4b40bb12a8b5d0d7be53b631cdc8c3
| * | | make clat checksum tests more reliable am: f037e77296Maciej enczykowski2019-11-121-2/+4
| |\| | | | | | | | | | | | | | | | | | | | | | am: 83f9e3705a Change-Id: Ie301d2022591af231695b2a351b7e5fa1ab47216
| | * | make clat checksum tests more reliableMaciej enczykowski2019-11-121-2/+4
| | |\| | | | | | | | | | | | | | | | | | | | | am: f037e77296 Change-Id: I8b2e476e70b737bfad9bd4e8bb74a9bf9a5307c9
| | | * make clat checksum tests more reliableMaciej Żenczykowski2019-11-101-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is to allow increasing pseudochecksum returned by 0xFFFF, which is another form of 16-bit 1's complement 0 and thus irrelevant. Test: builds, atest Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I8cfa04ed1c0bdde2a605cff258a12690748f3bd5