* rip_routemap.c: In case of '0.0.0.0' used as 'nexthop', use sender
	  address as nexthop in routemap.

	Fixes bugzilla #186. [backport candidate]
diff --git a/ripd/ChangeLog b/ripd/ChangeLog
index 9e787d0..bd487f6 100644
--- a/ripd/ChangeLog
+++ b/ripd/ChangeLog
@@ -1,5 +1,10 @@
 2005-05-26 Hasso Tepper <hasso at quagga.net>
 
+	* rip_routemap.c: In case of '0.0.0.0' used as 'nexthop', use sender
+	  address as nexthop in routemap.
+
+2005-05-26 Hasso Tepper <hasso at quagga.net>
+
 	* rip_routemap.c: Make "match interface" routemap command match both -
 	  in and out interfaces.
 
diff --git a/ripd/rip_routemap.c b/ripd/rip_routemap.c
index 63d0ccc..275f683 100644
--- a/ripd/rip_routemap.c
+++ b/ripd/rip_routemap.c
@@ -275,7 +275,7 @@
     {
       rinfo = object;
       p.family = AF_INET;
-      p.prefix = rinfo->nexthop;
+      p.prefix = (rinfo->nexthop.s_addr) ? rinfo->nexthop : rinfo->from;
       p.prefixlen = IPV4_MAX_BITLEN;
 
       alist = access_list_lookup (AFI_IP, (char *) rule);
@@ -326,7 +326,7 @@
     {
       rinfo = object;
       p.family = AF_INET;
-      p.prefix = rinfo->nexthop;
+      p.prefix = (rinfo->nexthop.s_addr) ? rinfo->nexthop : rinfo->from;
       p.prefixlen = IPV4_MAX_BITLEN;
 
       plist = prefix_list_lookup (AFI_IP, (char *) rule);