improve error case handling in encap_add().  from hitachi
improve error case handling in encap_add().  from hitachi

MarginC/kame,MarginC/kame,MarginC/kame,MarginC/kame,MarginC/kame,MarginC/kame,MarginC/kame