[syslog-ng]Re: [PATCH] 127.0.0.1 for syslog-ng-1.5.14

Gert Menke gert@menke.za.net
Tue, 5 Feb 2002 16:41:55 +0100


--PEIAKu/WMn1b1Hv9
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Oh well...
I forgot to attach the patch. Here it is.

Gert

--PEIAKu/WMn1b1Hv9
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="syslog-ng-1.5.14-sourceip127.patch"

diff -U3 -r syslog-ng-1.5.14-orig/src/affile.c syslog-ng-1.5.14-patched/src/affile.c
--- syslog-ng-1.5.14-orig/src/affile.c	Tue Feb  5 11:33:07 2002
+++ syslog-ng-1.5.14-patched/src/affile.c	Tue Feb  5 16:17:41 2002
@@ -558,15 +558,18 @@
 		length = append_string(dest, left, msg->host->data, msg->host->length, escape);
 		break;
 	}
-	case M_SOURCE_IP: 
+	case M_SOURCE_IP: {
+	 	char *ip;
 		if (msg->saddr) {
 	 		CAST(inet_address_info, addr, msg->saddr);
-	 		char *ip;
- 		
 	 		ip = inet_ntoa(addr->sa.sin_addr);
-			length = append_string(dest, left, ip, strlen(ip), escape);
-			break;
 		}
+		else {
+			ip = "127.0.0.1";
+		}
+		length = append_string(dest, left, ip, strlen(ip), escape);
+		break;
+	}
 	case M_HOST: {
 		/* host */
 		UINT8 *p1 = memchr(msg->host->data, '@', msg->host->length);

--PEIAKu/WMn1b1Hv9--