Re: [Patch 3/3] net: reserve ports for applications using fixed port numbers

From: Tetsuo Handa
Date: Mon Apr 12 2010 - 03:07:49 EST


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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/