Bug in current network.c

Поиск
Список
Период
Сортировка
Искать

Bug in current network.c

От:
Andreas Zeugswetter <andreas.zeugswetter@telecom.at>
Дата:

The network.c from current CVS has:

xlc -I../../../include -I../../../backend   -I/usr/local/include 
-qchars=signed -qmaxmem=8192 -qhalt=w -qsrcmsg -qcheck=divzero -qlonglong -g -qfullpath -I../..   -c network.c -o network.o     400 |                 if (inet_cidr_ntop(2, &addr, (((inet_struct 
*)(((struct varlena *)(ip))->vl_dat))->bits), tmp, sizeof(tmp)) < 0)          .............................................................  
...............................................................a...
a - 1506-068 (S) Operation between types "char*" and "int" is not allowed.
gmake[3]: *** [network.o] Error 1

It should probably read as follows: (but please check)
(I sure hope it comes without those stupid wraps my mailer always 
generates)

*** network.c.ori	Thu Oct 29 09:51:42 1998
--- network.c	Thu Oct 29 10:35:59 1998
***************
*** 397,403 **** 		/* It's an IP V4 address: */ 		int	addr = htonl(ntohl(ip_v4addr(ip)) & (0xffffffff << (32 - 
ip_bits(ip))));

! 		if (inet_cidr_ntop(AF_INET, &addr, ip_bits(ip), tmp, sizeof(tmp)) < 0) 		{ 			elog(ERROR, "unable to print network (%s)", strerror(errno)); 			return (NULL);
--- 397,403 ---- 		/* It's an IP V4 address: */ 		int	addr = htonl(ntohl(ip_v4addr(ip)) & (0xffffffff << (32 - 
ip_bits(ip))));

! 		if (inet_cidr_ntop(AF_INET, &addr, ip_bits(ip), tmp, sizeof(tmp)) == 
NULL) 		{ 			elog(ERROR, "unable to print network (%s)", strerror(errno)); 			return (NULL);


Attached is also a correct inet.out


begin 600 inet.out
M455%4EDZ($123U @5$%"3$4@24Y%5%]40DP["D524D]2.B @4F5L871I;VX@
M:6YE=%]T8FP@1&]E"P@
M8R!A

Re: [HACKERS] Bug in current network.c

От:
darcy@druid.net (D'Arcy J.M. Cain)
Дата:
Thus spake Andreas Zeugswetter
> a - 1506-068 (S) Operation between types "char*" and "int" is not allowed.
> gmake[3]: *** [network.o] Error 1
> 
> It should probably read as follows: (but please check)
> (I sure hope it comes without those stupid wraps my mailer always 
> generates)

For some reason network.c reverted to an earlier version in the tree.  Your
patch was already submitted by someone (Bruce?) but the changes, like my
other changes, were lost.  I assume that your patch is correct but the
person who submitted the previous patch should double check that nothing
else is missing.

-- 
D'Arcy J.M. Cain    |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 424 2871     (DoD#0082)    (eNTP)   |  what's for dinner.

Re: [HACKERS] Bug in current network.c

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
darcy@druid.net (D'Arcy J.M. Cain) writes:
> For some reason network.c reverted to an earlier version in the tree.  Your
> patch was already submitted by someone (Bruce?) but the changes, like my
> other changes, were lost.

It looks like Bruce copied-and-pasted a little too much while applying
your last patch.  I had fixed the "< 0" tests that ought to be "== NULL"
on Sunday, but one of them was on a line that you wanted changed for other
reasons, and it went back to being wrong...

Fixed now.
		regards, tom lane

Re: [HACKERS] Bug in current network.c

От:
darcy@druid.net (D'Arcy J.M. Cain)
Дата:
Thus spake Tom Lane
> darcy@druid.net (D'Arcy J.M. Cain) writes:
> > For some reason network.c reverted to an earlier version in the tree.  Your
> > patch was already submitted by someone (Bruce?) but the changes, like my
> > other changes, were lost.
> 
> It looks like Bruce copied-and-pasted a little too much while applying
> your last patch.  I had fixed the "< 0" tests that ought to be "== NULL"
> on Sunday, but one of them was on a line that you wanted changed for other
> reasons, and it went back to being wrong...

Trust us.  We're professionals.  :-)

-- 
D'Arcy J.M. Cain    |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 424 2871     (DoD#0082)    (eNTP)   |  what's for dinner.

FAQ