From 0e56a1f1d6ffa8539a60e174815a1aa3137feb85 Mon Sep 17 00:00:00 2001 From: Masafumi Aramoto Date: Sun, 19 Aug 2007 17:12:43 +0900 Subject: [PATCH] [BUGFIX] MN: insert the check "is_mn()" Before checing the existance of BUL in xfrm_del_bce, it should be checked whther MN or not, because it's the MN specific function. --- src/xfrm.c | 21 +++++++++++---------- 1 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/xfrm.c b/src/xfrm.c index 859c84d..52a73ba 100644 --- a/src/xfrm.c +++ b/src/xfrm.c @@ -1500,8 +1500,6 @@ void xfrm_del_bce(const struct in6_addr const struct in6_addr *peer_addr) { struct xfrm_selector sel; - struct home_addr_info *hai; - struct bulentry *e; set_selector(peer_addr, our_addr, 0, 0, 0, 0, &sel); xfrm_mip_policy_del(&sel, XFRM_POLICY_OUT); xfrm_state_del(IPPROTO_ROUTING, &sel); @@ -1509,16 +1507,19 @@ void xfrm_del_bce(const struct in6_addr xfrm_mip_policy_del(&sel, XFRM_POLICY_IN); xfrm_state_del(IPPROTO_DSTOPTS, &sel); - /* for MN-MN communications, checking BUL to insert RO policy */ - pthread_rwlock_rdlock(&mn_lock); - if ((hai = mn_get_home_addr(our_addr)) != NULL) { - if ((e = bul_get(hai, NULL, peer_addr)) != NULL) { - if (e->type == BUL_ENTRY) - _xfrm_add_bule_bce(our_addr, peer_addr, 0); + if (is_mn()){ + struct home_addr_info *hai; + struct bulentry *e; + /* for MN-MN communications, checking BUL to insert RO policy */ + pthread_rwlock_rdlock(&mn_lock); + if ((hai = mn_get_home_addr(our_addr)) != NULL) { + if ((e = bul_get(hai, NULL, peer_addr)) != NULL) { + if (e->type == BUL_ENTRY) + _xfrm_add_bule_bce(our_addr, peer_addr, 0); + } } + pthread_rwlock_unlock(&mn_lock); } - pthread_rwlock_unlock(&mn_lock); - } /** -- 1.4.3.GIT