Navigation


Changeset 1326:afe0ecdb0692 in freeDiameter


Ignore:
Timestamp:
Nov 27, 2017, 11:18:57 PM (6 years ago)
Author:
Thomas Klausner <tk@giga.or.at>
Branch:
default
Phase:
public
Message:

Add config option if Route-Record AVPs should be added in Answers.

Some software does not handle them correctly.

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • doc/freediameter.conf.sample

    r1304 r1326  
    251251
    252252##############################################################
     253## General settings
     254
     255# If Route-Record AVPs should be added in Answers.
     256# Possible values: Always, Never
     257# Default: Always
     258#RouteRecordInAnswers = Never;
  • include/freeDiameter/libfdcore.h

    r1305 r1326  
    135135        struct fd_list   cnf_apps;      /* Applications locally supported (except relay, see flags). Use fd_disp_app_support to add one. list of struct fd_app. */
    136136        uint16_t         cnf_dispthr;   /* Number of dispatch threads to create */
     137        uint16_t         cnf_rr_in_answers;     /* include Route-Record AVP in answers */
    137138        struct {
    138139                unsigned no_fwd : 1;    /* the peer does not relay messages (0xffffff app id) */
  • libfdcore/config.c

    r1281 r1326  
    6868       
    6969        fd_g_config->cnf_orstateid = (uint32_t) time(NULL);
     70        fd_g_config->cnf_rr_in_answers = 1;
    7071       
    7172        CHECK_FCT( fd_dict_init(&fd_g_config->cnf_dict) );
  • libfdcore/fdd.y

    r1281 r1326  
    122122%token          TLS_DH_BITS
    123123%token          TLS_DH_FILE
     124%token          RR_IN_ANSWERS
     125%token          ALWAYS
     126%token          NEVER
    124127
    125128
     
    154157                        | conffile tls_prio
    155158                        | conffile tls_dh
     159                        | conffile rr_in_answers
    156160                        | conffile errors
    157161                        {
     
    666670                        }
    667671                        ;
     672
     673rr_values:              ALWAYS
     674                        {
     675                                conf->cnf_rr_in_answers = 1;
     676                        }
     677                        | NEVER
     678                        {
     679                                conf->cnf_rr_in_answers = 0;
     680                        }
     681                        ;
     682
     683rr_in_answers:          RR_IN_ANSWERS '=' rr_values ';'
     684                        ;
  • libfdcore/p_psm.c

    r1321 r1326  
    553553
    554554                                        /* Set the message source and add the Route-Record */
    555                                         CHECK_FCT_DO( fd_msg_source_setrr( msg, peer->p_hdr.info.pi_diamid, peer->p_hdr.info.pi_diamidlen, fd_g_config->cnf_dict ), goto psm_end);
     555                                        if (fd_g_config->cnf_rr_in_answers || (hdr->msg_flags & CMD_FLAG_REQUEST)) {
     556                                                CHECK_FCT_DO( fd_msg_source_setrr( msg, peer->p_hdr.info.pi_diamid, peer->p_hdr.info.pi_diamidlen, fd_g_config->cnf_dict ), goto psm_end);
     557                                        }
    556558
    557559                                        if ((hdr->msg_flags & CMD_FLAG_REQUEST)) {
Note: See TracChangeset for help on using the changeset viewer.