Date: Fri, 7 Jul 1995 12:53:27 CET From: "Janusz Kokot" <JKOKOT@demeter.ipan.lublin.pl> To: ports@freebsd.org Subject: Re: Radio port Message-ID: <2A28CAC2E48@demeter.ipan.lublin.pl>
next in thread | raw e-mail | index | archive | help
> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2A28CAC2E48>