Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit02fa3e4

Browse files
committed
Thank you for the advice. I concluded that current inet code has a
portability problem. Included patches should be applied to bothcurrent and 6.4 tree. I have tested on LinuxPPC, FreeBSD and Solaris2.6. Now the inet regression tests on these platforms are all happy.---Tatsuo Ishii
1 parentfa9db42 commit02fa3e4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

‎src/backend/utils/adt/network.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*is for IP V4 CIDR notation, but prepared for V6: just
44
*add the necessary bits where the comments indicate.
55
*
6-
*$Id: network.c,v 1.5 1999/01/01 04:17:13 momjian Exp $
6+
*$Id: network.c,v 1.6 1999/02/24 03:17:05 momjian Exp $
77
*Jon Postel RIP 16 Oct 1998
88
*/
99

@@ -356,7 +356,12 @@ network_broadcast(inet *ip)
356356
if (ip_family(ip)==AF_INET)
357357
{
358358
/* It's an IP V4 address: */
359-
intaddr=htonl(ntohl(ip_v4addr(ip)) | (0xffffffff >>ip_bits(ip)));
359+
intaddr;
360+
unsigned longmask=0xffffffff;
361+
362+
if (ip_bits(ip)<32)
363+
mask >>=ip_bits(ip);
364+
addr=htonl(ntohl(ip_v4addr(ip)) |mask);
360365

361366
if (inet_net_ntop(AF_INET,&addr,32,tmp,sizeof(tmp))==NULL)
362367
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp