diff --git a/libretroshare/src/services/p3banlist.cc b/libretroshare/src/services/p3banlist.cc index 4d567f405..60ba5cf26 100644 --- a/libretroshare/src/services/p3banlist.cc +++ b/libretroshare/src/services/p3banlist.cc @@ -36,6 +36,7 @@ #include "retroshare/rsbanlist.h" #include +#include /**** * #define DEBUG_BANLIST 1 @@ -786,6 +787,13 @@ bool p3BanList::saveList(bool &cleanup, std::list& itemlist) kv.value = mIPDHTGatheringEnabled?"TRUE":"FALSE" ; vitem->tlvkvs.pairs.push_back(kv) ; + kv.key = "IP_FILTERING_AUTORANGE_IPS_LIMIT" ; + std::ostringstream os ; + os << mAutoRangeLimit ; + os.flush() ; + kv.value = os.str() ; + vitem->tlvkvs.pairs.push_back(kv) ; + itemlist.push_back(vitem) ; return true ; @@ -806,6 +814,13 @@ bool p3BanList::loadList(std::list& load) if(it2->key == "IP_FILTERING_AUTORANGE_IPS") mAutoRangeIps = (it2->value=="TRUE") ; if(it2->key == "IP_FILTERING_FRIEND_GATHERING_ENABLED") mIPFriendGatheringEnabled = (it2->value=="TRUE") ; if(it2->key == "IP_FILTERING_DHT_GATHERING_ENABLED") mIPDHTGatheringEnabled = (it2->value=="TRUE") ; + + if(it2->key == "IP_FILTERING_AUTORANGE_IPS_LIMIT") + { + int val ; + if(sscanf(it2->value.c_str(),"%d",&val) == 1) + mAutoRangeLimit = val ; + } } RsBanListConfigItem *citem = dynamic_cast( *it ) ;