[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] core dump when accessing contents of packet



Hi all,

in the following function I get a core dump whenever the comments are
removed.
The appropriate entries to tcl/lib/ns-default.tcl and
tcl/lib/ns-packet.tcl have been
performed. It does not need to be noted that "seqno_" is a member
variable of
hdr_foo and "number" is also a valid variable, i.e. I have had no
problems printing
its content.

void foo_Agent::sendit() {
 Packet* pkt = allocpkt();
 hdr_foo* hdr = (hdr_foo*)pkt->access(off_foo_);
/*  hdr->seqno_ = number; */
 seqno_ ++;
 send(pkt, 0); // Connector::send()
}

Any help would be appreciated,

Niko