OK. Here it is - PtP patch from Andrew J. Schorr. No problems with ospfd,
ripd might need some more testing though.
diff --git a/lib/prefix.c b/lib/prefix.c
index d9751e3..3f3c4e8 100644
--- a/lib/prefix.c
+++ b/lib/prefix.c
@@ -247,7 +247,7 @@
 
       /* Get prefix length. */
       plen = (u_char) atoi (++pnt);
-      if (plen > 32)
+      if (plen > IPV4_MAX_PREFIXLEN)
 	return 0;
 
       p->family = AF_INET;
@@ -648,7 +648,7 @@
   
   destination = ntohl (p->prefix.s_addr);
   
-  if (p->prefixlen == 32);
+  if (p->prefixlen == IPV4_MAX_PREFIXLEN);
   /* do nothing for host routes */
   else if (IN_CLASSC (destination)) 
     {
@@ -667,6 +667,28 @@
     }
 }
 
+in_addr_t
+ipv4_network_addr (in_addr_t hostaddr, int masklen)
+{
+  struct in_addr mask;
+
+  masklen2ip (masklen, &mask);
+  return hostaddr & mask.s_addr;
+}
+
+in_addr_t
+ipv4_broadcast_addr (in_addr_t hostaddr, int masklen)
+{
+  struct in_addr mask;
+
+  masklen2ip (masklen, &mask);
+  return (masklen != IPV4_MAX_PREFIXLEN-1) ?
+	 /* normal case */
+         (hostaddr | ~mask.s_addr) :
+	 /* special case for /31 */
+         (hostaddr ^ ~mask.s_addr);
+}
+
 /* Utility function to convert ipv4 netmask to prefixes 
    ex.) "1.1.0.0" "255.255.0.0" => "1.1.0.0/16"
    ex.) "1.0.0.0" NULL => "1.0.0.0/8"                   */