Skip to content

Commit

Permalink
Segfault fixed when relay interface was defined without interface-id.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaszmrugalski committed May 27, 2011
1 parent 8bcb14d commit b9c2588
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 29 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

0.8.1 [not-released-yet]
- Fixed socket binding problem on server that may affect relay scenarios
- Fixed segmentation fault when interface-id was not defined on relay interface.

0.8.0 [2011-05-11]
- Fixed compilation problems
Expand Down
2 changes: 1 addition & 1 deletion Options/OptVendorSpecInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
TOptVendorSpecInfo::TOptVendorSpecInfo(int type, char * buf, int n, TMsg* parent)
:TOpt(type, parent)
{
int optionCode, optionLen;
int optionCode = 0, optionLen = 0;
if (n<4) {
Log(Error) << "Unable to parse truncated vendor-spec info option." << LogEnd;
this->Vendor = 0;
Expand Down
9 changes: 7 additions & 2 deletions SrvCfgMgr/SrvCfgIface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -670,8 +670,13 @@ ostream& operator<<(ostream& out,TSrvCfgIface& iface) {
out << " <SrvCfgIface name=\""<<iface.Name << "\" ifindex=\""<<iface.ID << "\">" << endl;

if (iface.Relay) {
out << " <relay name=\"" << iface.RelayName << "\" ifindex=\"" << iface.RelayID << "\" interfaceid=\""
<< iface.RelayInterfaceID->getPlain() << "\"/>" << std::endl;
out << " <relay name=\"" << iface.RelayName << "\" ifindex=\"" << iface.RelayID;
if (iface.RelayInterfaceID) {
out << "\" interfaceid=\"" << iface.RelayInterfaceID->getPlain() << "\"";
} else {
out << "\" interfaceid=null";
}
out << "/>" << std::endl;
} else {
out << " <!-- <relay/> -->" << std::endl;
}
Expand Down
8 changes: 6 additions & 2 deletions SrvIfaceMgr/SrvIfaceIface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,12 @@ ostream & operator <<(ostream & strum, TSrvIfaceIface &x) {
if (x.RelaysCnt) {
for (i=0; i< x.RelaysCnt; i++) {
strum << " <OverlayingRelay name=\"" << x.Relays[i].iface->getName()
<< "\" ifindex=\"" << x.Relays[i].ifindex
<< "\" interfaceID=\"" << x.Relays[i].interfaceID->getPlain() << "\" />" << endl;
<< "\" ifindex=\"" << x.Relays[i].ifindex;
if (x.Relays[i].interfaceID)
strum << "\" interfaceID=\"" << x.Relays[i].interfaceID->getPlain();
else
strum << "\" interfaceID=null\"";
strum << "\" />" << endl;
}
}

Expand Down
6 changes: 3 additions & 3 deletions client-addrparams.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ experimental
iface "eth0"
{
ia
{
{
// address-parameters contain information about prefix length, so client
// will ask for it. If server supports it too, addr-params option will be
// granted.
addr-params
addr-params
}

}
21 changes: 0 additions & 21 deletions client-tunnelmode.conf

This file was deleted.

0 comments on commit b9c2588

Please sign in to comment.