]> git.proxmox.com Git - mirror_frr.git/commitdiff
ospfd: fix bug in NSSA ABR status check
authorDenis Ovsienko <infrastation@yandex.ru>
Sun, 18 Dec 2011 12:27:02 +0000 (16:27 +0400)
committerDenis Ovsienko <infrastation@yandex.ru>
Mon, 2 Jan 2012 14:38:04 +0000 (18:38 +0400)
* ospf_abr.c
  * ospf_abr_nssa_am_elected(): feed "best" instead of "address of best"
    into IPV4_ADDR_CMP(), because "best" is a pointer; also, mean s_addr
    field of the structures to get better typed pointers

ospfd/ospf_abr.c

index 846b90df4d9a6e59c4841bb6fc91aec458b6d40d..b7cc20dd87bceb2aa807291f0a8ce0e2be5b76b7 100644 (file)
@@ -384,7 +384,7 @@ ospf_abr_nssa_am_elected (struct ospf_area *area)
       if (best == NULL)
        best = &lsa->data->id;
       else
-        if ( IPV4_ADDR_CMP (&best, &lsa->data->id) < 0)
+        if (IPV4_ADDR_CMP (&best->s_addr, &lsa->data->id.s_addr) < 0)
           best = &lsa->data->id;
     }
     
@@ -395,7 +395,7 @@ ospf_abr_nssa_am_elected (struct ospf_area *area)
     if (best == NULL)
       return 1;
     
-    if ( IPV4_ADDR_CMP (&best, &area->ospf->router_id) < 0)
+    if (IPV4_ADDR_CMP (&best->s_addr, &area->ospf->router_id.s_addr) < 0)
       return 1;
     else
       return 0;