diff options
author | denis <denis@cvs.openbsd.org> | 2020-01-02 10:16:47 +0000 |
---|---|---|
committer | denis <denis@cvs.openbsd.org> | 2020-01-02 10:16:47 +0000 |
commit | 7c7c9d891a5db6779d5adb23b78b9c9e48ae9a65 (patch) | |
tree | 534c567e353247ddddc9a43d57a081d496443ae3 /usr.sbin | |
parent | 2e11d9f47708905c25a9e51a7be80613b4df50cc (diff) |
Rename orig_rtr_lsa_area() to orig_rtr_lsa()
Now that area is part of iface, original orig_rtr_lsa() is useless. Also
verifying that area != NULL is not needed in some cases (these are
leftovers of the previous diff).
OK remi@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ospf6d/interface.c | 10 | ||||
-rw-r--r-- | usr.sbin/ospf6d/neighbor.c | 6 | ||||
-rw-r--r-- | usr.sbin/ospf6d/ospf6d.c | 4 | ||||
-rw-r--r-- | usr.sbin/ospf6d/ospfe.c | 19 | ||||
-rw-r--r-- | usr.sbin/ospf6d/ospfe.h | 4 | ||||
-rw-r--r-- | usr.sbin/ospf6d/rde.c | 4 | ||||
-rw-r--r-- | usr.sbin/ospf6d/rde_lsdb.c | 8 |
7 files changed, 20 insertions, 35 deletions
diff --git a/usr.sbin/ospf6d/interface.c b/usr.sbin/ospf6d/interface.c index ad0fb9f1df5..d91eb3bd882 100644 --- a/usr.sbin/ospf6d/interface.c +++ b/usr.sbin/ospf6d/interface.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interface.c,v 1.27 2019/12/23 07:33:49 denis Exp $ */ +/* $OpenBSD: interface.c,v 1.28 2020/01/02 10:16:46 denis Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -144,7 +144,7 @@ if_fsm(struct iface *iface, enum iface_event event) if (iface->state != old_state) { area_track(iface->area); - orig_rtr_lsa(iface); + orig_rtr_lsa(iface->area); orig_link_lsa(iface); /* state change inform RDE */ @@ -395,7 +395,7 @@ if_act_start(struct iface *iface) if (iface->cflags & F_IFACE_PASSIVE) { /* for an update of stub network entries */ - orig_rtr_lsa(iface); + orig_rtr_lsa(iface->area); return (0); } @@ -569,7 +569,7 @@ start: nbr_fsm(nbr, NBR_EVT_ADJ_OK); } - orig_rtr_lsa(iface); + orig_rtr_lsa(iface->area); if (iface->state & IF_STA_DR || old_state & IF_STA_DR) orig_net_lsa(iface); } @@ -586,7 +586,7 @@ if_act_reset(struct iface *iface) if (iface->cflags & F_IFACE_PASSIVE) { /* for an update of stub network entries */ - orig_rtr_lsa(iface); + orig_rtr_lsa(iface->area); return (0); } diff --git a/usr.sbin/ospf6d/neighbor.c b/usr.sbin/ospf6d/neighbor.c index df8564f4b1f..8e13b7644e7 100644 --- a/usr.sbin/ospf6d/neighbor.c +++ b/usr.sbin/ospf6d/neighbor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: neighbor.c,v 1.15 2019/12/23 07:33:49 denis Exp $ */ +/* $OpenBSD: neighbor.c,v 1.16 2020/01/02 10:16:46 denis Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -202,7 +202,7 @@ nbr_fsm(struct nbr *nbr, enum nbr_event event) * neighbor changed from/to FULL * originate new rtr and net LSA */ - orig_rtr_lsa(nbr->iface); + orig_rtr_lsa(nbr->iface->area); if (nbr->iface->state & IF_STA_DR) orig_net_lsa(nbr->iface); @@ -226,7 +226,7 @@ nbr_fsm(struct nbr *nbr, enum nbr_event event) nbr_state_name(nbr->state)); if (nbr->iface->type == IF_TYPE_VIRTUALLINK) { - orig_rtr_lsa(nbr->iface); + orig_rtr_lsa(nbr->iface->area); } } diff --git a/usr.sbin/ospf6d/ospf6d.c b/usr.sbin/ospf6d/ospf6d.c index 703992230ad..26e15b09782 100644 --- a/usr.sbin/ospf6d/ospf6d.c +++ b/usr.sbin/ospf6d/ospf6d.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospf6d.c,v 1.45 2019/12/16 08:28:33 denis Exp $ */ +/* $OpenBSD: ospf6d.c,v 1.46 2020/01/02 10:16:46 denis Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -741,7 +741,7 @@ merge_config(struct ospfd_conf *conf, struct ospfd_conf *xconf) } if (a->dirty) { a->dirty = 0; - orig_rtr_lsa(LIST_FIRST(&a->iface_list)); + orig_rtr_lsa(LIST_FIRST(&a->iface_list)->area); } } } diff --git a/usr.sbin/ospf6d/ospfe.c b/usr.sbin/ospf6d/ospfe.c index 5d0744681f7..07413f2807e 100644 --- a/usr.sbin/ospf6d/ospfe.c +++ b/usr.sbin/ospf6d/ospfe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospfe.c,v 1.60 2020/01/01 10:09:34 denis Exp $ */ +/* $OpenBSD: ospfe.c,v 1.61 2020/01/02 10:16:46 denis Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -45,7 +45,6 @@ void ospfe_sig_handler(int, short, void *); __dead void ospfe_shutdown(void); void orig_rtr_lsa_all(struct area *); -void orig_rtr_lsa_area(struct area *); struct iface *find_vlink(struct abr_rtr *); struct ospfd_conf *oeconf = NULL, *nconf; @@ -297,7 +296,7 @@ ospfe_dispatch_main(int fd, short event, void *bula) i->depend_ok = ifstate_is_up(ifp); if (ifstate_is_up(i)) - orig_rtr_lsa(i); + orig_rtr_lsa(i->area); } } } @@ -596,8 +595,6 @@ ospfe_dispatch_rde(int fd, short event, void *bula) * flood on all area interfaces on * area 0.0.0.0 include also virtual links. */ - if (nbr->iface->area == NULL) - fatalx("interface lost area"); LIST_FOREACH(iface, &nbr->iface->area->iface_list, entry) { noack += lsa_flood(iface, nbr, @@ -795,19 +792,11 @@ orig_rtr_lsa_all(struct area *area) */ LIST_FOREACH(a, &oeconf->area_list, entry) if (a != area) - orig_rtr_lsa_area(a); + orig_rtr_lsa(a); } void -orig_rtr_lsa(struct iface *iface) -{ - if (iface->area == NULL) - fatalx("interface lost area"); - orig_rtr_lsa_area(iface->area); -} - -void -orig_rtr_lsa_area(struct area *area) +orig_rtr_lsa(struct area *area) { struct lsa_hdr lsa_hdr; struct lsa_rtr lsa_rtr; diff --git a/usr.sbin/ospf6d/ospfe.h b/usr.sbin/ospf6d/ospfe.h index dcdde44bdcd..e8c4f9b2985 100644 --- a/usr.sbin/ospf6d/ospfe.h +++ b/usr.sbin/ospf6d/ospfe.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ospfe.h,v 1.22 2019/12/28 09:25:24 denis Exp $ */ +/* $OpenBSD: ospfe.h,v 1.23 2020/01/02 10:16:46 denis Exp $ */ /* * Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org> @@ -121,7 +121,7 @@ u_int32_t ospfe_router_id(void); void ospfe_fib_update(int); void ospfe_iface_ctl(struct ctl_conn *, unsigned int); void ospfe_nbr_ctl(struct ctl_conn *); -void orig_rtr_lsa(struct iface *); +void orig_rtr_lsa(struct area *); void orig_net_lsa(struct iface *); void orig_link_lsa(struct iface *); void ospfe_demote_area(struct area *, int); diff --git a/usr.sbin/ospf6d/rde.c b/usr.sbin/ospf6d/rde.c index b2d58eb2cc9..50acfa416f7 100644 --- a/usr.sbin/ospf6d/rde.c +++ b/usr.sbin/ospf6d/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.81 2019/12/23 07:33:49 denis Exp $ */ +/* $OpenBSD: rde.c,v 1.82 2020/01/02 10:16:46 denis Exp $ */ /* * Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org> @@ -753,8 +753,6 @@ rde_dispatch_parent(int fd, short event, void *bula) if (prev_link_ok == link_ok) break; - if (iface->area == NULL) - fatalx("interface lost area"); orig_intra_area_prefix_lsas(iface->area); break; diff --git a/usr.sbin/ospf6d/rde_lsdb.c b/usr.sbin/ospf6d/rde_lsdb.c index 1a53efff680..3326c1e90cf 100644 --- a/usr.sbin/ospf6d/rde_lsdb.c +++ b/usr.sbin/ospf6d/rde_lsdb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_lsdb.c,v 1.40 2019/12/23 07:33:49 denis Exp $ */ +/* $OpenBSD: rde_lsdb.c,v 1.41 2020/01/02 10:16:46 denis Exp $ */ /* * Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org> @@ -573,11 +573,9 @@ lsa_find(struct iface *iface, u_int16_t type, u_int32_t ls_id, if (LSA_IS_SCOPE_AS(ntohs(type))) tree = &asext_tree; - else if (LSA_IS_SCOPE_AREA(ntohs(type))) { - if (iface->area == NULL) - fatalx("interface lost area"); + else if (LSA_IS_SCOPE_AREA(ntohs(type))) tree = &iface->area->lsa_tree; - } else if (LSA_IS_SCOPE_LLOCAL(ntohs(type))) + else if (LSA_IS_SCOPE_LLOCAL(ntohs(type))) tree = &iface->lsa_tree; else fatalx("unknown scope type"); |