MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / sal_freeaddrinfo

Function sal_freeaddrinfo

components/net/sal/src/sal_socket.c:1638–1661  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1636}
1637
1638void sal_freeaddrinfo(struct addrinfo *ai)
1639{
1640 struct netdev *netdev = RT_NULL;
1641 struct sal_proto_family *pf = RT_NULL;
1642 rt_uint32_t i = 0;
1643
1644 /*when use the multi netdev, it must free the ai use the getaddrinfo netdev */
1645 for (i = 0; i < SAL_SOCKETS_NUM; i++)
1646 {
1647 if (sal_dev_res_tbl[i].res == ai)
1648 {
1649 netdev = sal_dev_res_tbl[i].netdev;
1650 sal_dev_res_tbl[i].res = RT_NULL;
1651 sal_dev_res_tbl[i].netdev = RT_NULL;
1652 break;
1653 }
1654 }
1655 RT_ASSERT((i < SAL_SOCKETS_NUM));
1656
1657 if (SAL_NETDBOPS_VALID(netdev, pf, freeaddrinfo))
1658 {
1659 pf->netdb_ops->freeaddrinfo(ai);
1660 }
1661}

Callers 2

sys_getaddrinfoFunction · 0.85
freeaddrinfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected