Now only unwiring if the NDP proxy did the wiring in the first place
This commit is contained in:
parent
701476417a
commit
55ad4b11f0
@ -79,13 +79,16 @@ session::~session()
|
||||
{
|
||||
logger::debug() << "session::~session() this=" << logger::format("%x", this);
|
||||
|
||||
if (_wired == true) {
|
||||
for (std::list<ptr<iface> >::iterator it = _ifaces.begin();
|
||||
it != _ifaces.end(); it++) {
|
||||
handle_auto_unwire((*it));
|
||||
}
|
||||
}
|
||||
|
||||
for (std::list<ptr<iface> >::iterator it = _ifaces.begin();
|
||||
it != _ifaces.end(); it++)
|
||||
{
|
||||
if (_autowire == true) {
|
||||
handle_auto_unwire((*it));
|
||||
}
|
||||
|
||||
(*it)->remove_session(_ptr);
|
||||
}
|
||||
}
|
||||
@ -101,6 +104,7 @@ ptr<session> session::create(const ptr<proxy>& pr, const address& saddr,
|
||||
se->_taddr = taddr;
|
||||
se->_daddr = daddr;
|
||||
se->_autowire = auto_wire;
|
||||
se->_wired = false;
|
||||
se->_ttl = pr->timeout();
|
||||
se->_touched = true;
|
||||
|
||||
@ -161,6 +165,8 @@ void session::handle_auto_wire(const ptr<iface>& ifa)
|
||||
<< "session::system(" << route_cmd.str() << ")";
|
||||
|
||||
system(route_cmd.str().c_str());
|
||||
|
||||
_wired = true;
|
||||
}
|
||||
|
||||
void session::handle_auto_unwire(const ptr<iface>& ifa)
|
||||
@ -181,6 +187,8 @@ void session::handle_auto_unwire(const ptr<iface>& ifa)
|
||||
<< "session::system(" << route_cmd.str() << ")";
|
||||
|
||||
system(route_cmd.str().c_str());
|
||||
|
||||
_wired = false;
|
||||
}
|
||||
|
||||
void session::handle_advert(const ptr<iface>& ifa)
|
||||
@ -223,6 +231,11 @@ bool session::autowire() const
|
||||
return _autowire;
|
||||
}
|
||||
|
||||
bool session::wired() const
|
||||
{
|
||||
return _wired;
|
||||
}
|
||||
|
||||
bool session::touched() const
|
||||
{
|
||||
return _touched;
|
||||
|
@ -34,6 +34,8 @@ private:
|
||||
|
||||
bool _autowire;
|
||||
|
||||
bool _wired;
|
||||
|
||||
bool _touched;
|
||||
|
||||
// An array of interfaces this session is monitoring for
|
||||
@ -75,6 +77,8 @@ public:
|
||||
|
||||
bool autowire() const;
|
||||
|
||||
bool wired() const;
|
||||
|
||||
bool touched() const;
|
||||
|
||||
int status() const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user