postgres.git / summary / log / commit / refs
commit 75c35e0f313d58fbbc65169dec13ce19e9886c99
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Sun Sep 07 14:44:40 2003 +0000
Remove check on source address of a statistics packet. Check was broken
by recent IPv6 changes, and since it's redundant with a kernel-level check
anyway, it seems not worth trying to fix it. Per recent discussions.
src/backend/postmaster/pgstat.c | 20 +++-----------------
1 file changed, 3 insertions(+), 17 deletions(-)
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index aef71fd4967..b0271890821 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -13,7 +13,7 @@
*
* Copyright (c) 2001-2003, PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/backend/postmaster/pgstat.c,v 1.43 2003/08/12 16:21:18 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/postmaster/pgstat.c,v 1.44 2003/09/07 14:44:40 tgl Exp $
* ----------
*/
#include "postgres.h"
@@ -1591,8 +1591,6 @@ pgstat_recvbuffer(void)
int msg_send = 0; /* next send index in buffer */
int msg_recv = 0; /* next receive index */
int msg_have = 0; /* number of bytes stored */
- struct sockaddr_storage fromaddr;
- int fromlen;
bool overflow = false;
/*
@@ -1702,10 +1700,8 @@ pgstat_recvbuffer(void)
*/
if (FD_ISSET(pgStatSock, &rfds))
{
- fromlen = sizeof(fromaddr);
- len = recvfrom(pgStatSock, (char *) &input_buffer,
- sizeof(PgStat_Msg), 0,
- (struct sockaddr *) &fromaddr, &fromlen);
+ len = recv(pgStatSock, (char *) &input_buffer,
+ sizeof(PgStat_Msg), 0);
if (len < 0)
{
ereport(LOG,
@@ -1726,16 +1722,6 @@ pgstat_recvbuffer(void)
if (input_buffer.msg_hdr.m_size != len)
continue;
- /*
- * The source address of the packet must be our own socket.
- * This ensures that only real hackers or our own backends
- * tell us something. (This should be redundant with a
- * kernel-level check due to having used connect(), but let's
- * do it anyway.)
- */
- if (memcmp(&fromaddr, &pgStatAddr, fromlen))
- continue;
-
/*
* O.K. - we accept this message. Copy it to the circular
* msgbuffer.
[parent: 4b407f6c3cd7]