diff options
Diffstat (limited to 'ospfd')
-rw-r--r-- | ospfd/ospf_lsa.c | 9 | ||||
-rw-r--r-- | ospfd/ospf_packet.c | 21 | ||||
-rw-r--r-- | ospfd/ospf_spf.c | 25 | ||||
-rw-r--r-- | ospfd/ospf_zebra.c | 6 | ||||
-rw-r--r-- | ospfd/ospfd.c | 58 |
5 files changed, 119 insertions, 0 deletions
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c index f453353d..8981b57f 100644 --- a/ospfd/ospf_lsa.c +++ b/ospfd/ospf_lsa.c @@ -182,8 +182,17 @@ ospf_lsa_checksum (struct lsa_header *lsa) u_char *buffer = (u_char *) &lsa->options; int options_offset = buffer - (u_char *) &lsa->ls_age; /* should be 2 */ +<<<<<<< HEAD:ospfd/ospf_lsa.c + x = (((int)length - LSA_CHECKSUM_OFFSET) * c0 - c1) % 255; + if (x <= 0) + x += 255; + y = 510 - c0 - x; + if (y > 255) + y -= 255; +======= /* Skip the AGE field */ u_int16_t len = ntohs(lsa->length) - options_offset; +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:ospfd/ospf_lsa.c /* Checksum offset starts from "options" field, not the beginning of the lsa_header struct. The offset is 14, rather than 16. */ diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c index 5f0d99da..c7279c9a 100644 --- a/ospfd/ospf_packet.c +++ b/ospfd/ospf_packet.c @@ -765,6 +765,27 @@ ospf_hello (struct ip *iph, struct ospf_header *ospfh, return; } +<<<<<<< HEAD:ospfd/ospf_packet.c + /* If incoming interface is passive one, ignore Hello. */ + if (OSPF_IF_PASSIVE_STATUS (oi) == OSPF_IF_PASSIVE) { + char buf[3][INET_ADDRSTRLEN]; + zlog_debug ("ignoring HELLO from router %s sent to %s, " + "received on a passive interface, %s", + inet_ntop(AF_INET, &ospfh->router_id, buf[0], sizeof(buf[0])), + inet_ntop(AF_INET, &iph->ip_dst, buf[1], sizeof(buf[1])), + inet_ntop(AF_INET, &oi->address->u.prefix4, + buf[2], sizeof(buf[2]))); + if (iph->ip_dst.s_addr == htonl(OSPF_ALLSPFROUTERS)) + { + /* Try to fix multicast membership. */ + OI_MEMBER_JOINED(oi, MEMBER_ALLROUTERS); + ospf_if_set_multicast(oi); + } + return; + } + +======= +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:ospfd/ospf_packet.c /* get neighbor prefix. */ p.family = AF_INET; p.prefixlen = ip_masklen (hello->network_mask); diff --git a/ospfd/ospf_spf.c b/ospfd/ospf_spf.c index 82f0fedd..2c5064e5 100644 --- a/ospfd/ospf_spf.c +++ b/ospfd/ospf_spf.c @@ -200,11 +200,21 @@ ospf_vertex_free (void *data) * vertices */ //assert (listcount (v->parents) == 0); +<<<<<<< HEAD:ospfd/ospf_spf.c +======= if (v->children) list_delete (v->children); v->children = NULL; +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:ospfd/ospf_spf.c +<<<<<<< HEAD:ospfd/ospf_spf.c + if (v->children) + list_delete (v->children); + v->children = NULL; + +======= +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:ospfd/ospf_spf.c if (v->parents) list_delete (v->parents); v->parents = NULL; @@ -432,7 +442,20 @@ ospf_spf_add_parent (struct vertex *v, struct vertex *w, /* we must have a newhop, and a distance */ assert (v && w && newhop); assert (distance); +<<<<<<< HEAD:ospfd/ospf_spf.c +======= + + /* IFF w has already been assigned a distance, then we shouldn't get here + * unless callers have determined V(l)->W is shortest / equal-shortest + * path (0 is a special case distance (no distance yet assigned)). + */ + if (w->distance) + assert (distance <= w->distance); + else + w->distance = distance; +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:ospfd/ospf_spf.c +<<<<<<< HEAD:ospfd/ospf_spf.c /* IFF w has already been assigned a distance, then we shouldn't get here * unless callers have determined V(l)->W is shortest / equal-shortest * path (0 is a special case distance (no distance yet assigned)). @@ -442,6 +465,8 @@ ospf_spf_add_parent (struct vertex *v, struct vertex *w, else w->distance = distance; +======= +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:ospfd/ospf_spf.c if (IS_DEBUG_OSPF_EVENT) { char buf[2][INET_ADDRSTRLEN]; diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c index e27f1394..6188ec83 100644 --- a/ospfd/ospf_zebra.c +++ b/ospfd/ospf_zebra.c @@ -266,7 +266,13 @@ ospf_interface_address_add (int command, struct zclient *zclient, zlog_debug("Zebra: interface %s address add %s", c->ifp->name, buf); } +<<<<<<< HEAD:ospfd/ospf_zebra.c + ospf = ospf_lookup (); + if (ospf != NULL) + ospf_if_update (ospf); +======= ospf_if_update (NULL, c->ifp); +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:ospfd/ospf_zebra.c #ifdef HAVE_SNMP ospf_snmp_if_update (c->ifp); diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c index c951a29a..1d38adcf 100644 --- a/ospfd/ospfd.c +++ b/ospfd/ospfd.c @@ -958,7 +958,65 @@ ospf_network_run (struct prefix *p, struct ospf_area *area) /* Get target interface. */ for (ALL_LIST_ELEMENTS_RO (om->iflist, node, ifp)) +<<<<<<< HEAD:ospfd/ospfd.c + { + struct listnode *cnode; + + if (memcmp (ifp->name, "VLINK", 5) == 0) + continue; + + /* if interface prefix is match specified prefix, + then create socket and join multicast group. */ + for (ALL_LIST_ELEMENTS_RO (ifp->connected, cnode, co)) + { + struct prefix *addr; + + if (CHECK_FLAG(co->flags,ZEBRA_IFA_SECONDARY)) + continue; + + addr = CONNECTED_ID(co); + + if (p->family == co->address->family + && ! ospf_if_is_configured (ospf, &(addr->u.prefix4)) + && ospf_network_match_iface(co,p)) + { + struct ospf_interface *oi; + + oi = ospf_if_new (ospf, ifp, co->address); + oi->connected = co; + + oi->area = area; + + oi->params = ospf_lookup_if_params (ifp, oi->address->u.prefix4); + oi->output_cost = ospf_if_get_output_cost (oi); + + /* Add pseudo neighbor. */ + ospf_nbr_add_self (oi); + + /* Relate ospf interface to ospf instance. */ + oi->ospf = ospf; + + /* update network type as interface flag */ + /* If network type is specified previously, + skip network type setting. */ + oi->type = IF_DEF_PARAMS (ifp)->type; + + ospf_area_add_if (oi->area, oi); + + /* if router_id is not configured, dont bring up + * interfaces. + * ospf_router_id_update() will call ospf_if_update + * whenever r-id is configured instead. + */ + if ((ospf->router_id.s_addr != 0) + && if_is_operative (ifp)) + ospf_if_up (oi); + } + } + } +======= ospf_network_run_interface (p, area, ifp); +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:ospfd/ospfd.c } void |