diff options
Diffstat (limited to 'ospf6d/ospf6_message.c')
| -rw-r--r-- | ospf6d/ospf6_message.c | 61 |
1 files changed, 31 insertions, 30 deletions
diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c index a81c3e728f..352cb137ed 100644 --- a/ospf6d/ospf6_message.c +++ b/ospf6d/ospf6_message.c @@ -409,9 +409,8 @@ static void ospf6_hello_recv(struct in6_addr *src, struct in6_addr *dst, if (ntohs(hello->hello_interval) != oi->hello_interval) { zlog_warn( "VRF %s: I/F %s HelloInterval mismatch: (my %d, rcvd %d)", - vrf_id_to_name(oi->interface->vrf_id), - oi->interface->name, oi->hello_interval, - ntohs(hello->hello_interval)); + oi->interface->vrf->name, oi->interface->name, + oi->hello_interval, ntohs(hello->hello_interval)); return; } @@ -419,9 +418,8 @@ static void ospf6_hello_recv(struct in6_addr *src, struct in6_addr *dst, if (ntohs(hello->dead_interval) != oi->dead_interval) { zlog_warn( "VRF %s: I/F %s DeadInterval mismatch: (my %d, rcvd %d)", - vrf_id_to_name(oi->interface->vrf_id), - oi->interface->name, oi->dead_interval, - ntohs(hello->dead_interval)); + oi->interface->vrf->name, oi->interface->name, + oi->dead_interval, ntohs(hello->dead_interval)); return; } @@ -429,8 +427,15 @@ static void ospf6_hello_recv(struct in6_addr *src, struct in6_addr *dst, if (OSPF6_OPT_ISSET(hello->options, OSPF6_OPT_E) != OSPF6_OPT_ISSET(oi->area->options, OSPF6_OPT_E)) { zlog_warn("VRF %s: IF %s E-bit mismatch", - vrf_id_to_name(oi->interface->vrf_id), - oi->interface->name); + oi->interface->vrf->name, oi->interface->name); + return; + } + + /* N-bit check */ + if (OSPF6_OPT_ISSET(hello->options, OSPF6_OPT_N) + != OSPF6_OPT_ISSET(oi->area->options, OSPF6_OPT_N)) { + zlog_warn("VRF %s: IF %s N-bit mismatch", + oi->interface->vrf->name, oi->interface->name); return; } @@ -622,10 +627,8 @@ static void ospf6_dbdesc_recv_master(struct ospf6_header *oh, memcpy(on->options, dbdesc->options, sizeof(on->options)); } else { - zlog_warn( - "VRF %s: Nbr %s: Negotiation failed", - vrf_id_to_name(on->ospf6_if->interface->vrf_id), - on->name); + zlog_warn("VRF %s: Nbr %s: Negotiation failed", + on->ospf6_if->interface->vrf->name, on->name); return; } /* fall through to exchange */ @@ -772,7 +775,8 @@ static void ospf6_dbdesc_recv_master(struct ospf6_header *oh, /* More bit check */ if (!CHECK_FLAG(dbdesc->bits, OSPF6_DBDESC_MBIT) && !CHECK_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MBIT)) - thread_add_event(master, exchange_done, on, 0, NULL); + thread_add_event(master, exchange_done, on, 0, + &on->thread_exchange_done); else { thread_add_event(master, ospf6_dbdesc_send_newone, on, 0, &on->thread_send_dbdesc); @@ -837,10 +841,8 @@ static void ospf6_dbdesc_recv_slave(struct ospf6_header *oh, memcpy(on->options, dbdesc->options, sizeof(on->options)); } else { - zlog_warn( - "VRF %s: Nbr %s Negotiation failed", - vrf_id_to_name(on->ospf6_if->interface->vrf_id), - on->name); + zlog_warn("VRF %s: Nbr %s Negotiation failed", + on->ospf6_if->interface->vrf->name, on->name); return; } break; @@ -1007,8 +1009,8 @@ static void ospf6_dbdesc_recv(struct in6_addr *src, struct in6_addr *dst, /* Interface MTU check */ if (!oi->mtu_ignore && ntohs(dbdesc->ifmtu) != oi->ifmtu) { zlog_warn("VRF %s: I/F %s MTU mismatch (my %d rcvd %d)", - vrf_id_to_name(oi->interface->vrf_id), - oi->interface->name, oi->ifmtu, ntohs(dbdesc->ifmtu)); + oi->interface->vrf->name, oi->interface->name, + oi->ifmtu, ntohs(dbdesc->ifmtu)); return; } @@ -1514,14 +1516,12 @@ static int ospf6_rxpacket_examin(struct ospf6_interface *oi, if (oh->area_id == OSPF_AREA_BACKBONE) zlog_warn( "VRF %s: I/F %s Message may be via Virtual Link: not supported", - vrf_id_to_name(oi->interface->vrf_id), - oi->interface->name); + oi->interface->vrf->name, oi->interface->name); else zlog_warn( "VRF %s: I/F %s Area-ID mismatch (my %pI4, rcvd %pI4)", - vrf_id_to_name(oi->interface->vrf_id), - oi->interface->name, &oi->area->area_id, - &oh->area_id); + oi->interface->vrf->name, oi->interface->name, + &oi->area->area_id, &oh->area_id); return MSG_NG; } @@ -1529,16 +1529,16 @@ static int ospf6_rxpacket_examin(struct ospf6_interface *oi, if (oh->instance_id != oi->instance_id) { zlog_warn( "VRF %s: I/F %s Instance-ID mismatch (my %u, rcvd %u)", - vrf_id_to_name(oi->interface->vrf_id), - oi->interface->name, oi->instance_id, oh->instance_id); + oi->interface->vrf->name, oi->interface->name, + oi->instance_id, oh->instance_id); return MSG_NG; } /* Router-ID check */ if (oh->router_id == oi->area->ospf6->router_id) { zlog_warn("VRF %s: I/F %s Duplicate Router-ID (%pI4)", - vrf_id_to_name(oi->interface->vrf_id), - oi->interface->name, &oh->router_id); + oi->interface->vrf->name, oi->interface->name, + &oh->router_id); return MSG_NG; } return MSG_OK; @@ -1768,7 +1768,7 @@ static int ospf6_read_helper(int sockfd, struct ospf6 *ospf6) * Drop packet destined to another VRF. * This happens when raw_l3mdev_accept is set to 1. */ - if (ospf6->vrf_id != oi->interface->vrf_id) + if (ospf6->vrf_id != oi->interface->vrf->vrf_id) return OSPF6_READ_CONTINUE; oh = (struct ospf6_header *)recvbuf; @@ -2261,7 +2261,8 @@ int ospf6_dbdesc_send_newone(struct thread *thread) if (!CHECK_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MSBIT) && /* Slave */ !CHECK_FLAG(on->dbdesc_last.bits, OSPF6_DBDESC_MBIT) && !CHECK_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MBIT)) - thread_add_event(master, exchange_done, on, 0, NULL); + thread_add_event(master, exchange_done, on, 0, + &on->thread_exchange_done); thread_execute(master, ospf6_dbdesc_send, on, 0); return 0; |
