Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
User Journal

Ex-Linux-Fanboy's Journal: For real Slashdot users only

Journal by Ex-Linux-Fanboy

/*Placed in the public domain by Sam Trenholme*/
#include <arpa/inet.h>
#include <string.h>
#define Z struct sockaddr
#define Y sizeof(d)
int main(int a,char **b){long int i;char q[512],p
[17]="\xc0\f\0\x01\0\x01\0\0\0\0\0\x04";socklen_t
f=511;if(a>1){i=htonl(inet_addr(b[1]));p[15]=255&
i;struct sockaddr_in d;bzero(&d,Y);p[14]=(65280&i
)>>8;a=socket(AF_INET,SOCK_DGRAM,0);d.sin_family=
AF_INET;d.sin_port=htons(53);p[13]=(0xff0000&i)>>
16;p[12]=i>>24;bind(a,(Z*)&d,Y);for(;;){if(11<(i=
recvfrom(a,q,255,0,(Z*)&d,&f))&&q[2]>=0){q[7]++;q
[2]|=128;memcpy(q+i,p,16);sendto(a,q,i+16,0,(Z*)&
d,Y);}}}}

Note: There is a single compile-time warning when compiled with -Wall; if this bothers you, you can place 10 bytes of bloat in the form of return 0; at the end of the program (before the final })

Since you are a Slashdot user, I am sure you can figure out exactly what the above code does without needing anything wimpy like documentation.

This discussion has been archived. No new comments can be posted.

For real Slashdot users only

Comments Filter:

Life in the state of nature is solitary, poor, nasty, brutish, and short. - Thomas Hobbes, Leviathan

Working...