On Wed, May 18, 2011 at 09:41:14PM +0200, Marek Wajdzik wrote:
> Hi.
> 
> 172.30.0.1 - compiled from fresh sources: bird 1.3.1 running debian
> with kernel 2.6.38.6 x64
> 172.30.0.120 - It is a mikrotik routeros version 5.2 node with configured 
> ospf.
> 
> When I restart the ospf in bird (birdc restrart OSPF) :P Mikrotik says:

Hello

Could you try BIRD with this (attached) patch?

-- 
Elen sila lumenn' omentielvo

Ondrej 'SanTiago' Zajicek (email: santi...@crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."
diff --git a/proto/ospf/packet.c b/proto/ospf/packet.c
index d156474..8479c30 100644
--- a/proto/ospf/packet.c
+++ b/proto/ospf/packet.c
@@ -60,12 +60,13 @@ ospf_pkt_finalize(struct ospf_iface *ifa, struct ospf_packet *pkt)
   struct MD5Context ctxt;
   char password[OSPF_AUTH_CRYPT_SIZE];
 
+  pkt->checksum = 0;
   pkt->autype = htons(ifa->autype);
+  bzero(&pkt->u, sizeof(union ospf_auth));
 
   switch(ifa->autype)
   {
     case OSPF_AUTH_SIMPLE:
-      bzero(&pkt->u, sizeof(union ospf_auth));
       passwd = password_find(ifa->passwords, 1);
       if (!passwd)
       {
@@ -74,7 +75,6 @@ ospf_pkt_finalize(struct ospf_iface *ifa, struct ospf_packet *pkt)
       }
       password_cpy(pkt->u.password, passwd->password, sizeof(union ospf_auth));
     case OSPF_AUTH_NONE:
-      pkt->checksum = 0;
       pkt->checksum = ipsum_calculate(pkt, sizeof(struct ospf_packet) -
                                   sizeof(union ospf_auth), (pkt + 1),
 				  ntohs(pkt->length) -
@@ -88,8 +88,6 @@ ospf_pkt_finalize(struct ospf_iface *ifa, struct ospf_packet *pkt)
         return;
       }
 
-      pkt->checksum = 0;
-
       /* Perhaps use random value to prevent replay attacks after
 	 reboot when system does not have independent RTC? */
       if (!ifa->csn)

Reply via email to