Hi

 

Please take a look at the following code:

---------------------------------------

const char *x="Reza";

if (strcmp(rq->rq_anon,x) == 0)

{

  //Do something

}

--------------------------------------

"rq" is a pointer to the header of RREQ packet and "rq_anon" is a pointer to
const data. This is a part of my routing protocol. Making is OK. The problem
is that when I run my Tcl program related to this routing protocol,
segmentation falut occurs. But when I changed this code to:

---------------------------------------

if (rq->rq_anon == "Reza")

{

  //Do something

}

--------------------------------------

it works! with one warning that is expected. So what is the problem? Is it a
bug in NS?

 

______________________________________________________ 

Reza Karimi, M.Sc. 

Faculty of Electrical and Computer Engineering (ECE) 

K.N.Toosi University of Technology 

Tehran, IRAN. 

 

Reply via email to