Fix(?) (I have no way to test this) netns crash when receiving PRC_REDIRECT's
I handled them in a similar way with other protocols, by calling: ns_pcbnotify(..., ns_rtchange, ...) I hope it works. Fixes PR/2266
This commit is contained in:
parent
6d6bb851ae
commit
4dd67bbcd4
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ns_pcb.c,v 1.9 1996/02/13 22:14:02 christos Exp $ */
|
||||
/* $NetBSD: ns_pcb.c,v 1.10 1996/03/27 14:44:14 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1984, 1985, 1986, 1987, 1993
|
||||
@ -311,7 +311,6 @@ ns_pcbnotify(dst, errno, notify, param)
|
||||
splx(s);
|
||||
}
|
||||
|
||||
#ifdef notdef
|
||||
/*
|
||||
* After a routing change, flush old routing
|
||||
* and allocate a (hopefully) better one.
|
||||
@ -330,7 +329,6 @@ ns_rtchange(nsp)
|
||||
}
|
||||
/* SHOULD NOTIFY HIGHER-LEVEL PROTOCOLS */
|
||||
}
|
||||
#endif
|
||||
|
||||
struct nspcb *
|
||||
ns_pcblookup(faddr, lport, wildp)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ns_var.h,v 1.2 1996/03/14 18:44:42 christos Exp $ */
|
||||
/* $NetBSD: ns_var.h,v 1.3 1996/03/27 14:44:16 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995 Christos Zoulas. All rights reserved.
|
||||
@ -92,7 +92,7 @@ void ns_pcbdetach __P((struct nspcb *));
|
||||
void ns_setsockaddr __P((struct nspcb *, struct mbuf *));
|
||||
void ns_setpeeraddr __P((struct nspcb *, struct mbuf *));
|
||||
void ns_pcbnotify __P((struct ns_addr *, int, void (*)(struct nspcb *), long));
|
||||
int ns_rtchange __P((struct nspcb *));
|
||||
void ns_rtchange __P((struct nspcb *));
|
||||
struct nspcb *ns_pcblookup __P((struct ns_addr *, u_short, int));
|
||||
|
||||
#endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: spp_usrreq.c,v 1.10 1996/02/18 05:43:03 christos Exp $ */
|
||||
/* $NetBSD: spp_usrreq.c,v 1.11 1996/03/27 14:44:17 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1984, 1985, 1986, 1987, 1993
|
||||
@ -609,6 +609,7 @@ spp_ctlinput(cmd, sa, arg)
|
||||
return NULL;
|
||||
type = NS_ERR_UNREACH_HOST;
|
||||
|
||||
|
||||
switch (cmd) {
|
||||
|
||||
case PRC_ROUTEDEAD:
|
||||
@ -623,12 +624,31 @@ spp_ctlinput(cmd, sa, arg)
|
||||
na = &sns->sns_addr;
|
||||
break;
|
||||
|
||||
case PRC_REDIRECT_NET:
|
||||
case PRC_REDIRECT_HOST:
|
||||
case PRC_REDIRECT_TOSNET:
|
||||
case PRC_REDIRECT_TOSHOST:
|
||||
/*
|
||||
* PRC_IS_REDIRECT: Call ns_rtchange to flush the route, so
|
||||
* that the next time we attempt output we try a new one
|
||||
* XXX: Is this the right way? ns_rtchange has a comment
|
||||
* that needs to be fixed.
|
||||
*/
|
||||
sns = (struct sockaddr_ns *) sa;
|
||||
if (sns->sns_family != AF_NS)
|
||||
return NULL;
|
||||
na = &sns->sns_addr;
|
||||
ns_pcbnotify(na, (int)nsctlerrmap[cmd], ns_rtchange, (long) 0);
|
||||
return NULL;
|
||||
|
||||
default:
|
||||
errp = arg;
|
||||
na = &errp->ns_err_idp.idp_dna;
|
||||
type = errp->ns_err_num;
|
||||
type = ntohs((u_short)type);
|
||||
break;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
|
||||
case NS_ERR_UNREACH_HOST:
|
||||
|
Loading…
x
Reference in New Issue
Block a user