Fix by Vadim Suraev - [zebra 14710] #6.
diff --git a/ospfd/ChangeLog b/ospfd/ChangeLog
index bc17a60..9dafb96 100644
--- a/ospfd/ChangeLog
+++ b/ospfd/ChangeLog
@@ -1,4 +1,8 @@
-2003-12-08 Mattias Amnefelt <mattiasa@kth.se?
+2004-02-11 Vadim Suraev <vadim.suraev@terayon.com>
+	* ospf_packet.c (ospf_ls_upd): Router should flush received network
+	  LSA if it was originated with older router-id ([zebra 14710] #6).
+
+2003-12-08 Mattias Amnefelt <mattiasa@kth.se>
 
 	* ospf_packet.c: (ospf_recv_packet) OpenBSD now leaves iph.ip_len 
 	  network byte order.
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index 86ed387..528e8d3 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -1699,6 +1699,42 @@
             }
         }
 #endif /* HAVE_OPAQUE_LSA */
+      /* It might be happen that received LSA is self-originated network LSA, but
+       * router ID is cahnged. So, we should check if LSA is a network-LSA whose
+       * Link State ID is one of the router's own IP interface addresses but whose
+       * Advertising Router is not equal to the router's own Router ID
+       * According to RFC 2328 12.4.2 and 13.4 this LSA should be flushed.
+       */
+
+      if(lsa->data->type == OSPF_NETWORK_LSA)
+      {
+        listnode oi_node;
+        int Flag = 0;
+
+        for(oi_node = listhead(oi->ospf->oiflist); oi_node; oi_node = nextnode(oi_node))
+        {
+          struct ospf_interface *out_if = getdata(oi_node);
+          if(out_if == NULL)
+            break;
+
+          if((IPV4_ADDR_SAME(&out_if->address->u.prefix4, &lsa->data->id)) &&
+              (!(IPV4_ADDR_SAME(&oi->ospf->router_id, &lsa->data->adv_router))))
+          {
+            if(out_if->network_lsa_self)
+            {
+              ospf_lsa_flush_area(lsa,out_if->area);
+              if(IS_DEBUG_OSPF_EVENT)
+                zlog_info ("ospf_lsa_discard() in ospf_ls_upd() point 9: lsa %p Type-%d",
+                            lsa, (int) lsa->data->type);
+              ospf_lsa_discard (lsa);
+              Flag = 1;
+            }
+            break;
+          }
+        }
+        if(Flag)
+          continue;
+      }
 
       /* (5) Find the instance of this LSA that is currently contained
 	 in the router's link state database.  If there is no