From 818fbc446ca064c6606ddef80df92b93995de25b Mon Sep 17 00:00:00 2001 From: "James R. Leu" Date: Wed, 23 Jun 2004 22:21:50 -0600 Subject: [PATCH] Assertting on session is not valid. A route addition that is not pointing into the MPLS network results in a no out going session being sent to these functions [git-p4: depot-paths = "//depot/ldp-portable/": change = 755] --- ldp/ldp_attr.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/ldp/ldp_attr.c b/ldp/ldp_attr.c index 19d4f90..e7db78d 100644 --- a/ldp/ldp_attr.c +++ b/ldp/ldp_attr.c @@ -653,7 +653,11 @@ ldp_attr_list *ldp_attr_find_upstream_all2(ldp_global * g, ldp_session * s, { ldp_fs *fs = NULL; - MPLS_ASSERT(s && f && g); + MPLS_ASSERT(f && g); + + if (!s) { + return NULL; + } /* find the upstream fs for this session */ if ((fs = _ldp_fec_find_fs_us(f, s, MPLS_BOOL_FALSE)) == NULL) { @@ -668,7 +672,11 @@ ldp_attr_list *ldp_attr_find_upstream_all(ldp_global * g, ldp_session * s, { ldp_fec *fnode = NULL; - MPLS_ASSERT(s && f && g); + MPLS_ASSERT(f && g); + + if (!s) { + return NULL; + } if ((fnode = _ldp_attr_get_fec2(g, f, MPLS_BOOL_FALSE)) == NULL) { /* we couldn't get the node from the tree! */ @@ -683,7 +691,11 @@ ldp_attr_list *ldp_attr_find_downstream_all2(ldp_global * g, ldp_session * s, { ldp_fs *fs = NULL; - MPLS_ASSERT(s && f && g); + MPLS_ASSERT(f && g); + + if (!s) { + return NULL; + } /* find the downstream fs for this session */ if ((fs = _ldp_fec_find_fs_ds(f, s, MPLS_BOOL_FALSE)) == NULL) { @@ -698,7 +710,11 @@ ldp_attr_list *ldp_attr_find_downstream_all(ldp_global * g, ldp_session * s, { ldp_fec *fnode = NULL; - MPLS_ASSERT(s && f && g); + MPLS_ASSERT(f && g); + + if (!s) { + return NULL; + } if ((fnode = _ldp_attr_get_fec2(g, f, MPLS_BOOL_FALSE)) == NULL) { /* we couldn't get the node from the tree! */ -- 2.11.4.GIT