Call in_pcballoc() at splnet(). As near as I can tell, this won't fix
any instability problems, but it was wrong nonetheless and will be required in an upcoming round of PCB changes.
This commit is contained in:
parent
5802420635
commit
86b3ebce35
@ -30,7 +30,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: ip_divert.c,v 1.14 1997/09/13 15:40:55 peter Exp $
|
* $Id: ip_divert.c,v 1.15 1997/09/14 03:10:39 peter Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -269,7 +269,7 @@ static int
|
|||||||
div_attach(struct socket *so, int proto, struct proc *p)
|
div_attach(struct socket *so, int proto, struct proc *p)
|
||||||
{
|
{
|
||||||
struct inpcb *inp;
|
struct inpcb *inp;
|
||||||
int error;
|
int error, s;
|
||||||
|
|
||||||
inp = sotoinpcb(so);
|
inp = sotoinpcb(so);
|
||||||
if (inp)
|
if (inp)
|
||||||
@ -277,8 +277,13 @@ div_attach(struct socket *so, int proto, struct proc *p)
|
|||||||
if (p && (error = suser(p->p_ucred, &p->p_acflag)) != 0)
|
if (p && (error = suser(p->p_ucred, &p->p_acflag)) != 0)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
if ((error = soreserve(so, div_sendspace, div_recvspace)) ||
|
s = splnet();
|
||||||
(error = in_pcballoc(so, &divcbinfo, p)))
|
error = in_pcballoc(so, &divcbinfo, p);
|
||||||
|
splx(s);
|
||||||
|
if (error)
|
||||||
|
return error;
|
||||||
|
error = soreserve(so, div_sendspace, div_recvspace);
|
||||||
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
inp = (struct inpcb *)so->so_pcb;
|
inp = (struct inpcb *)so->so_pcb;
|
||||||
inp->inp_ip_p = proto;
|
inp->inp_ip_p = proto;
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)raw_ip.c 8.7 (Berkeley) 5/15/95
|
* @(#)raw_ip.c 8.7 (Berkeley) 5/15/95
|
||||||
* $Id: raw_ip.c,v 1.48 1997/08/16 19:15:37 wollman Exp $
|
* $Id: raw_ip.c,v 1.49 1997/09/14 03:10:40 peter Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -391,7 +391,7 @@ static int
|
|||||||
rip_attach(struct socket *so, int proto, struct proc *p)
|
rip_attach(struct socket *so, int proto, struct proc *p)
|
||||||
{
|
{
|
||||||
struct inpcb *inp;
|
struct inpcb *inp;
|
||||||
int error;
|
int error, s;
|
||||||
|
|
||||||
inp = sotoinpcb(so);
|
inp = sotoinpcb(so);
|
||||||
if (inp)
|
if (inp)
|
||||||
@ -399,8 +399,13 @@ rip_attach(struct socket *so, int proto, struct proc *p)
|
|||||||
if (p && (error = suser(p->p_ucred, &p->p_acflag)) != 0)
|
if (p && (error = suser(p->p_ucred, &p->p_acflag)) != 0)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
if ((error = soreserve(so, rip_sendspace, rip_recvspace)) ||
|
s = splnet();
|
||||||
(error = in_pcballoc(so, &ripcbinfo, p)))
|
error = in_pcballoc(so, &ripcbinfo, p);
|
||||||
|
splx(s);
|
||||||
|
if (error)
|
||||||
|
return error;
|
||||||
|
error = soreserve(so, rip_sendspace, rip_recvspace);
|
||||||
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
inp = (struct inpcb *)so->so_pcb;
|
inp = (struct inpcb *)so->so_pcb;
|
||||||
inp->inp_ip_p = proto;
|
inp->inp_ip_p = proto;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user