aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/link.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/link.c')
-rw-r--r--net/tipc/link.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index ef203a1581c..de9d49108d4 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -187,14 +187,17 @@ static int link_name_validate(const char *name, struct link_name *name_parts)
187 /* ensure all component parts of link name are present */ 187 /* ensure all component parts of link name are present */
188 188
189 addr_local = name_copy; 189 addr_local = name_copy;
190 if ((if_local = strchr(addr_local, ':')) == NULL) 190 if_local = strchr(addr_local, ':');
191 if (if_local == NULL)
191 return 0; 192 return 0;
192 *(if_local++) = 0; 193 *(if_local++) = 0;
193 if ((addr_peer = strchr(if_local, '-')) == NULL) 194 addr_peer = strchr(if_local, '-');
195 if (addr_peer == NULL)
194 return 0; 196 return 0;
195 *(addr_peer++) = 0; 197 *(addr_peer++) = 0;
196 if_local_len = addr_peer - if_local; 198 if_local_len = addr_peer - if_local;
197 if ((if_peer = strchr(addr_peer, ':')) == NULL) 199 if_peer = strchr(addr_peer, ':');
200 if (if_peer == NULL)
198 return 0; 201 return 0;
199 *(if_peer++) = 0; 202 *(if_peer++) = 0;
200 if_peer_len = strlen(if_peer) + 1; 203 if_peer_len = strlen(if_peer) + 1;
@@ -2044,8 +2047,8 @@ static void link_recv_proto_msg(struct link *l_ptr, struct sk_buff *buf)
2044 2047
2045 strcpy((strrchr(l_ptr->name, ':') + 1), (char *)msg_data(msg)); 2048 strcpy((strrchr(l_ptr->name, ':') + 1), (char *)msg_data(msg));
2046 2049
2047 if ((msg_tol = msg_link_tolerance(msg)) && 2050 msg_tol = msg_link_tolerance(msg);
2048 (msg_tol > l_ptr->tolerance)) 2051 if (msg_tol > l_ptr->tolerance)
2049 link_set_supervision_props(l_ptr, msg_tol); 2052 link_set_supervision_props(l_ptr, msg_tol);
2050 2053
2051 if (msg_linkprio(msg) > l_ptr->priority) 2054 if (msg_linkprio(msg) > l_ptr->priority)
@@ -2074,7 +2077,8 @@ static void link_recv_proto_msg(struct link *l_ptr, struct sk_buff *buf)
2074 break; 2077 break;
2075 case STATE_MSG: 2078 case STATE_MSG:
2076 2079
2077 if ((msg_tol = msg_link_tolerance(msg))) 2080 msg_tol = msg_link_tolerance(msg);
2081 if (msg_tol)
2078 link_set_supervision_props(l_ptr, msg_tol); 2082 link_set_supervision_props(l_ptr, msg_tol);
2079 2083
2080 if (msg_linkprio(msg) && 2084 if (msg_linkprio(msg) &&