Navigation


Changeset 165:4679ff581d6a in freeDiameter for freeDiameter/p_sr.c


Ignore:
Timestamp:
Jan 27, 2010, 10:56:54 AM (14 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Fix invalid restore of the hop-by-hop id on forwarded answers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • freeDiameter/p_sr.c

    r74 r165  
    4444        struct fd_list  chain;  /* the "o" field points directly to the hop-by-hop of the request (uint32_t *)  */
    4545        struct msg      *req;   /* A request that was sent and not yet answered. */
     46        uint32_t        prevhbh;/* The value to set in the hbh header when the message is retrieved */
    4647};
    4748
     
    7778
    7879/* Store a new sent request */
    79 int fd_p_sr_store(struct sr_list * srlist, struct msg **req, uint32_t *hbhloc)
     80int fd_p_sr_store(struct sr_list * srlist, struct msg **req, uint32_t *hbhloc, uint32_t hbh_restore)
    8081{
    8182        struct sentreq * sr;
     
    8384        int match;
    8485       
    85         TRACE_ENTRY("%p %p %p", srlist, req, hbhloc);
     86        TRACE_ENTRY("%p %p %p %x", srlist, req, hbhloc, hbh_restore);
    8687        CHECK_PARAMS(srlist && req && *req && hbhloc);
    8788       
     
    9091        fd_list_init(&sr->chain, hbhloc);
    9192        sr->req = *req;
     93        sr->prevhbh = hbh_restore;
    9294       
    9395        /* Search the place in the list */
     
    123125        sr = (struct sentreq *)find_or_next(&srlist->srs, hbh, &match);
    124126        if (!match) {
    125                 TRACE_DEBUG(INFO, "There is no saved request with this hop-by-hop id");
     127                TRACE_DEBUG(INFO, "There is no saved request with this hop-by-hop id (%x)", hbh);
    126128                *req = NULL;
    127129        } else {
     130                /* Restore hop-by-hop id */
     131                *((uint32_t *)sr->chain.o) = sr->prevhbh;
    128132                /* Unlink */
    129133                fd_list_unlink(&sr->chain);
Note: See TracChangeset for help on using the changeset viewer.