lkml.org 
[lkml]   [2010]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [Patch 3/3] net: reserve ports for applications using fixed port numbers
From
Date
Cong Wang wrote:
> Tetsuo Handa wrote:
> >> Index: linux-2.6/net/sctp/socket.c
> >> ===================================================================
> >> --- linux-2.6.orig/net/sctp/socket.c
> >> +++ linux-2.6/net/sctp/socket.c
> >> @@ -5436,6 +5436,8 @@ static long sctp_get_port_local(struct s
> >> rover++;
> >> if ((rover < low) || (rover > high))
> >> rover = low;
> >> + if (inet_is_reserved_local_port(rover))
> >> + continue;
> >
> > This one needs to be
> >
> > if (inet_is_reserved_local_port(rover))
> > goto next_nolock;
> >
> >> index = sctp_phashfn(rover);
> >> head = &sctp_port_hashtable[index];
> >> sctp_spin_lock(&head->lock);
> >
> > next:
> > sctp_spin_unlock(&head->lock);
> > +next_nolock:
> > } while (--remaining > 0);
> >
> > otherwise, it will loop forever if all ports were reserved.
>
> Sorry, doesn't 'continue' jump to exactly where 'next_nolock' is??
> Or I am missing something?

My misreading, sorry.


\
 
 \ /
  Last update: 2010-04-12 09:09    [W:0.047 / U:1.984 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site