Mark ab/7061308 as merged in stage.

Bug: 180401296
Merged-In: Ic101be70fd9ead7df75bcdd1656d504891df8f98
Change-Id: Icc1d94294a7cfd85c8206b77d05324f4ad62e8d7
diff --git a/Android.bp b/Android.bp
index ac24a00..adc36e7 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,3 +1,26 @@
+package {
+    default_applicable_licenses: ["external_android-clat_license"],
+}
+
+// Added automatically by a large-scale-change
+//
+// large-scale-change included anything that looked like it might be a license
+// text as a license_text. e.g. LICENSE, NOTICE, COPYING etc.
+//
+// Please consider removing redundant or irrelevant files from 'license_text:'.
+// See: http://go/android-license-faq
+license {
+    name: "external_android-clat_license",
+    visibility: [":__subpackages__"],
+    license_kinds: [
+        "SPDX-license-identifier-Apache-2.0",
+    ],
+    license_text: [
+        "LICENSE",
+        "NOTICE",
+    ],
+}
+
 cc_defaults {
     name: "clatd_defaults",
 
diff --git a/clatd.c b/clatd.c
index 422cded..3ffe934 100644
--- a/clatd.c
+++ b/clatd.c
@@ -58,11 +58,6 @@
 
 volatile sig_atomic_t running = 1;
 
-/* function: stop_loop
- * signal handler: stop the event loop
- */
-void stop_loop() { running = 0; }
-
 /* function: configure_packet_socket
  * Binds the packet socket and attaches the receive filter to it.
  *   sock - the socket to configure
diff --git a/clatd.h b/clatd.h
index a3f9326..899458c 100644
--- a/clatd.h
+++ b/clatd.h
@@ -18,6 +18,7 @@
 #ifndef __CLATD_H__
 #define __CLATD_H__
 
+#include <signal.h>
 #include <stdlib.h>
 #include <sys/uio.h>
 
@@ -35,7 +36,8 @@
 // how frequently (in seconds) to poll for an address change while there is no traffic
 #define NO_TRAFFIC_INTERFACE_POLL_FREQUENCY 90
 
-void stop_loop();
+extern volatile sig_atomic_t running;
+
 void configure_tun_ip(const struct tun_data *tunnel, const char *v4_addr, int mtu);
 void set_capability(uint64_t target_cap);
 void drop_root_but_keep_caps();
diff --git a/main.c b/main.c
index 683b507..bfcad48 100644
--- a/main.c
+++ b/main.c
@@ -35,6 +35,11 @@
 
 #define DEVICEPREFIX "v4-"
 
+/* function: stop_loop
+ * signal handler: stop the event loop
+ */
+static void stop_loop() { running = 0; };
+
 /* function: print_help
  * in case the user is running this on the command line
  */