Last active
January 12, 2018 21:50
-
-
Save jaens/90736385d245ecd1c21ca97de6424ebb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/sbin/dtrace -w -C -s | |
#pragma D option quiet | |
inline int af_inet6 = 30; /* AF_INET6 defined in bsd/sys/socket.h */ | |
inline string CHARLES = "Charles"; | |
syscall::connect*:entry | |
{ | |
this->sa = (struct sockaddr *)copyin(arg1, sizeof (struct sockaddr)); | |
this->f = this->sa->sa_family; | |
} | |
syscall::connect*:entry | |
/this->f == af_inet6 && execname == CHARLES/ | |
{ | |
this->s6 = (struct sockaddr_in6 *) copyin(arg1, sizeof (struct sockaddr_in6)); | |
this->s6->sin6_scope_id = 0; | |
copyout(this->s6, arg1, sizeof (struct sockaddr_in6)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment