openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/rsyslog/8.1903.0-r0/rsyslog-8.1903.0/runtime/nsd_ptcp.c
static rsRetVal FillRemHost(nsd_ptcp_t* pThis, struct sockaddr_storage* pAddr)
{
    prop_t* fqdn;

    DEFiRet;
    ISOBJ_TYPE_assert(pThis, nsd_ptcp);
    assert(pAddr != NULL);

    CHKiRet(dnscacheLookup(pAddr, &fqdn, NULL, NULL, &pThis->remoteIP));

    /* We now have the names, so now let's allocate memory and store them
     * permanently. (side note: we may hold on to these values for quite a
     * while, thus we trim their memory consumption)
     */
    if ((pThis->pRemHostName = malloc(prop.GetStringLen(fqdn) + 1)) == NULL)
        ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY);
    memcpy(pThis->pRemHostName, propGetSzStr(fqdn),
           prop.GetStringLen(fqdn) + 1);
    prop.Destruct(&fqdn);

finalize_it:
    RETiRet;
}
/* Set pRemHost based on the address provided. This is to be called upon
 * accept()ing a connection request. It must be provided by the socket we
 * received the message on as well as a NI_MAXHOST size large character buffer
 * for the FQDN. Please see http://www.hmug.org/man/3/getnameinfo.php (under
 * Caveats) for some explanation of the code found below. If we detect a
 * malicious hostname, we return RS_RET_MALICIOUS_HNAME and let the caller
 * decide on how to deal with that. rgerhards, 2008-03-31
 */
Set pRemHost based on the address provided. This is to be called upon
accept()ing a connection request. It must be provided by the socket we
received the message on as well as a NI_MAXHOST size large character buffer
for the FQDN.
Set pRemHost based on the address provided . This is to be called upon accept () ing a connection request . It must be provided by the socket we received the message on as well as a NI_MAXHOST size large character buffer for the FQDN .
static rsRetVal FillRemHost(nsd_ptcp_t* pThis, struct sockaddr_storage* pAddr)
{
    prop_t* fqdn;
    DEFiRet;
    ISOBJ_TYPE_assert(pThis, nsd_ptcp);
    assert(pAddr != NULL);
    CHKiRet(dnscacheLookup(pAddr, &fqdn, NULL, NULL, &pThis->remoteIP));
    if ((pThis->pRemHostName = malloc(prop.GetStringLen(fqdn) + 1)) == NULL)
        ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY);
    memcpy(pThis->pRemHostName, propGetSzStr(fqdn),
           prop.GetStringLen(fqdn) + 1);
    prop.Destruct(&fqdn);
finalize_it:
    RETiRet;
}
static rsRetVal FillRemHost ( nsd_ptcp_t * pThis , struct sockaddr_storage * pAddr ) { prop_t * fqdn ; DEFiRet ; ISOBJ_TYPE_assert ( pThis , nsd_ptcp ) ; assert ( pAddr != NULL ) ; CHKiRet ( dnscacheLookup ( pAddr , & fqdn , NULL , NULL , & pThis -> remoteIP ) ) ; if ( ( pThis -> pRemHostName = malloc ( prop . GetStringLen ( fqdn ) + 1 ) ) == NULL ) ABORT_FINALIZE ( RS_RET_OUT_OF_MEMORY ) ; memcpy ( pThis -> pRemHostName , propGetSzStr ( fqdn ) , prop . GetStringLen ( fqdn ) + 1 ) ; prop . Destruct ( & fqdn ) ; finalize_it : RETiRet ; }
Set pRemHost based on the address provided.
Set pRemHost based on the address provided .
/* We now have the names, so now let's allocate memory and store them
     * permanently. (side note: we may hold on to these values for quite a
     * while, thus we trim their memory consumption)
     */