+const char *af_name(int af)
+{
+ switch (af) {
+ case AF_INET6: return "IPv6";
+ case AF_INET: return "IPv4";
+ case 0: return "(any)";
+ default: abort();
+ }
+}
+
+void udp_sock_experienced(struct log_if *lg, struct udpcommon *uc,
+ const char *socksdesc, struct udpsock *us,
+ bool_t recvsend, int af,
+ int r, int errnoval)
+{
+ bool_t success=r>=0;
+ if (us->experienced[recvsend][af][success]++)
+ return;
+ lg_perror(lg, uc->cc.cl.description, &uc->cc.loc,
+ success ? M_INFO : M_WARNING,
+ success ? 0 : errnoval,
+ "%s %s experiencing some %s %s%s%s",
+ socksdesc,iaddr_to_string(&us->addr),
+ success?"success":"trouble",
+ recvsend?"transmitting":"receiving",
+ af?" ":"", af?af_name(af):"");
+}
+
+static void udp_socks_afterpoll(void *state, struct pollfd *fds, int nfds)