diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2007-01-11 21:43:14 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2007-01-11 21:43:14 +0000 |
commit | cd8a72824ca6117eb03f1f980ac722941bc83b86 (patch) | |
tree | 789b1612c6b074de91c7abfa26d3ef00ff28800b /usr.sbin/ospfd | |
parent | 76b4aa4a16ef415f30c7d6129d07ef3ea3844c36 (diff) |
Silently ignore unknown neighbors in the rde and ospfe imsg handler. This
is needed for upcomming reload support -- it can happen that a message to
a just deleted neighbor is still pending.
Diffstat (limited to 'usr.sbin/ospfd')
-rw-r--r-- | usr.sbin/ospfd/ospfe.c | 30 | ||||
-rw-r--r-- | usr.sbin/ospfd/rde.c | 21 |
2 files changed, 18 insertions, 33 deletions
diff --git a/usr.sbin/ospfd/ospfe.c b/usr.sbin/ospfd/ospfe.c index 0059741af55..198f78605f2 100644 --- a/usr.sbin/ospfd/ospfe.c +++ b/usr.sbin/ospfd/ospfe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospfe.c,v 1.50 2006/11/28 19:21:15 reyk Exp $ */ +/* $OpenBSD: ospfe.c,v 1.51 2007/01/11 21:43:13 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -71,8 +71,8 @@ pid_t ospfe(struct ospfd_conf *xconf, int pipe_parent2ospfe[2], int pipe_ospfe2rde[2], int pipe_parent2rde[2]) { - struct area *area = NULL; - struct iface *iface = NULL; + struct area *area; + struct iface *iface; struct redistribute *r; struct passwd *pw; struct event ev_sigint, ev_sigterm; @@ -369,8 +369,7 @@ ospfe_dispatch_rde(int fd, short event, void *bula) case IMSG_DD: nbr = nbr_find_peerid(imsg.hdr.peerid); if (nbr == NULL) - fatalx("ospfe_dispatch_rde: " - "neighbor not found"); + break; /* put these on my ls_req_list for retrieval */ lhp = lsa_hdr_new(); @@ -380,8 +379,7 @@ ospfe_dispatch_rde(int fd, short event, void *bula) case IMSG_DD_END: nbr = nbr_find_peerid(imsg.hdr.peerid); if (nbr == NULL) - fatalx("ospfe_dispatch_rde: " - "neighbor not found"); + break; nbr->dd_pending--; if (nbr->dd_pending == 0 && nbr->state & NBR_STA_LOAD) { @@ -394,8 +392,7 @@ ospfe_dispatch_rde(int fd, short event, void *bula) case IMSG_DB_SNAPSHOT: nbr = nbr_find_peerid(imsg.hdr.peerid); if (nbr == NULL) - fatalx("ospfe_dispatch_rde: " - "neighbor not found"); + break; /* add LSA header to the neighbor db_sum_list */ lhp = lsa_hdr_new(); @@ -405,8 +402,7 @@ ospfe_dispatch_rde(int fd, short event, void *bula) case IMSG_DB_END: nbr = nbr_find_peerid(imsg.hdr.peerid); if (nbr == NULL) - fatalx("ospfe_dispatch_rde: " - "neighbor not found"); + break; /* snapshot done, start tx of dd packets */ nbr_fsm(nbr, NBR_EVT_SNAP_DONE); @@ -414,8 +410,7 @@ ospfe_dispatch_rde(int fd, short event, void *bula) case IMSG_LS_FLOOD: nbr = nbr_find_peerid(imsg.hdr.peerid); if (nbr == NULL) - fatalx("ospfe_dispatch_rde: " - "neighbor not found"); + break; l = imsg.hdr.len - IMSG_HEADER_SIZE; if (l < sizeof(lsa_hdr)) @@ -492,8 +487,7 @@ ospfe_dispatch_rde(int fd, short event, void *bula) nbr = nbr_find_peerid(imsg.hdr.peerid); if (nbr == NULL) - fatalx("ospfe_dispatch_rde: " - "neighbor not found"); + break; if (nbr->iface->self == nbr) break; @@ -518,8 +512,7 @@ ospfe_dispatch_rde(int fd, short event, void *bula) */ nbr = nbr_find_peerid(imsg.hdr.peerid); if (nbr == NULL) - fatalx("ospfe_dispatch_rde: " - "neighbor not found"); + break; if (nbr->iface->self == nbr) break; @@ -544,8 +537,7 @@ ospfe_dispatch_rde(int fd, short event, void *bula) case IMSG_LS_BADREQ: nbr = nbr_find_peerid(imsg.hdr.peerid); if (nbr == NULL) - fatalx("ospfe_dispatch_rde: " - "neighbor not found"); + break; if (nbr->iface->self == nbr) fatalx("ospfe_dispatch_rde: " diff --git a/usr.sbin/ospfd/rde.c b/usr.sbin/ospfd/rde.c index fd446650f90..7acef538711 100644 --- a/usr.sbin/ospfd/rde.c +++ b/usr.sbin/ospfd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.51 2007/01/11 21:35:15 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.52 2007/01/11 21:43:13 claudio Exp $ */ /* * Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org> @@ -290,9 +290,7 @@ rde_dispatch_imsg(int fd, short event, void *bula) nbr = rde_nbr_find(imsg.hdr.peerid); if (nbr == NULL) - fatalx("rde_dispatch_imsg: " - "neighbor does not exist"); - + break; if (state != nbr->state && (nbr->state & NBR_STA_FULL || state & NBR_STA_FULL)) @@ -305,8 +303,7 @@ rde_dispatch_imsg(int fd, short event, void *bula) case IMSG_DB_SNAPSHOT: nbr = rde_nbr_find(imsg.hdr.peerid); if (nbr == NULL) - fatalx("rde_dispatch_imsg: " - "neighbor does not exist"); + break; lsa_snap(nbr->area, imsg.hdr.peerid); @@ -316,8 +313,7 @@ rde_dispatch_imsg(int fd, short event, void *bula) case IMSG_DD: nbr = rde_nbr_find(imsg.hdr.peerid); if (nbr == NULL) - fatalx("rde_dispatch_imsg: " - "neighbor does not exist"); + break; buf = imsg.data; for (l = imsg.hdr.len - IMSG_HEADER_SIZE; @@ -354,8 +350,7 @@ rde_dispatch_imsg(int fd, short event, void *bula) case IMSG_LS_REQ: nbr = rde_nbr_find(imsg.hdr.peerid); if (nbr == NULL) - fatalx("rde_dispatch_imsg: " - "neighbor does not exist"); + break; buf = imsg.data; for (l = imsg.hdr.len - IMSG_HEADER_SIZE; @@ -382,8 +377,7 @@ rde_dispatch_imsg(int fd, short event, void *bula) case IMSG_LS_UPD: nbr = rde_nbr_find(imsg.hdr.peerid); if (nbr == NULL) - fatalx("rde_dispatch_imsg: " - "neighbor does not exist"); + break; lsa = malloc(imsg.hdr.len - IMSG_HEADER_SIZE); if (lsa == NULL) @@ -480,8 +474,7 @@ rde_dispatch_imsg(int fd, short event, void *bula) case IMSG_LS_MAXAGE: nbr = rde_nbr_find(imsg.hdr.peerid); if (nbr == NULL) - fatalx("rde_dispatch_imsg: " - "neighbor does not exist"); + break; if (imsg.hdr.len != IMSG_HEADER_SIZE + sizeof(struct lsa_hdr)) |