summaryrefslogtreecommitdiff
path: root/iptables.cc
diff options
context:
space:
mode:
authorJorge Lucangeli Obes <jorgelo@google.com>2016-02-01 12:27:03 -0800
committerJorge Lucangeli Obes <jorgelo@google.com>2016-02-01 14:58:51 -0800
commit2b2e047243cc1db7c5f0c744822db0fdbb7a95e0 (patch)
tree3c6ee7251f1ccabf7f9270a07b6daa2433ecc753 /iptables.cc
parent6c733cf77b78062afd7d70eb68f8832d77362086 (diff)
downloadfirewalld-2b2e047243cc1db7c5f0c744822db0fdbb7a95e0.tar.gz
Run unit tests on Brillo.
Looks like IPv6 is working correctly, so re-enable that too. Bug: 26911013 Change-Id: Iad0390e3a41a429460794b7c243ebca59cf64146
Diffstat (limited to 'iptables.cc')
-rw-r--r--iptables.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/iptables.cc b/iptables.cc
index 6276024..55756a1 100644
--- a/iptables.cc
+++ b/iptables.cc
@@ -75,9 +75,6 @@ bool IsValidInterfaceName(const std::string& iface) {
namespace firewalld {
IpTables::IpTables() {
-#if defined(__ANDROID__)
- ip6_enabled_ = false;
-#endif // __ANDROID__
}
IpTables::~IpTables() {
@@ -137,7 +134,7 @@ bool IpTables::PunchHole(uint16_t port,
<< " on interface '" << interface << "'";
if (!AddAcceptRules(protocol, port, interface)) {
// If the 'iptables' command fails, this method fails.
- LOG(ERROR) << "Adding ACCEPT rules failed";
+ LOG(ERROR) << "Adding ACCEPT rules failed.";
return false;
}
@@ -170,7 +167,7 @@ bool IpTables::PlugHole(uint16_t port,
<< " on interface '" << interface << "'";
if (!DeleteAcceptRules(protocol, port, interface)) {
// If the 'iptables' command fails, this method fails.
- LOG(ERROR) << "Deleting ACCEPT rules failed";
+ LOG(ERROR) << "Deleting ACCEPT rules failed.";
return false;
}
@@ -214,13 +211,13 @@ bool IpTables::AddAcceptRules(ProtocolEnum protocol,
} else if (ip6_enabled_) {
// It's supposed to work, fail.
LOG(ERROR) << "Could not add ACCEPT rule using '" << kIp6TablesPath
- << "', aborting operation";
+ << "', aborting operation.";
DeleteAcceptRule(kIpTablesPath, protocol, port, interface);
return false;
} else {
// It never worked, just ignore it.
LOG(WARNING) << "Could not add ACCEPT rule using '" << kIp6TablesPath
- << "', ignoring";
+ << "', ignoring.";
}
return true;
@@ -333,7 +330,7 @@ bool IpTables::ApplyVpnSetup(const std::vector<std::string>& usernames,
if (!ApplyRuleForUserTraffic(kIPv4, add)) {
LOG(ERROR) << (add ? "Adding" : "Removing")
- << " rule for IPv4 user traffic failed";
+ << " rule for IPv4 user traffic failed.";
if (add)
return false;
return_value = false;
@@ -341,7 +338,7 @@ bool IpTables::ApplyVpnSetup(const std::vector<std::string>& usernames,
if (!ApplyRuleForUserTraffic(kIPv6, add)) {
LOG(ERROR) << (add ? "Adding" : "Removing")
- << " rule for IPv6 user traffic failed";
+ << " rule for IPv6 user traffic failed.";
if (add) {
ApplyVpnSetup(added_usernames, interface, false);
return false;