Index: Makefile.in
--- Makefile.in.orig	2008-11-16 00:32:02 +0100
+++ Makefile.in	2008-12-29 09:06:40 +0100
@@ -13,6 +13,7 @@
 CPPFLAGS=@CPPFLAGS@
 EXEEXT=@EXEEXT@
 LDFLAGS=@LDFLAGS@
+PERL=perl
 
 INSTALLCMD=@INSTALL@
 INSTALLMAN=@INSTALL@
@@ -175,7 +176,7 @@
 	@if test -f proto.h; then :; else cp -p $(srcdir)/proto.h .; fi
 
 proto.h-tstamp: $(srcdir)/*.c $(srcdir)/lib/compat.c
-	perl $(srcdir)/mkproto.pl $(srcdir)/*.c $(srcdir)/lib/compat.c
+	$(PERL) $(srcdir)/mkproto.pl $(srcdir)/*.c $(srcdir)/lib/compat.c
 
 man: rsync.1 rsyncd.conf.5
 	@if test -f rsync.1; then :; else cp -p $(srcdir)/rsync.1 .; fi
Index: compat.c
--- compat.c.orig	2008-08-02 16:04:54 +0200
+++ compat.c	2008-12-29 09:06:40 +0100
@@ -164,19 +164,21 @@
 		rprintf(FINFO, "(%s) Protocol versions: remote=%d, negotiated=%d\n",
 			am_server? "Server" : "Client", remote_protocol, protocol_version);
 	}
-	if (remote_protocol < MIN_PROTOCOL_VERSION
-	 || remote_protocol > MAX_PROTOCOL_VERSION) {
+	if (   ( am_server && (remote_protocol < MIN_CLIENT_PROTOCOL_VERSION || remote_protocol > MAX_CLIENT_PROTOCOL_VERSION))
+	    || (!am_server && (remote_protocol < MIN_SERVER_PROTOCOL_VERSION || remote_protocol > MAX_SERVER_PROTOCOL_VERSION))) {
 		rprintf(FERROR,"protocol version mismatch -- is your shell clean?\n");
 		rprintf(FERROR,"(see the rsync man page for an explanation)\n");
 		exit_cleanup(RERR_PROTOCOL);
 	}
-	if (remote_protocol < OLD_PROTOCOL_VERSION) {
-		rprintf(FINFO,"%s is very old version of rsync, upgrade recommended.\n",
-			am_server? "Client" : "Server");
+	if (   ( am_server && remote_protocol < OLD_CLIENT_PROTOCOL_VERSION)
+	    || (!am_server && remote_protocol < OLD_SERVER_PROTOCOL_VERSION)) {
+		rprintf(FINFO,"%s is very old version (protocol %d) of rsync, upgrade recommended.\n",
+			am_server? "Client" : "Server", remote_protocol);
 	}
-	if (protocol_version < MIN_PROTOCOL_VERSION) {
+	if (   ( am_server && protocol_version < MIN_SERVER_PROTOCOL_VERSION)
+	    || (!am_server && protocol_version < MIN_CLIENT_PROTOCOL_VERSION)) {
 		rprintf(FERROR, "--protocol must be at least %d on the %s.\n",
-			MIN_PROTOCOL_VERSION, am_server? "Server" : "Client");
+			am_server ? MIN_SERVER_PROTOCOL_VERSION : MIN_CLIENT_PROTOCOL_VERSION, am_server? "Server" : "Client");
 		exit_cleanup(RERR_PROTOCOL);
 	}
 	if (protocol_version > PROTOCOL_VERSION) {
Index: rsync.h
--- rsync.h.orig	2008-09-27 06:21:52 +0200
+++ rsync.h	2008-12-29 09:06:40 +0100
@@ -114,9 +114,12 @@
  * unlikely to begin by sending a byte between MIN_PROTOCL_VERSION and
  * MAX_PROTOCOL_VERSION. */
 
-#define MIN_PROTOCOL_VERSION 20
-#define OLD_PROTOCOL_VERSION 25
-#define MAX_PROTOCOL_VERSION 40
+#define MIN_SERVER_PROTOCOL_VERSION 20
+#define OLD_SERVER_PROTOCOL_VERSION 25
+#define MAX_SERVER_PROTOCOL_VERSION 40
+#define MIN_CLIENT_PROTOCOL_VERSION 25
+#define OLD_CLIENT_PROTOCOL_VERSION 27
+#define MAX_CLIENT_PROTOCOL_VERSION 40
 
 #define FILECNT_LOOKAHEAD 1000
 
