From 58695908411a11daf91f64fa11487cab2403f540 Mon Sep 17 00:00:00 2001 From: Masafumi Aramoto Date: Sun, 19 Aug 2007 16:40:58 +0900 Subject: [PATCH] [BUGFIX] MN: For MN-MN communications, not to delete the RO policy at receiving de-reg BU. MN1 should not delete all the RO policy when MN1 receive the de-reg BU from MN2. --- src/xfrm.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/src/xfrm.c b/src/xfrm.c index 09513af..65767ad 100644 --- a/src/xfrm.c +++ b/src/xfrm.c @@ -1500,12 +1500,25 @@ 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); set_selector(our_addr, peer_addr, 0, 0, 0, 0, &sel); 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); + } + } + pthread_rwlock_unlock(&mn_lock); + } /** -- 1.4.3.GIT