|
|
|
|
@ -502,7 +502,7 @@ static void remove_iface_sockets(struct AUTO_SOCKET* as, uint32_t ifindex) {
|
|
|
|
|
if ((*pp)->netif_index == ifindex) { |
|
|
|
|
struct auto_sock_iface* ifa = *pp; |
|
|
|
|
*pp = ifa->next; |
|
|
|
|
char ifname[IFNAMSIZ] = ""; |
|
|
|
|
char ifname[IF_NAMESIZE] = ""; |
|
|
|
|
if (!if_indextoname(ifindex, ifname)) snprintf(ifname, sizeof(ifname), "?"); |
|
|
|
|
|
|
|
|
|
if (ifa->v4_udp) { |
|
|
|
|
@ -871,7 +871,7 @@ static void reconcile_iface(struct AUTO_SOCKET* as, uint32_t ifindex, const char
|
|
|
|
|
if (ifa) { struct stcp_server* tsrv = create_iface_tcp_socket(as, ifindex, ifname, AF_INET, v4_need_type); ifa->v4_tcp = tsrv; if (tsrv) changed = 1; } |
|
|
|
|
} else if (!has && srv) { |
|
|
|
|
DEBUG_INFO(DEBUG_CATEGORY_AS, "[as] v4 TCP removed: %s ifidx=%u", ifname, ifindex); |
|
|
|
|
{ char buf[IFNAMSIZ]; const char* nm = if_indextoname(ifindex, buf) ? buf : ifname; |
|
|
|
|
{ char buf[IF_NAMESIZE]; const char* nm = if_indextoname(ifindex, buf) ? buf : ifname; |
|
|
|
|
uint16_t p = load_port_from_db(as, nm, AF_INET, AS_PROTO_TCP); |
|
|
|
|
struct ETCP_SOCKET** tsp = &as->instance->etcp_sockets; |
|
|
|
|
while (*tsp) { if (!(*tsp)->is_tcp) { tsp = &(*tsp)->next; continue; } uint16_t tp = 0; const struct sockaddr_storage* a = (*tsp)->interface_addr.ss_family ? &(*tsp)->interface_addr : &(*tsp)->local_addr; |
|
|
|
|
@ -894,7 +894,7 @@ static void reconcile_iface(struct AUTO_SOCKET* as, uint32_t ifindex, const char
|
|
|
|
|
if (ifa) { struct stcp_server* tsrv = create_iface_tcp_socket(as, ifindex, ifname, AF_INET6, v6_need_type); ifa->v6_tcp = tsrv; if (tsrv) changed = 1; } |
|
|
|
|
} else if (!has && srv) { |
|
|
|
|
DEBUG_INFO(DEBUG_CATEGORY_AS, "[as] v6 TCP removed: %s ifidx=%u", ifname, ifindex); |
|
|
|
|
{ char buf[IFNAMSIZ]; const char* nm = if_indextoname(ifindex, buf) ? buf : ifname; |
|
|
|
|
{ char buf[IF_NAMESIZE]; const char* nm = if_indextoname(ifindex, buf) ? buf : ifname; |
|
|
|
|
uint16_t p = load_port_from_db(as, nm, AF_INET6, AS_PROTO_TCP); |
|
|
|
|
struct ETCP_SOCKET** tsp = &as->instance->etcp_sockets; |
|
|
|
|
while (*tsp) { if (!(*tsp)->is_tcp) { tsp = &(*tsp)->next; continue; } uint16_t tp = 0; const struct sockaddr_storage* a = (*tsp)->interface_addr.ss_family ? &(*tsp)->interface_addr : &(*tsp)->local_addr; |
|
|
|
|
|