Messages in this thread | | | Subject | Re: [Patch 3/3] net: reserve ports for applications using fixed port numbers | From | Tetsuo Handa <> | Date | Mon, 12 Apr 2010 16:06:54 +0900 |
| |
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.
| |