Skip to content

Commit

Permalink
fix some bugs in tunneling support detected by the usage of esp32 (he…
Browse files Browse the repository at this point in the history
…ap corruption)
  • Loading branch information
Ing-Dom committed Nov 25, 2024
1 parent df4ce55 commit f3dfbce
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ See the examples for basic usage options
- increase device object api version to 2 (invalidation of knx flash data stored by older versions)
- add #pragma once to Arduino plattform to allow derived plattforms
- change esp32 plattform to use KNX_NETIF
- fix out-of-boundary write and dereferenced nullpointer access in tunneling support

### V2.1.1 - 2024-09-16
- fix minor bug in TP-Uart Driver (RX queue out of boundary)
Expand Down
4 changes: 2 additions & 2 deletions src/knx/ip_data_link_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,8 +766,8 @@ void IpDataLinkLayer::loopHandleConnectRequest(uint8_t* buffer, uint16_t length,
tun = nullptr;
break;
}

tun->IndividualAddress = tunPa;
if(tun)
tun->IndividualAddress = tunPa;

}

Expand Down
2 changes: 1 addition & 1 deletion src/knx/ip_data_link_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class IpDataLinkLayer : public DataLinkLayer
DataLinkLayerCallbacks* _dllcb;
#ifdef KNX_TUNNELING
KnxIpTunnelConnection tunnels[KNX_TUNNELING];
uint8_t _lastChannelId = 1;
uint8_t _lastChannelId = 0;
#endif
};
#endif
3 changes: 2 additions & 1 deletion src/knx/knx_ip_connect_response.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ KnxIpConnectResponse::KnxIpConnectResponse(IpParameterObject& parameters, uint16

_crd.length((type == 4) ? 4 : 2); //TunnelConnectionResponse length = 4; ConfigConnectionResponse length = 2;
_crd.type(type);
_crd.address(address);
if(type == 4) // only fill address when it is a TunnelConnectionResponse
_crd.address(address);
}

KnxIpConnectResponse::KnxIpConnectResponse(uint8_t channel, uint8_t errorCode)
Expand Down

0 comments on commit f3dfbce

Please sign in to comment.