diff options
author | 1996-04-21 22:14:33 +0000 | |
---|---|---|
committer | 1996-04-21 22:14:33 +0000 | |
commit | d724e01ae4dac35949585b9083e28ff2ba35b0b5 (patch) | |
tree | 37282f1ae947a4e9508b73ff86cad13f75eb9860 /sys/netns | |
parent | no need to remove limits.h; another workaround exists (diff) | |
download | wireguard-openbsd-d724e01ae4dac35949585b9083e28ff2ba35b0b5.tar.xz wireguard-openbsd-d724e01ae4dac35949585b9083e28ff2ba35b0b5.zip |
partial sync with netbsd 960418, more to come
Diffstat (limited to 'sys/netns')
-rw-r--r-- | sys/netns/ns_pcb.c | 6 | ||||
-rw-r--r-- | sys/netns/ns_var.h | 4 | ||||
-rw-r--r-- | sys/netns/spp_usrreq.c | 22 |
3 files changed, 25 insertions, 7 deletions
diff --git a/sys/netns/ns_pcb.c b/sys/netns/ns_pcb.c index 261653881db..f2b0206ea4b 100644 --- a/sys/netns/ns_pcb.c +++ b/sys/netns/ns_pcb.c @@ -1,5 +1,5 @@ -/* $OpenBSD: ns_pcb.c,v 1.2 1996/03/04 08:20:29 niklas Exp $ */ -/* $NetBSD: ns_pcb.c,v 1.9 1996/02/13 22:14:02 christos Exp $ */ +/* $OpenBSD: ns_pcb.c,v 1.3 1996/04/21 22:30:11 deraadt Exp $ */ +/* $NetBSD: ns_pcb.c,v 1.10 1996/03/27 14:44:14 christos Exp $ */ /* * Copyright (c) 1984, 1985, 1986, 1987, 1993 @@ -312,7 +312,6 @@ ns_pcbnotify(dst, errno, notify, param) splx(s); } -#ifdef notdef /* * After a routing change, flush old routing * and allocate a (hopefully) better one. @@ -331,7 +330,6 @@ ns_rtchange(nsp) } /* SHOULD NOTIFY HIGHER-LEVEL PROTOCOLS */ } -#endif struct nspcb * ns_pcblookup(faddr, lport, wildp) diff --git a/sys/netns/ns_var.h b/sys/netns/ns_var.h index 7f9d4aa1ea6..dae424449a8 100644 --- a/sys/netns/ns_var.h +++ b/sys/netns/ns_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ns_var.h,v 1.1 1996/03/04 08:20:32 niklas Exp $ */ +/* $OpenBSD: ns_var.h,v 1.2 1996/04/21 22:30:13 deraadt Exp $ */ #ifdef _KERNEL struct socket; @@ -62,7 +62,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 diff --git a/sys/netns/spp_usrreq.c b/sys/netns/spp_usrreq.c index 1963c644fe3..6712001e042 100644 --- a/sys/netns/spp_usrreq.c +++ b/sys/netns/spp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spp_usrreq.c,v 1.2 1996/03/04 08:20:34 niklas Exp $ */ +/* $OpenBSD: spp_usrreq.c,v 1.3 1996/04/21 22:30:14 deraadt Exp $ */ /* $NetBSD: spp_usrreq.c,v 1.9 1996/02/13 22:14:13 christos Exp $ */ /* @@ -610,6 +610,7 @@ spp_ctlinput(cmd, sa, arg) return NULL; type = NS_ERR_UNREACH_HOST; + switch (cmd) { case PRC_ROUTEDEAD: @@ -624,12 +625,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: |