Christophe Kalt writes:
> syscall::connect:entry
> {
>   self->to  = (char *) copyin(arg1, arg2);
>   self->ftp = ( self->to[0] == 0 && self->to[1] == 2 && self->to[3] == 21 ) ? 
> 1 : 0;

Is this on SPARC or x86?  That expression is sensitive to byte order:
it's assuming that sin_family is going to be in big-endian order,
which is true only on SPARC.

(The port number in struct sockaddr_in is always big-endian, because
it's in network byte order.)

Not testing self->to[2] for zero seems odd.

> In the printf, self->to contents aren't always what they were when the 
> variable was assigned.  Why not?

Good question ... for which I don't have an answer.  But for what it's
worth, I always copy the information I want to save across probe
clauses into scalars in 'self->'.  I don't really trust pointers here.

-- 
James Carlson, Solaris Networking              <[EMAIL PROTECTED]>
Sun Microsystems / 35 Network Drive        71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677
_______________________________________________
dtrace-discuss mailing list
[email protected]

Reply via email to