Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32af8c2a authored by Erik Kline's avatar Erik Kline
Browse files

Add "ip xfrm policy" to dumpstate output

Test: local build, treehugger

Bug: 30869013
Change-Id: I1f0e5d820f0153484c38ecb0f9c764fca02d786c
parent 4308a78a
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -853,12 +853,12 @@ static bool add_text_zip_entry(const std::string& entry_name, const std::string&
static void dump_iptables() {
    RunCommand("IPTABLES", {"iptables", "-L", "-nvx"});
    RunCommand("IP6TABLES", {"ip6tables", "-L", "-nvx"});
    RunCommand("IPTABLE NAT", {"iptables", "-t", "nat", "-L", "-nvx"});
    RunCommand("IPTABLES NAT", {"iptables", "-t", "nat", "-L", "-nvx"});
    /* no ip6 nat */
    RunCommand("IPTABLE MANGLE", {"iptables", "-t", "mangle", "-L", "-nvx"});
    RunCommand("IP6TABLE MANGLE", {"ip6tables", "-t", "mangle", "-L", "-nvx"});
    RunCommand("IPTABLE RAW", {"iptables", "-t", "raw", "-L", "-nvx"});
    RunCommand("IP6TABLE RAW", {"ip6tables", "-t", "raw", "-L", "-nvx"});
    RunCommand("IPTABLES MANGLE", {"iptables", "-t", "mangle", "-L", "-nvx"});
    RunCommand("IP6TABLES MANGLE", {"ip6tables", "-t", "mangle", "-L", "-nvx"});
    RunCommand("IPTABLES RAW", {"iptables", "-t", "raw", "-L", "-nvx"});
    RunCommand("IP6TABLES RAW", {"ip6tables", "-t", "raw", "-L", "-nvx"});
}

static void dumpstate(const std::string& screenshot_path, const std::string& version) {
@@ -1620,6 +1620,10 @@ int main(int argc, char *argv[]) {
    add_mountinfo();
    dump_iptables();

    // Capture any IPSec policies in play.  No keys are exposed here.
    RunCommand("IP XFRM POLICY", {"ip", "xfrm", "policy"},
               CommandOptions::WithTimeout(10).Build());

    // Run ss as root so we can see socket marks.
    RunCommand("DETAILED SOCKET STATE", {"ss", "-eionptu"}, CommandOptions::WithTimeout(10).Build());