aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/subscr.c
diff options
context:
space:
mode:
authorNeil Horman <nhorman@tuxdriver.com>2010-10-20 21:06:15 -0400
committerDavid S. Miller <davem@davemloft.net>2010-10-21 07:11:07 -0400
commit8c974438085d2c81b006daeaab8801eedbd19758 (patch)
tree7a8fda9faaf643c5c8df48b34a5a2d1af327fd13 /net/tipc/subscr.c
parentd2ed817766987fd05e69b7da65d4861b38f1aa2a (diff)
Revert c6537d6742985da1fbf12ae26cde6a096fd35b5c
Backout the tipc changes to the flags int he subscription message. These changees, while reasonable on the surface, interefere with user space ABI compatibility which is a no-no. This was part of the changes to fix the endianess issues in the TIPC protocol, which would be really nice to do but we need to do so in a way that is backwards compatible with user space. Signed-off-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/subscr.c')
-rw-r--r--net/tipc/subscr.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c
index ab6eab4c45e2..ff123e56114a 100644
--- a/net/tipc/subscr.c
+++ b/net/tipc/subscr.c
@@ -274,7 +274,7 @@ static void subscr_cancel(struct tipc_subscr *s,
274{ 274{
275 struct subscription *sub; 275 struct subscription *sub;
276 struct subscription *sub_temp; 276 struct subscription *sub_temp;
277 __u32 type, lower, upper, timeout, filter; 277 __u32 type, lower, upper;
278 int found = 0; 278 int found = 0;
279 279
280 /* Find first matching subscription, exit if not found */ 280 /* Find first matching subscription, exit if not found */
@@ -282,18 +282,12 @@ static void subscr_cancel(struct tipc_subscr *s,
282 type = ntohl(s->seq.type); 282 type = ntohl(s->seq.type);
283 lower = ntohl(s->seq.lower); 283 lower = ntohl(s->seq.lower);
284 upper = ntohl(s->seq.upper); 284 upper = ntohl(s->seq.upper);
285 timeout = ntohl(s->timeout);
286 filter = ntohl(s->filter) & ~TIPC_SUB_CANCEL;
287 285
288 list_for_each_entry_safe(sub, sub_temp, &subscriber->subscription_list, 286 list_for_each_entry_safe(sub, sub_temp, &subscriber->subscription_list,
289 subscription_list) { 287 subscription_list) {
290 if ((type == sub->seq.type) && 288 if ((type == sub->seq.type) &&
291 (lower == sub->seq.lower) && 289 (lower == sub->seq.lower) &&
292 (upper == sub->seq.upper) && 290 (upper == sub->seq.upper)) {
293 (timeout == sub->timeout) &&
294 (filter == sub->filter) &&
295 !memcmp(s->usr_handle,sub->evt.s.usr_handle,
296 sizeof(s->usr_handle)) ){
297 found = 1; 291 found = 1;
298 break; 292 break;
299 } 293 }
@@ -310,7 +304,7 @@ static void subscr_cancel(struct tipc_subscr *s,
310 k_term_timer(&sub->timer); 304 k_term_timer(&sub->timer);
311 spin_lock_bh(subscriber->lock); 305 spin_lock_bh(subscriber->lock);
312 } 306 }
313 dbg("Cancel: removing sub %u,%u,%u from subscriber %p list\n", 307 dbg("Cancel: removing sub %u,%u,%u from subscriber %x list\n",
314 sub->seq.type, sub->seq.lower, sub->seq.upper, subscriber); 308 sub->seq.type, sub->seq.lower, sub->seq.upper, subscriber);
315 subscr_del(sub); 309 subscr_del(sub);
316} 310}
@@ -358,7 +352,8 @@ static struct subscription *subscr_subscribe(struct tipc_subscr *s,
358 sub->seq.upper = ntohl(s->seq.upper); 352 sub->seq.upper = ntohl(s->seq.upper);
359 sub->timeout = ntohl(s->timeout); 353 sub->timeout = ntohl(s->timeout);
360 sub->filter = ntohl(s->filter); 354 sub->filter = ntohl(s->filter);
361 if ((sub->filter && (sub->filter != TIPC_SUB_PORTS)) || 355 if ((!(sub->filter & TIPC_SUB_PORTS) ==
356 !(sub->filter & TIPC_SUB_SERVICE)) ||
362 (sub->seq.lower > sub->seq.upper)) { 357 (sub->seq.lower > sub->seq.upper)) {
363 warn("Subscription rejected, illegal request\n"); 358 warn("Subscription rejected, illegal request\n");
364 kfree(sub); 359 kfree(sub);