From owner-freebsd-ports Fri Jul 7 03:54:12 1995 Return-Path: ports-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id DAA08454 for ports-outgoing; Fri, 7 Jul 1995 03:54:12 -0700 Received: from PLUMCS11.UMCS.LUBLIN.PL (plumcs11.umcs.lublin.pl [192.147.37.100]) by freefall.cdrom.com (8.6.10/8.6.6) with SMTP id DAA08444 for ; Fri, 7 Jul 1995 03:53:56 -0700 Received: from demeter.ipan.lublin.pl by PLUMCS11.UMCS.LUBLIN.PL (IBM VM SMTP V2R2) with TCP; Fri, 07 Jul 95 12:52:26 CET Received: from DEMETER/MAILQUEUE by demeter.ipan.lublin.pl (Mercury 1.20); 7 Jul 95 12:53:36 GMT+1 Received: from MAILQUEUE by DEMETER (Mercury 1.20); 7 Jul 95 12:53:28 GMT+1 From: "Janusz Kokot" Organization: Institute of Agrophysics PAS To: ports@freebsd.org Date: Fri, 7 Jul 1995 12:53:27 CET MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: Radio port Priority: normal X-mailer: Pegasus Mail v3.22 Message-ID: <2A28CAC2E48@demeter.ipan.lublin.pl> Sender: ports-owner@freebsd.org Precedence: bulk > In message <28E112A0C09@demeter.ipan.lublin.pl> you write: > >> > I uploaded port of radio-2.0.4 (broadcasting audio over internet) > >> > to freebsd.cdrom.com/pub/FreeBSD/incoming/radio.tgz > >> > >> Please take radio1.tgz this is with multicast. > >radio2.tgz sorry > > I'm afraid I don't understand this (from radio2.tgz:radio/patches/patch-aa:) > > diff -c ../radio.orig/radio.c ./radio.c > *** ../radio.orig/radio.c Thu Jul 6 15:07:03 1995 > --- ./radio.c Thu Jul 6 15:27:55 1995 > *************** > *** 1000,1006 **** > else > grpaddr.s_addr = inet_addr(group); > > ! if (!IN_MULTICAST(grpaddr.s_addr)) { > fprintf(stderr, "Bad multicast group: %s\n", group); > exit(1); > } > --- 1085,1091 ---- > else > grpaddr.s_addr = inet_addr(group); > > ! if (((long)(grpaddr.s_addr) & 0xf0) != 0xe0) { > fprintf(stderr, "Bad multicast group: %s\n", group); > exit(1); > } > > What's wrong with IN_MULTICAST? >From /usr/include/netinet/in.h : #define IN_CLASSD(i) (((long)(i) & 0xf0000000) == 0xe0000000) #define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */ #define IN_CLASSD_NSHIFT 28 /* net and host fields, but */ #define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */ #define IN_MULTICAST(i) IN_CLASSD(i) =================== Byte order in IN_MULTICAST is reversed to order returned from inet_addr(). I dont know if it is a bug ??? Using : printf ("%hl\n", inet_addr("224.0.0.0")); you will get : e0 so IN_MULTICAST(inet_addr("224.0.0.0")) will return false ! I will look for warnings > > Bill > ---------------------------------------------------- Janusz Kokot Institute of Agrophysics, Polish Academy of Sciences E-Mail: jkokot@demeter.ipan.lublin