diff options
author | Maciej Żenczykowski <maze@google.com> | 2021-02-04 05:12:26 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-02-04 05:12:26 +0000 |
commit | 2c2543395cc1edecc43d0bed14848aea7ebb3129 (patch) | |
tree | 751aa81b5d934d3fe110be6ae609bcf33b84087f | |
parent | bf4b136c8a11047389f8aa5a911f68d2da4c59a5 (diff) | |
parent | 8ab7e133323376d79d280ba60f2d994bfd9a9ab9 (diff) | |
download | android-clat-2c2543395cc1edecc43d0bed14848aea7ebb3129.tar.gz |
clatd: move stop_loop() into main.c am: 8ab7e13332
Original change: https://android-review.googlesource.com/c/platform/external/android-clat/+/1574002
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I88221b6c178ddc5e1044e947a7c712dd620ca9f7
-rw-r--r-- | clatd.c | 5 | ||||
-rw-r--r-- | clatd.h | 4 | ||||
-rw-r--r-- | main.c | 5 |
3 files changed, 8 insertions, 6 deletions
@@ -58,11 +58,6 @@ struct clat_config Global_Clatd_Config; 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 @@ -18,6 +18,7 @@ #ifndef __CLATD_H__ #define __CLATD_H__ +#include <signal.h> #include <stdlib.h> #include <sys/uio.h> @@ -35,7 +36,8 @@ struct tun_data; // 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(); @@ -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 */ |