aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/discover.c
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2011-10-07 15:48:41 -0400
committerPaul Gortmaker <paul.gortmaker@windriver.com>2011-12-27 11:33:38 -0500
commitd6d4577ae48bcfde06894540ea793abf076e1643 (patch)
tree06521d98dec233bf68190ba2a017684ece5aa1c7 /net/tipc/discover.c
parent3d749a6a26b0811b4b2bb4ec2c47cd630a6bbf88 (diff)
tipc: Ignore neighbor discovery messages containing invalid address
Adds a check to ensure that TIPC ignores an incoming neighbor discovery message that specifies an invalid media address as its source. The check ensures that the source address is a valid, non-broadcast address that could legally be used by a neighboring link endpoint. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net/tipc/discover.c')
-rw-r--r--net/tipc/discover.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/tipc/discover.c b/net/tipc/discover.c
index 1ea2d44bbc36..420e0329036b 100644
--- a/net/tipc/discover.c
+++ b/net/tipc/discover.c
@@ -130,12 +130,15 @@ void tipc_disc_recv_msg(struct sk_buff *buf, struct tipc_bearer *b_ptr)
130 u32 type = msg_type(msg); 130 u32 type = msg_type(msg);
131 int link_fully_up; 131 int link_fully_up;
132 132
133 media_addr.broadcast = 1;
133 b_ptr->media->msg2addr(&media_addr, msg_media_addr(msg)); 134 b_ptr->media->msg2addr(&media_addr, msg_media_addr(msg));
134 buf_discard(buf); 135 buf_discard(buf);
135 136
136 /* Validate discovery message from requesting node */ 137 /* Validate discovery message from requesting node */
137 if (net_id != tipc_net_id) 138 if (net_id != tipc_net_id)
138 return; 139 return;
140 if (media_addr.broadcast)
141 return;
139 if (!tipc_addr_domain_valid(dest)) 142 if (!tipc_addr_domain_valid(dest))
140 return; 143 return;
141 if (!tipc_addr_node_valid(orig)) 144 if (!tipc_addr_node_valid(orig))