Make clatd a bit more robust when started by netd.

1. When started from netd, DNS lookups (used to detect the NAT64
   prefix) fail because ANDROID_DNS_MODE=local. Unset it.
2. Only add the SIGTERM handler just before starting the event
   loop. Otherwise, if clatd hangs before the event loop is
   started (e.g., when #1 happens), it can't be stopped.

While I'm at it, add a couple of logging statements.

Change-Id: Ie24b37e34b729ce6cd3769b5d64348f2c1b9627d
2 files changed