hi, 
    i want to modify the RREP message packet in MAODV. i add one variable and 
one array in the packet as below :   

struct hdr_aodv_reply {

        u_int8_t        rp_type;        // Packet Type

        /*** modified for multicast ***/

        //u_int8_t        reserved[2];

        u_int8_t   rp_flags;

        u_int8_t        reserved;

        /*******************************/

        u_int8_t        rp_hop_count;           // Hop Count

        nsaddr_t        rp_dst;                 // Destination IP Address

        u_int32_t       rp_dst_seqno;           // Destination Sequence Number

        nsaddr_t        rp_src;                 // Source IP Address

        double             rp_lifetime;            // Lifetime

        double          rp_timestamp;           // when corresponding REQ sent;

        /********add for me************/

              double          rp_S;

              nsaddr_t       rp_pt[5];

        /******************************/

  inline int size() { 

  int sz = 0;

  /*

      sz = sizeof(u_int8_t)             // rp_type

            + 2*sizeof(u_int8_t)    // rp_flags + reserved

            + sizeof(u_int8_t)        // rp_hop_count

            + sizeof(double)          // rp_timestamp

            + sizeof(nsaddr_t)              // rp_dst

            + sizeof(u_int32_t)      // rp_dst_seqno

            + sizeof(nsaddr_t)              // rp_src

            + sizeof(u_int32_t);     // rp_lifetime

  */

      sz = 6*sizeof(u_int32_t)+sizeof(double)+5*sizeof(nsaddr_t);

      assert (sz >= 0);

       return sz;

  }

    the error is :segmentation falt (core dumped)
    thanks for help me.




Reply via email to