Navigation


Changeset 891:9432ac55823c in freeDiameter for libfdcore


Ignore:
Timestamp:
Nov 18, 2012, 7:28:50 AM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Tentative fix for the parse_or_error function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/messages.c

    r837 r891  
    234234        /* Now add the optavp in a FailedAVP if provided */
    235235        if (optavp) {
     236                struct avp * optavp_cpy = NULL;
     237                struct avp_hdr *opt_hdr, *optcpy_hdr;
     238               
    236239                /* Create the Failed-AVP AVP */
    237240                CHECK_FCT( fd_msg_avp_new( dict_avp_FAVP, 0, &avp_FAVP ) );
    238 
     241               
     242                /* Create a new AVP with a copy of the data of the invalid or missing AVP */
     243                CHECK_FCT( fd_msg_avp_new( NULL, AVPFL_SET_BLANK_VALUE, &optavp_cpy) );
     244               
     245                CHECK_FCT( fd_msg_avp_hdr(optavp, &opt_hdr) );
     246                CHECK_FCT( fd_msg_avp_hdr(optavp_cpy, &optcpy_hdr) );
     247                memcpy(optcpy_hdr, opt_hdr, sizeof(struct avp_hdr));
     248               
    239249                /* Add the passed AVP inside it */
    240                 CHECK_FCT( fd_msg_avp_add( avp_FAVP, MSG_BRW_LAST_CHILD, optavp ) );
     250                CHECK_FCT( fd_msg_avp_add( avp_FAVP, MSG_BRW_LAST_CHILD, optavp_cpy ) );
    241251               
    242252                /* And add to the message */
Note: See TracChangeset for help on using the changeset viewer.