wtp: rework kernel socket handling

Switch to a connected UDP kernel socket. Comparing the
local and remote IPs is no longer required and handling
different IP versions and UDP types is automatic.

The WTP logic needs to reopen the socket on demand now.
This commit is contained in:
Andreas Schultz
2016-02-18 15:06:39 +01:00
parent cae859e42f
commit a6d0efe91a
10 changed files with 196 additions and 479 deletions

View File

@ -39,8 +39,9 @@ void wtp_start_datachannel(void) {
}
#endif
/* Connect to AC data channel */
if (!wtp_kmod_connect(&dataaddr.ss, &g_wtp.sessionid, g_wtp.mtu)) {
/* Bind data address and Connect to AC data channel */
if (wtp_kmod_bind(g_wtp.net.localaddr.ss.ss_family) ||
!wtp_kmod_connect(&dataaddr.ss, &g_wtp.sessionid, g_wtp.mtu)) {
/* Reset AC Prefered List Position */
g_wtp.acpreferedselected = 0;