Browse files

libknet: cleanup knet_link_set/get_config

this also allows to kill the madness around dynamic ip management
and saves enother bytes in the ping header

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information...
1 parent 8032f2a commit 321e7f7668c0e4bb24ab6be3569fe24a5e8ee745 @fabbione committed Jan 11, 2013
Showing with 222 additions and 118 deletions.
  1. +16 −52 kronosnetd/vty_cli_cmds.c
  2. +54 −11 libknet/libknet.h
  3. +146 −49 libknet/link.c
  4. +3 −0 libknet/link.h
  5. +0 −1 libknet/onwire.h
  6. +1 −1 libknet/ping_test.c
  7. +2 −4 libknet/threads.c
View
68 kronosnetd/vty_cli_cmds.c
@@ -50,8 +50,7 @@
#define CMDS_PARAM_LINK_PRI 15
#define CMDS_PARAM_LINK_KEEPAL 16
#define CMDS_PARAM_LINK_HOLDTI 17
-#define CMDS_PARAM_LINK_DYN 18
-#define CMDS_PARAM_VTY_TIMEOUT 19
+#define CMDS_PARAM_VTY_TIMEOUT 18
/*
* CLI helper functions - menu/node stuff starts below
@@ -323,12 +322,6 @@ static int check_param(struct knet_vty *vty, const int paramtype, char *param, i
err = -1;
}
break;
- case CMDS_PARAM_LINK_DYN:
- tmp = param_to_int(param, paramlen);
- if ((tmp < 0) || (tmp > 1)) {
- knet_vty_write(vty, "link dynamic should be either 0 or 1. Default: 0%s", telnet_newline);
- }
- break;
case CMDS_PARAM_VTY_TIMEOUT:
tmp = param_to_int(param, paramlen);
if ((tmp < 0) || (tmp > 3600)) {
@@ -397,9 +390,6 @@ static void describe_param(struct knet_vty *vty, const int paramtype)
case CMDS_PARAM_LINK_HOLDTI:
knet_vty_write(vty, "HOLDTIME - specify how much time has to pass without connection before a link is considered dead (0 to 60000 milliseconds, default is 5000).%s", telnet_newline);
break;
- case CMDS_PARAM_LINK_DYN:
- knet_vty_write(vty, "DYNAMIC - specify if this link will traverse NAT or Dynamic IP connections.%s", telnet_newline);
- break;
case CMDS_PARAM_VTY_TIMEOUT:
knet_vty_write(vty, "VTY_TIMEOUT - specify the number of seconds before a session is automatically closed.%s", telnet_newline);
break;
@@ -637,7 +627,6 @@ static int knet_cmd_switch_policy(struct knet_vty *vty);
/* link node */
static int knet_cmd_link_pri(struct knet_vty *vty);
static int knet_cmd_link_timer(struct knet_vty *vty);
-static int knet_cmd_link_dyn(struct knet_vty *vty);
/* vty node */
static int knet_cmd_vty(struct knet_vty *vty);
@@ -789,13 +778,7 @@ vty_param_t link_timer_params[] = {
{ CMDS_PARAM_NOMORE },
};
-vty_param_t link_dyn_params[] = {
- { CMDS_PARAM_LINK_DYN },
- { CMDS_PARAM_NOMORE },
-};
-
vty_node_cmds_t link_cmds[] = {
- { "dynamic", "set link NAT/dynamic ip traversal code", link_dyn_params, knet_cmd_link_dyn },
{ "exit", "exit configuration mode", NULL, knet_cmd_exit_node },
{ "help", "display basic help", NULL, knet_cmd_help },
{ "logout", "exit from CLI", NULL, knet_cmd_logout },
@@ -865,30 +848,6 @@ static int knet_cmd_vty(struct knet_vty *vty)
/* links */
-static int knet_cmd_link_dyn(struct knet_vty *vty)
-{
- struct knet_cfg *knet_iface = (struct knet_cfg *)vty->iface;
- int paramlen = 0, paramoffset = 0, dyn;
- char *param = NULL;
- unsigned int dynamic;
-
- knet_link_get_dynamic(knet_iface->cfg_ring.knet_h, vty->host_id, vty->link_id, &dynamic);
-
- if (dynamic == KNET_LINK_DYN_DST)
- return 0;
-
- get_param(vty, 1, &param, &paramlen, &paramoffset);
- dyn = param_to_int(param, paramlen);
-
- if (dyn) {
- dynamic = KNET_LINK_DYN_SRC;
- } else {
- dynamic = KNET_LINK_STATIC;
- }
-
- return knet_link_set_dynamic(knet_iface->cfg_ring.knet_h, vty->host_id, vty->link_id, dynamic);
-}
-
static int knet_cmd_link_timer(struct knet_vty *vty)
{
struct knet_cfg *knet_iface = (struct knet_cfg *)vty->iface;
@@ -956,6 +915,7 @@ static int knet_cmd_link(struct knet_vty *vty)
char src_ipaddr[KNET_MAX_HOST_LEN], src_port[KNET_MAX_PORT_LEN], dst_ipaddr[KNET_MAX_HOST_LEN], dst_port[KNET_MAX_PORT_LEN];
struct sockaddr_storage src_addr;
struct sockaddr_storage dst_addr;
+ struct sockaddr_storage *dst = NULL;
get_param(vty, 1, &param, &paramlen, &paramoffset);
vty->link_id = param_to_int(param, paramlen);
@@ -981,16 +941,17 @@ static int knet_cmd_link(struct knet_vty *vty)
}
if (!strncmp(dst_ipaddr, "dynamic", 7)) {
- knet_link_set_dynamic(knet_iface->cfg_ring.knet_h, vty->host_id, vty->link_id, KNET_LINK_DYN_DST);
+ dst = NULL;
} else {
if (strtoaddr(dst_ipaddr, dst_port, (struct sockaddr *)&dst_addr, sizeof(struct sockaddr_storage)) != 0) {
knet_vty_write(vty, "Error: unable to convert destination ip addr to sockaddr!%s", telnet_newline);
err = -1;
goto out_clean;
}
+ dst = &dst_addr;
}
- knet_link_config(knet_iface->cfg_ring.knet_h, vty->host_id, vty->link_id, &src_addr, &dst_addr);
+ knet_link_set_config(knet_iface->cfg_ring.knet_h, vty->host_id, vty->link_id, &src_addr, dst);
knet_link_set_timeout(knet_iface->cfg_ring.knet_h, vty->host_id, vty->link_id, 1000, 5000, 2048);
@@ -1601,19 +1562,21 @@ static int knet_cmd_status(struct knet_vty *vty)
for (i = 0; i < KNET_MAX_LINK; i++) {
unsigned int dynamic;
+ struct sockaddr_storage src_addr;
+ struct sockaddr_storage dst_addr;
+
+ dynamic = knet_link_get_config(knet_iface->cfg_ring.knet_h, host_ids[j], i, &src_addr, &dst_addr);
knet_link_get_status(knet_iface->cfg_ring.knet_h, host_ids[j], i, &status);
- knet_link_get_dynamic(knet_iface->cfg_ring.knet_h, host_ids[j], i, &dynamic);
if (status.configured == 1) {
- if (dynamic == KNET_LINK_DYN_DST) {
+ if (dynamic) {
knet_vty_write(vty, " link %s dynamic (connected: %d)%s", status.src_ipaddr, status.connected, nl);
} else {
knet_vty_write(vty, " link %s %s (connected: %d)%s", status.src_ipaddr, status.dst_ipaddr, status.connected, nl);
}
if (status.connected) {
knet_vty_write(vty, " average latency: %llu us%s", status.latency, nl);
- if ((dynamic == KNET_LINK_DYN_DST) &&
- (status.dynconnected)) {
- knet_vty_write(vty, " source ip: %s%s", status.dst_ipaddr, nl);
+ if ((dynamic) && (status.dynconnected)) {
+ knet_vty_write(vty, " source ip: %s%s", status.dst_ipaddr, nl);
}
} else {
knet_vty_write(vty, " last heard: ");
@@ -1706,13 +1669,14 @@ static int knet_cmd_print_conf(struct knet_vty *vty)
uint8_t priority;
unsigned int dynamic, precision;
time_t interval, timeout;
+ struct sockaddr_storage src_addr;
+ struct sockaddr_storage dst_addr;
- knet_link_get_dynamic(knet_iface->cfg_ring.knet_h, host_ids[j], i, &dynamic);
- if (dynamic == KNET_LINK_DYN_DST) {
+ dynamic = knet_link_get_config(knet_iface->cfg_ring.knet_h, host_ids[j], i, &src_addr, &dst_addr);
+ if (dynamic) {
knet_vty_write(vty, " link %d %s dynamic%s", i, status.src_ipaddr, nl);
} else {
knet_vty_write(vty, " link %d %s %s%s", i, status.src_ipaddr, status.dst_ipaddr, nl);
- knet_vty_write(vty, " dynamic %u%s", dynamic, nl);
}
knet_link_get_timeout(knet_iface->cfg_ring.knet_h, host_ids[j], i, &interval, &timeout, &precision);
knet_vty_write(vty, " timers %llu %llu%s", (unsigned long long)interval, (unsigned long long)timeout, nl);
View
65 libknet/libknet.h
@@ -356,6 +356,7 @@ int knet_host_get_host_list(knet_handle_t knet_h,
/*
* define switching policies
*/
+
#define KNET_LINK_POLICY_PASSIVE 0
#define KNET_LINK_POLICY_ACTIVE 1
#define KNET_LINK_POLICY_RR 2
@@ -419,7 +420,7 @@ int knet_host_get_policy(knet_handle_t knet_h, uint16_t host_id,
* paths that connect 2 hosts.
*
* Each link is identified by a link_id that has a
- * values between 0 and KNET_MAX_LINK included.
+ * values between 0 and KNET_MAX_LINK - 1.
*
* KNOWN LIMITATIONS:
*
@@ -435,9 +436,58 @@ int knet_host_get_policy(knet_handle_t knet_h, uint16_t host_id,
* -
*/
-int knet_link_config(knet_handle_t knet_h, uint16_t node_id, uint8_t link_id,
- struct sockaddr_storage *src_addr,
- struct sockaddr_storage *dst_addr);
+/*
+ * knet_link_set_config
+ *
+ * knet_h - pointer to knet_handle_t
+ *
+ * host_id - see above
+ *
+ * link_id - see above
+ *
+ * src_addr - sockaddr_storage that can be either IPv4 or IPv6
+ *
+ * dst_addr - sockaddr_storage that can be either IPv4 or IPv6
+ * this can be null if we don't know the incoming
+ * IP address/port and the link will remain quiet
+ * till the node on the other end will initiate a
+ * connection
+ *
+ * knet_link_set_config returns:
+ *
+ * 0 on success
+ * -1 on error and errno is set.
+ */
+
+int knet_link_set_config(knet_handle_t knet_h, uint16_t host_id, uint8_t link_id,
+ struct sockaddr_storage *src_addr,
+ struct sockaddr_storage *dst_addr);
+
+/*
+ * knet_link_get_config
+ *
+ * knet_h - pointer to knet_handle_t
+ *
+ * host_id - see above
+ *
+ * link_id - see above
+ *
+ * src_addr - sockaddr_storage that can be either IPv4 or IPv6
+ *
+ * dst_addr - sockaddr_storage that can be either IPv4 or IPv6
+ * this can be null if the link has dynamic incoming connection
+ *
+ * knet_link_set_config returns:
+ *
+ * 1 on success and the link is dynamic, dst_addr is unknown/unconfigured
+ * 0 on success and both src and dst have been configured by set_config
+ * -1 on error and errno is set.
+ */
+
+int knet_link_get_config(knet_handle_t knet_h, uint16_t host_id, uint8_t link_id,
+ struct sockaddr_storage *src_addr,
+ struct sockaddr_storage *dst_addr);
+
int knet_link_enable(knet_handle_t knet_h, uint16_t node_id, uint8_t link_id, int configured);
@@ -447,13 +497,6 @@ int knet_link_get_timeout(knet_handle_t knet_h, uint16_t node_id, uint8_t link_i
int knet_link_set_priority(knet_handle_t knet_h, uint16_t node_id, uint8_t link_id, uint8_t priority);
int knet_link_get_priority(knet_handle_t knet_h, uint16_t node_id, uint8_t link_id, uint8_t *priority);
-#define KNET_LINK_STATIC 0 /* link com is static ip (default) */
-#define KNET_LINK_DYN_SRC 1 /* link com has src dynamic ip */
-#define KNET_LINK_DYN_DST 2 /* link com is dst from dyn src */
-
-int knet_link_set_dynamic(knet_handle_t knet_h, uint16_t node_id, uint8_t link_id, unsigned int dynamic);
-int knet_link_get_dynamic(knet_handle_t knet_h, uint16_t node_id, uint8_t link_id, unsigned int *dynamic);
-
struct knet_link_status {
char src_ipaddr[KNET_MAX_HOST_LEN];
char src_port[KNET_MAX_PORT_LEN];
View
195 libknet/link.c
@@ -13,6 +13,7 @@
#include <netdb.h>
#include <string.h>
#include <stdio.h>
+#include <pthread.h>
#include "internals.h"
#include "logging.h"
@@ -194,81 +195,177 @@ int knet_link_get_timeout(knet_handle_t knet_h, uint16_t node_id, uint8_t link_i
return 0;
}
-/* HACK FEST.. see libknet.h */
-
-int knet_link_config(knet_handle_t knet_h,
- uint16_t node_id,
- uint8_t link_id,
- struct sockaddr_storage *src_addr,
- struct sockaddr_storage *dst_addr)
+int knet_link_set_config(knet_handle_t knet_h, uint16_t host_id, uint8_t link_id,
+ struct sockaddr_storage *src_addr,
+ struct sockaddr_storage *dst_addr)
{
- if (!knet_h->host_index[node_id])
- return -1;
+ int savederrno = 0, err = 0;
+ struct knet_host *host;
+ struct knet_link *link;
- memcpy(&knet_h->host_index[node_id]->link[link_id].src_addr, src_addr, sizeof(struct sockaddr_storage));
+ if (!knet_h) {
+ errno = EINVAL;
+ return -1;
+ }
- if (getnameinfo((const struct sockaddr *)src_addr, sizeof(struct sockaddr_storage),
- knet_h->host_index[node_id]->link[link_id].status.src_ipaddr, KNET_MAX_HOST_LEN,
- knet_h->host_index[node_id]->link[link_id].status.src_port, KNET_MAX_PORT_LEN,
- NI_NUMERICHOST | NI_NUMERICSERV) != 0) {
- log_debug(knet_h, KNET_SUB_LINK,
- "Unable to resolve host: %s link: %u source addr/port",
- knet_h->host_index[node_id]->name,
- link_id);
- snprintf(knet_h->host_index[node_id]->link[link_id].status.src_ipaddr, KNET_MAX_HOST_LEN - 1, "Unknown!!!");
- snprintf(knet_h->host_index[node_id]->link[link_id].status.src_ipaddr, KNET_MAX_PORT_LEN - 1, "??");
+ if (link_id >= KNET_MAX_LINK) {
+ errno = EINVAL;
return -1;
}
- if (knet_h->host_index[node_id]->link[link_id].dynamic == KNET_LINK_DYN_DST)
- return 0;
+ if (!src_addr) {
+ errno = EINVAL;
+ return -1;
+ }
- memcpy(&knet_h->host_index[node_id]->link[link_id].dst_addr, dst_addr, sizeof(struct sockaddr_storage));
- if (getnameinfo((const struct sockaddr *)dst_addr, sizeof(struct sockaddr_storage),
- knet_h->host_index[node_id]->link[link_id].status.dst_ipaddr, KNET_MAX_HOST_LEN,
- knet_h->host_index[node_id]->link[link_id].status.dst_port, KNET_MAX_PORT_LEN,
- NI_NUMERICHOST | NI_NUMERICSERV) != 0) {
- log_debug(knet_h, KNET_SUB_LINK,
- "Unable to resolve host: %s link: %u destination addr/port",
- knet_h->host_index[node_id]->name,
- link_id);
- snprintf(knet_h->host_index[node_id]->link[link_id].status.dst_ipaddr, KNET_MAX_HOST_LEN - 1, "Unknown!!!");
- snprintf(knet_h->host_index[node_id]->link[link_id].status.dst_ipaddr, KNET_MAX_PORT_LEN - 1, "??");
+ savederrno = pthread_rwlock_wrlock(&knet_h->list_rwlock);
+ if (savederrno) {
+ log_err(knet_h, KNET_SUB_LINK, "Unable to get write lock: %s",
+ strerror(savederrno));
+ errno = savederrno;
return -1;
}
- return 0;
+ host = knet_h->host_index[host_id];
+ if (!host) {
+ err = -1;
+ savederrno = EINVAL;
+ log_err(knet_h, KNET_SUB_LINK, "Unable to find host %u: %s",
+ host_id, strerror(savederrno));
+ goto exit_unlock;
+ }
+
+ link = &host->link[link_id];
+
+ /* rememeber to check if link is on traffic before allowing reconfig */
+
+ memcpy(&link->src_addr, src_addr, sizeof(struct sockaddr_storage));
+
+ err = getnameinfo((const struct sockaddr *)src_addr, sizeof(struct sockaddr_storage),
+ link->status.src_ipaddr, KNET_MAX_HOST_LEN,
+ link->status.src_port, KNET_MAX_PORT_LEN,
+ NI_NUMERICHOST | NI_NUMERICSERV);
+ if (err) {
+ if (err == EAI_SYSTEM) {
+ savederrno = errno;
+ log_warn(knet_h, KNET_SUB_LINK,
+ "Unable to resolve host: %s link: %u source addr/port: %s",
+ host->name, link_id, strerror(savederrno));
+ } else {
+ savederrno = EINVAL;
+ log_warn(knet_h, KNET_SUB_LINK,
+ "Unable to resolve host: %s link: %u source addr/port: %s",
+ host->name, link_id, gai_strerror(err));
+ }
+ err = -1;
+ goto exit_unlock;
+ }
+
+ if (!dst_addr) {
+ link->dynamic = KNET_LINK_DYNIP;
+ err = 0;
+ goto exit_unlock;
+ }
+
+ link->dynamic = KNET_LINK_STATIC;
+
+ memcpy(&link->dst_addr, dst_addr, sizeof(struct sockaddr_storage));
+ err = getnameinfo((const struct sockaddr *)dst_addr, sizeof(struct sockaddr_storage),
+ link->status.dst_ipaddr, KNET_MAX_HOST_LEN,
+ link->status.dst_port, KNET_MAX_PORT_LEN,
+ NI_NUMERICHOST | NI_NUMERICSERV);
+ if (err) {
+ if (err == EAI_SYSTEM) {
+ savederrno = errno;
+ log_warn(knet_h, KNET_SUB_LINK,
+ "Unable to resolve host: %s link: %u destination addr/port: %s",
+ host->name, link_id, strerror(savederrno));
+ } else {
+ savederrno = EINVAL;
+ log_warn(knet_h, KNET_SUB_LINK,
+ "Unable to resolve host: %s link: %u destination addr/port: %s",
+ host->name, link_id, gai_strerror(err));
+ }
+ err = -1;
+ }
+
+exit_unlock:
+ pthread_rwlock_unlock(&knet_h->list_rwlock);
+ errno = savederrno;
+ return err;
}
-int knet_link_get_status(knet_handle_t knet_h,
- uint16_t node_id,
- uint8_t link_id,
- struct knet_link_status *status)
+int knet_link_get_config(knet_handle_t knet_h, uint16_t host_id, uint8_t link_id,
+ struct sockaddr_storage *src_addr,
+ struct sockaddr_storage *dst_addr)
{
- if (!knet_h->host_index[node_id])
+ int savederrno = 0, err = 0;
+ struct knet_host *host;
+ struct knet_link *link;
+
+ if (!knet_h) {
+ errno = EINVAL;
return -1;
+ }
- memcpy(status, &knet_h->host_index[node_id]->link[link_id].status, sizeof(struct knet_link_status));
+ if (link_id >= KNET_MAX_LINK) {
+ errno = EINVAL;
+ return -1;
+ }
- return 0;
-}
+ if (!src_addr) {
+ errno = EINVAL;
+ return -1;
+ }
-int knet_link_set_dynamic(knet_handle_t knet_h, uint16_t node_id, uint8_t link_id, unsigned int dynamic)
-{
- if (!knet_h->host_index[node_id])
+ if (!dst_addr) {
+ errno = EINVAL;
return -1;
+ }
- knet_h->host_index[node_id]->link[link_id].dynamic = dynamic;
+ savederrno = pthread_rwlock_rdlock(&knet_h->list_rwlock);
+ if (savederrno) {
+ log_err(knet_h, KNET_SUB_LINK, "Unable to get read lock: %s",
+ strerror(savederrno));
+ errno = savederrno;
+ return -1;
+ }
- return 0;
+ host = knet_h->host_index[host_id];
+ if (!host) {
+ err = -1;
+ savederrno = EINVAL;
+ log_err(knet_h, KNET_SUB_LINK, "Unable to find host %u: %s",
+ host_id, strerror(savederrno));
+ goto exit_unlock;
+ }
+
+ link = &host->link[link_id];
+
+ memcpy(src_addr, &link->src_addr, sizeof(struct sockaddr_storage));
+
+ if (link->dynamic == KNET_LINK_DYNIP) {
+ err = 1;
+ goto exit_unlock;
+ }
+
+ memcpy(dst_addr, &link->dst_addr, sizeof(struct sockaddr_storage));
+
+exit_unlock:
+ pthread_rwlock_unlock(&knet_h->list_rwlock);
+ errno = savederrno;
+ return err;
}
-int knet_link_get_dynamic(knet_handle_t knet_h, uint16_t node_id, uint8_t link_id, unsigned int *dynamic)
+int knet_link_get_status(knet_handle_t knet_h,
+ uint16_t node_id,
+ uint8_t link_id,
+ struct knet_link_status *status)
{
if (!knet_h->host_index[node_id])
return -1;
- *dynamic = knet_h->host_index[node_id]->link[link_id].dynamic;
+ memcpy(status, &knet_h->host_index[node_id]->link[link_id].status, sizeof(struct knet_link_status));
return 0;
}
View
3 libknet/link.h
@@ -12,6 +12,9 @@
#include "internals.h"
+#define KNET_LINK_STATIC 0 /* link has static ip on both ends */
+#define KNET_LINK_DYNIP 1 /* link has dynamic destination ip */
+
int _link_updown(knet_handle_t knet_h, uint16_t node_id,
struct knet_link *lnk, int configured, int connected);
View
1 libknet/onwire.h
@@ -55,7 +55,6 @@ union knet_frame_data {
} data __attribute__((packed));
struct {
uint8_t kfd_link;
- uint8_t kfd_dyn;
uint32_t kfd_time[4];
} ping __attribute__((packed));
} __attribute__((packed));
View
2 libknet/ping_test.c
@@ -154,7 +154,7 @@ static void argv_to_hosts(int argc, char *argv[])
exit(EXIT_FAILURE);
}
- knet_link_config(knet_h, node_id, 0, &src_addr, &dst_addr);
+ knet_link_set_config(knet_h, node_id, 0, &src_addr, &dst_addr);
knet_link_set_timeout(knet_h, node_id, 0, 1000, 5000, 2048);
knet_link_enable(knet_h, node_id, 0, 1);
}
View
6 libknet/threads.c
@@ -240,8 +240,7 @@ static void _handle_recv_from_links(knet_handle_t knet_h, int sockfd)
if ((knet_h->recv_from_links_buf->kf_type & KNET_FRAME_PMSK) != 0) {
src_link = src_host->link +
(knet_h->recv_from_links_buf->kf_link % KNET_MAX_LINK);
- if ((src_link->dynamic == KNET_LINK_DYN_DST) &&
- (knet_h->recv_from_links_buf->kf_dyn == 1)) {
+ if (src_link->dynamic == KNET_LINK_DYNIP) {
if (memcmp(&src_link->dst_addr, &address, sizeof(struct sockaddr_storage)) != 0) {
log_debug(knet_h, KNET_SUB_LINK_T, "host: %s link: %u appears to have changed ip address",
src_host->name, src_link->link_id);
@@ -557,7 +556,6 @@ static void _handle_check_each(knet_handle_t knet_h, struct knet_host *dst_host,
if (diff_ping >= (dst_link->ping_interval * 1000llu)) {
memcpy(&knet_h->pingbuf->kf_time[0], &clock_now, sizeof(struct timespec));
knet_h->pingbuf->kf_link = dst_link->link_id;
- knet_h->pingbuf->kf_dyn = dst_link->dynamic;
if (knet_h->crypto_instance) {
if (crypto_encrypt_and_sign(knet_h,
@@ -616,7 +614,7 @@ void *_handle_heartbt_thread(void *data)
for (dst_host = knet_h->host_head; dst_host != NULL; dst_host = dst_host->next) {
for (link_idx = 0; link_idx < KNET_MAX_LINK; link_idx++) {
if ((dst_host->link[link_idx].status.configured != 1) ||
- ((dst_host->link[link_idx].dynamic == KNET_LINK_DYN_DST) &&
+ ((dst_host->link[link_idx].dynamic == KNET_LINK_DYNIP) &&
(dst_host->link[link_idx].status.dynconnected != 1)))
continue;
_handle_check_each(knet_h, dst_host, &dst_host->link[link_idx]);

0 comments on commit 321e7f7

Please sign in to comment.