patchpanel: enable conntrack helpers on ARC start.

PPTP clients use GRE protocol to carry packets to the server. ARC
provides a PPTP client as legacy VPN, thus requires GRE to be
transmitted correctly through the NAT which is not possible without
conntrack helpers. This CL enables conntrack helpers when ARC is started
and disable them on ARC stop.

BUG=b:172214190
TEST="configure a PPTP VPN in ARC;
      ensure it connects successfully."

Change-Id: I3ccd41fb7eaa55beac73f86529a67aaa91a87861
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2912093
Tested-by: Damien Dejean <damiendejean@google.com>
Reviewed-by: Hugo Benichi <hugobenichi@google.com>
Reviewed-by: Garrick Evans <garrick@chromium.org>
Commit-Queue: Damien Dejean <damiendejean@google.com>
(cherry picked from commit 40e1598dbb523efcfd6ddfcd59a90570f05ab9f0)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2919689
diff --git a/patchpanel/arc_service_test.cc b/patchpanel/arc_service_test.cc
index e2ceed7..9682ad9 100644
--- a/patchpanel/arc_service_test.cc
+++ b/patchpanel/arc_service_test.cc
@@ -231,6 +231,9 @@
       .WillOnce(Return(true));
   EXPECT_CALL(*datapath_, AddBridge(StrEq("arcbr0"), kArcHostIP, 30))
       .WillOnce(Return(true));
+  EXPECT_CALL(*datapath_, SetConntrackHelpers(true)).WillOnce(Return(true));
+  // Needed because the service will be stopped in dtor.
+  EXPECT_CALL(*datapath_, SetConntrackHelpers(false)).WillOnce(Return(true));
 
   auto svc = NewService(GuestMessage::ARC);
   svc->Start(kTestPID);
@@ -408,11 +411,13 @@
       .WillOnce(Return(true));
   EXPECT_CALL(*datapath_, AddToBridge(StrEq("arcbr0"), StrEq("vetharc0")))
       .WillOnce(Return(true));
+  EXPECT_CALL(*datapath_, SetConntrackHelpers(true)).WillOnce(Return(true));
   // Expectations for arc0 teardown.
   EXPECT_CALL(*datapath_,
               MaskInterfaceFlags(StrEq("arcbr0"), IFF_DEBUG, IFF_UP))
       .WillOnce(Return(true));
   EXPECT_CALL(*datapath_, RemoveInterface(StrEq("vetharc0")));
+  EXPECT_CALL(*datapath_, SetConntrackHelpers(false)).WillOnce(Return(true));
 
   auto svc = NewService(GuestMessage::ARC);
   svc->Start(kTestPID);
@@ -470,6 +475,9 @@
       .WillOnce(Return(true));
   EXPECT_CALL(*datapath_, AddToBridge(StrEq("arcbr0"), StrEq("vmtap0")))
       .WillOnce(Return(true));
+  EXPECT_CALL(*datapath_, SetConntrackHelpers(true)).WillOnce(Return(true));
+  // Required because the service will be stopped in dtor.
+  EXPECT_CALL(*datapath_, SetConntrackHelpers(false)).WillOnce(Return(true));
 
   auto svc = NewService(GuestMessage::ARC_VM);
   svc->Start(kTestPID);
@@ -571,6 +579,7 @@
       .WillOnce(Return(true));
   EXPECT_CALL(*datapath_, AddToBridge(StrEq("arcbr0"), StrEq("vmtap0")))
       .WillOnce(Return(true));
+  EXPECT_CALL(*datapath_, SetConntrackHelpers(true)).WillOnce(Return(true));
   // Expectations for "arc0" teardown.
   EXPECT_CALL(*datapath_,
               MaskInterfaceFlags(StrEq("arcbr0"), IFF_DEBUG, IFF_UP))
@@ -582,6 +591,7 @@
   EXPECT_CALL(*datapath_, RemoveInterface(StrEq("vmtap3")));
   EXPECT_CALL(*datapath_, RemoveInterface(StrEq("vmtap4")));
   EXPECT_CALL(*datapath_, RemoveInterface(StrEq("vmtap5")));
+  EXPECT_CALL(*datapath_, SetConntrackHelpers(false)).WillOnce(Return(true));
 
   auto svc = NewService(GuestMessage::ARC_VM);
   svc->Start(kTestPID);