ospf6d: Fix crash when '[no] ipv6 ospf6 advertise prefix-list' is in startup-config

* ospf6_interface.c: When '[no] ipv6 ospf6 advertise prefix-list'
  appears in the startup configuration for ospf6d, a crash occurs,
  because ospf6d attempts to schedule LSAs when the 'oi->area'
  structure has not yet been initialized.

  Now, when the command above is issued (either in the startup
  configuration or at runtime), ospf6d will only schedule LSAs if
  the 'oi->area' structure has been initalized. A similar test is
  already used when handling the commands 'ipv6 ospf6 priority'
  and 'ipv6 ospf6 cost'.
This commit is contained in:
David Ward 2010-01-05 02:45:39 +00:00 committed by Greg Troxel
parent 85c4968bb1
commit 2470e99e82

View file

@ -1394,6 +1394,9 @@ DEFUN (ipv6_ospf6_advertise_prefix_list,
oi->plist_name = XSTRDUP (MTYPE_PREFIX_LIST_STR, argv[0]);
ospf6_interface_connected_route_update (oi->interface);
if (oi->area)
{
OSPF6_LINK_LSA_SCHEDULE (oi);
if (oi->state == OSPF6_INTERFACE_DR)
{
@ -1401,6 +1404,7 @@ DEFUN (ipv6_ospf6_advertise_prefix_list,
OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi);
}
OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi->area);
}
return CMD_SUCCESS;
}
@ -1433,6 +1437,9 @@ DEFUN (no_ipv6_ospf6_advertise_prefix_list,
}
ospf6_interface_connected_route_update (oi->interface);
if (oi->area)
{
OSPF6_LINK_LSA_SCHEDULE (oi);
if (oi->state == OSPF6_INTERFACE_DR)
{
@ -1440,6 +1447,7 @@ DEFUN (no_ipv6_ospf6_advertise_prefix_list,
OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi);
}
OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi->area);
}
return CMD_SUCCESS;
}