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/msg.c
static rsRetVal resolveDNS(smsg_t* const pMsg)
{
    rsRetVal localRet;
    prop_t* propFromHost = NULL;
    prop_t* ip;
    prop_t* localName;
    DEFiRet;

    MsgLock(pMsg);
    CHKiRet(objUse(net, CORE_COMPONENT));
    if (pMsg->msgFlags & NEEDS_DNSRESOL)
    {
        if (pMsg->msgFlags & PRESERVE_CASE)
        {
            localRet =
                net.cvthname(pMsg->rcvFrom.pfrominet, NULL, &localName, &ip);
        }
        else
        {
            localRet =
                net.cvthname(pMsg->rcvFrom.pfrominet, &localName, NULL, &ip);
        }
        if (localRet == RS_RET_OK)
        {
            /* we pass down the props, so no need for AddRef */
            MsgSetRcvFromWithoutAddRef(pMsg, localName);
            MsgSetRcvFromIPWithoutAddRef(pMsg, ip);
        }
    }
finalize_it:
    if (iRet != RS_RET_OK)
    {
        /* best we can do: remove property */
        MsgSetRcvFromStr(pMsg, UCHAR_CONSTANT(""), 0, &propFromHost);
        prop.Destruct(&propFromHost);
    }
    MsgUnlock(pMsg);
    if (propFromHost != NULL)
        prop.Destruct(&propFromHost);
    RETiRet;
}
/* do a DNS reverse resolution, if not already done, reflect status
 * rgerhards, 2009-11-16
 */
do a DNS reverse resolution, if not already done, reflect status
rgerhards, 2009-11-16
do a DNS reverse resolution if not already done reflect status rgerhards 2009 - 11 - 16
static rsRetVal resolveDNS(smsg_t* const pMsg)
{
    rsRetVal localRet;
    prop_t* propFromHost = NULL;
    prop_t* ip;
    prop_t* localName;
    DEFiRet;
    MsgLock(pMsg);
    CHKiRet(objUse(net, CORE_COMPONENT));
    if (pMsg->msgFlags & NEEDS_DNSRESOL)
    {
        if (pMsg->msgFlags & PRESERVE_CASE)
        {
            localRet =
                net.cvthname(pMsg->rcvFrom.pfrominet, NULL, &localName, &ip);
        }
        else
        {
            localRet =
                net.cvthname(pMsg->rcvFrom.pfrominet, &localName, NULL, &ip);
        }
        if (localRet == RS_RET_OK)
        {
            MsgSetRcvFromWithoutAddRef(pMsg, localName);
            MsgSetRcvFromIPWithoutAddRef(pMsg, ip);
        }
    }
finalize_it:
    if (iRet != RS_RET_OK)
    {
        MsgSetRcvFromStr(pMsg, UCHAR_CONSTANT(""), 0, &propFromHost);
        prop.Destruct(&propFromHost);
    }
    MsgUnlock(pMsg);
    if (propFromHost != NULL)
        prop.Destruct(&propFromHost);
    RETiRet;
}
static rsRetVal resolveDNS ( smsg_t * const pMsg ) { rsRetVal localRet ; prop_t * propFromHost = NULL ; prop_t * ip ; prop_t * localName ; DEFiRet ; MsgLock ( pMsg ) ; CHKiRet ( objUse ( net , CORE_COMPONENT ) ) ; if ( pMsg -> msgFlags & NEEDS_DNSRESOL ) { if ( pMsg -> msgFlags & PRESERVE_CASE ) { localRet = net . cvthname ( pMsg -> rcvFrom . pfrominet , NULL , & localName , & ip ) ; } else { localRet = net . cvthname ( pMsg -> rcvFrom . pfrominet , & localName , NULL , & ip ) ; } if ( localRet == RS_RET_OK ) { MsgSetRcvFromWithoutAddRef ( pMsg , localName ) ; MsgSetRcvFromIPWithoutAddRef ( pMsg , ip ) ; } } finalize_it : if ( iRet != RS_RET_OK ) { MsgSetRcvFromStr ( pMsg , UCHAR_CONSTANT ( " " ) , 0 , & propFromHost ) ; prop . Destruct ( & propFromHost ) ; } MsgUnlock ( pMsg ) ; if ( propFromHost != NULL ) prop . Destruct ( & propFromHost ) ; RETiRet ; }
do a DNS reverse resolution, if not already done, reflect status
 rgerhards, 2009-11-16
do a DNS reverse resolution if not already done reflect status rgerhards 2009 - 11 - 16
/* we pass down the props, so no need for AddRef */ /* best we can do: remove property */