1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-31 17:31:18 +01:00

net/gnrc/tcp: Adapt to change in ipv6_addr_split_iface

This commit is contained in:
Leandro Lanzieri 2019-11-07 16:39:48 +01:00
parent a602e0afae
commit 3c89597c83

View File

@ -168,15 +168,15 @@ static int _gnrc_tcp_open(gnrc_tcp_tcb_t *tcb, char *target_addr, uint16_t targe
if ((target_addr != NULL) && (tcb->address_family == AF_INET6)) {
/* Extract interface (optional) specifier from target address */
int ll_iface = ipv6_addr_split_iface(target_addr);
char *ll_iface = ipv6_addr_split_iface(target_addr);
if (ipv6_addr_from_str((ipv6_addr_t *) tcb->peer_addr, target_addr) == NULL) {
DEBUG("gnrc_tcp.c : _gnrc_tcp_open() : Invalid peer addr\n");
return -EINVAL;
}
/* In case the given address is link-local: Memorize the interface Id if existing. */
if ((ll_iface > 0) && ipv6_addr_is_link_local((ipv6_addr_t *) tcb->peer_addr)) {
tcb->ll_iface = ll_iface;
if ((ll_iface) && ipv6_addr_is_link_local((ipv6_addr_t *) tcb->peer_addr)) {
tcb->ll_iface = atoi(ll_iface);
}
}
#endif