Navigation


Changeset 486:65efe8ff2c30 in freeDiameter


Ignore:
Timestamp:
Aug 11, 2010, 4:13:51 PM (14 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Change creation of anciliary data to avoid padding, should close #12

File:
1 edited

Legend:

Unmodified
Added
Removed
  • freeDiameter/sctp.c

    r403 r486  
    10011001        struct msghdr mhdr;
    10021002        struct iovec  iov;
    1003         struct {
    1004                 struct cmsghdr          hdr;
    1005                 struct sctp_sndrcvinfo  sndrcv;
    1006         } anci;
     1003        struct cmsghdr          *hdr;
     1004        struct sctp_sndrcvinfo  *sndrcv;
     1005        uint8_t anci[CMSG_SPACE(sizeof(struct sctp_sndrcvinfo))];
    10071006        ssize_t ret;
    10081007        int timedout = 0;
     
    10201019       
    10211020        /* Anciliary data: specify SCTP stream */
    1022         anci.hdr.cmsg_len   = sizeof(anci);
    1023         anci.hdr.cmsg_level = IPPROTO_SCTP;
    1024         anci.hdr.cmsg_type  = SCTP_SNDRCV;
    1025         anci.sndrcv.sinfo_stream = strid;
     1021        hdr = (struct cmsghdr *)anci;
     1022        sndrcv = (struct sctp_sndrcvinfo *)CMSG_DATA(hdr);
     1023        hdr->cmsg_len   = sizeof(anci);
     1024        hdr->cmsg_level = IPPROTO_SCTP;
     1025        hdr->cmsg_type  = SCTP_SNDRCV;
     1026        sndrcv->sinfo_stream = strid;
    10261027        /* note : we could store other data also, for example in .sinfo_ppid for remote peer or in .sinfo_context for errors. */
    10271028       
     
    10311032        mhdr.msg_iovlen = 1;
    10321033       
    1033         mhdr.msg_control    = &anci;
     1034        mhdr.msg_control    = anci;
    10341035        mhdr.msg_controllen = sizeof(anci);
    10351036       
Note: See TracChangeset for help on using the changeset viewer.