From: mickey Date: Mon, 23 Dec 1996 08:47:03 +0000 (+0000) Subject: no panic on ppp down/retry X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b4926b7f2758c1cebd7accf4f7c103da09448023;p=openbsd no panic on ppp down/retry --- diff --git a/sys/netipx/ipx.h b/sys/netipx/ipx.h index 0ee082d6d21..233e6a24654 100644 --- a/sys/netipx/ipx.h +++ b/sys/netipx/ipx.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ipx.h,v 1.4 1996/11/25 08:19:58 mickey Exp $ */ +/* $OpenBSD: ipx.h,v 1.5 1996/12/23 08:47:03 mickey Exp $ */ /*- * @@ -79,29 +79,29 @@ /* flags passed to ipx_outputfl as last parameter */ -#define IPX_FORWARDING 0x1 /* most of ipx header exists */ -#define IPX_ROUTETOIF 0x10 /* same as SO_DONTROUTE */ -#define IPX_ALLOWBROADCAST SO_BROADCAST /* can send broadcast packets */ +#define IPX_FORWARDING 0x1 /* most of ipx header exists */ +#define IPX_ROUTETOIF 0x10 /* same as SO_DONTROUTE */ +#define IPX_ALLOWBROADCAST SO_BROADCAST /* can send broadcast packets */ #define IPX_MAXHOPS 15 /* flags passed to get/set socket option */ -#define SO_HEADERS_ON_INPUT 1 -#define SO_HEADERS_ON_OUTPUT 2 -#define SO_DEFAULT_HEADERS 3 -#define SO_LAST_HEADER 4 -#define SO_IPXIP_ROUTE 5 -#define SO_SEQNO 6 -#define SO_ALL_PACKETS 7 +#define SO_HEADERS_ON_INPUT 1 +#define SO_HEADERS_ON_OUTPUT 2 +#define SO_DEFAULT_HEADERS 3 +#define SO_LAST_HEADER 4 +#define SO_IPXIP_ROUTE 5 +#define SO_SEQNO 6 +#define SO_ALL_PACKETS 7 #define SO_MTU 8 #define SO_IPXTUN_ROUTE 9 /* * IPX addressing */ -#define IPX_HOSTADDRLEN 6 -#define IPX_NETADDRLEN 4 -#define XXX __attribute__((packed)) +#define IPX_HOSTADDRLEN 6 +#define IPX_NETADDRLEN 4 +#define XXX __attribute__((packed)) typedef union ipx_host { diff --git a/sys/netipx/ipx_input.c b/sys/netipx/ipx_input.c index d45d8727d61..8639feb4170 100644 --- a/sys/netipx/ipx_input.c +++ b/sys/netipx/ipx_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipx_input.c,v 1.3 1996/10/26 09:34:51 mickey Exp $ */ +/* $OpenBSD: ipx_input.c,v 1.4 1996/12/23 08:47:04 mickey Exp $ */ /*- * @@ -342,7 +342,7 @@ ipx_ctlinput(cmd, arg_as_sa, dummy) case PRC_HOSTDEAD: case PRC_HOSTUNREACH: sipx = (struct sockaddr_ipx *)arg; - if (sipx->sipx_family != AF_IPX) + if (sipx == NULL || sipx->sipx_family != AF_IPX) return NULL; ipx = &sipx->sipx_addr; break; diff --git a/sys/netipx/ipx_usrreq.c b/sys/netipx/ipx_usrreq.c index ad39a273dfe..027e80cd706 100644 --- a/sys/netipx/ipx_usrreq.c +++ b/sys/netipx/ipx_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipx_usrreq.c,v 1.3 1996/11/25 08:20:01 mickey Exp $ */ +/* $OpenBSD: ipx_usrreq.c,v 1.4 1996/12/23 08:47:04 mickey Exp $ */ /*- * @@ -125,8 +125,8 @@ ipx_input(m, va_alist) m->m_pkthdr.len -= sizeof (struct ipx); m->m_data += sizeof (struct ipx); } - if (sbappendaddr(&ipxp->ipxp_socket->so_rcv, (struct sockaddr *)&ipx_ipx, - m, (struct mbuf *)0) == 0) + if (sbappendaddr(&ipxp->ipxp_socket->so_rcv, sipxtosa(&ipx_ipx), m, + (struct mbuf *)0) == 0) goto bad; sorwakeup(ipxp->ipxp_socket); return; diff --git a/sys/netipx/spx_usrreq.c b/sys/netipx/spx_usrreq.c index 48e2fe6631a..440beca66ad 100644 --- a/sys/netipx/spx_usrreq.c +++ b/sys/netipx/spx_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spx_usrreq.c,v 1.4 1996/11/25 08:20:03 mickey Exp $ */ +/* $OpenBSD: spx_usrreq.c,v 1.5 1996/12/23 08:47:05 mickey Exp $ */ /*- * @@ -633,7 +633,7 @@ spx_ctlinput(cmd, arg_as_sa, dummy) case PRC_HOSTDEAD: case PRC_HOSTUNREACH: sipx = (struct sockaddr_ipx *)arg; - if (sipx->sipx_family != AF_IPX) + if (sipx == NULL || sipx->sipx_family != AF_IPX) return NULL; na = &sipx->sipx_addr; break; diff --git a/sys/netns/idp_usrreq.c b/sys/netns/idp_usrreq.c index c047fdb02f4..98ac9d0616c 100644 --- a/sys/netns/idp_usrreq.c +++ b/sys/netns/idp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: idp_usrreq.c,v 1.2 1996/03/04 08:20:20 niklas Exp $ */ +/* $OpenBSD: idp_usrreq.c,v 1.3 1996/12/23 08:47:06 mickey Exp $ */ /* $NetBSD: idp_usrreq.c,v 1.9 1996/02/13 22:13:43 christos Exp $ */ /* @@ -58,12 +58,11 @@ #include #include + /* * IDP protocol implementation. */ -struct sockaddr_ns idp_ns = { sizeof(idp_ns), AF_NS }; - /* * This may also be called for raw listeners. */ @@ -79,13 +78,14 @@ idp_input(m, va_alist) register struct nspcb *nsp; register struct idp *idp = mtod(m, struct idp *); struct ifnet *ifp = m->m_pkthdr.rcvif; + struct sockaddr_ns idp_ns = { sizeof(idp_ns), AF_NS }; va_list ap; va_start(ap, m); nsp = va_arg(ap, struct nspcb *); va_end(ap); - if (nsp==0) + if (nsp == NULL) panic("No nspcb"); /* * Construct sockaddr format source address. diff --git a/sys/netns/ns_input.c b/sys/netns/ns_input.c index af48cbf7df7..f266f24190c 100644 --- a/sys/netns/ns_input.c +++ b/sys/netns/ns_input.c @@ -1,4 +1,5 @@ -/* $OpenBSD: ns_input.c,v 1.2 1996/03/04 08:20:26 niklas Exp $ */ + +/* $OpenBSD: ns_input.c,v 1.3 1996/12/23 08:47:07 mickey Exp $ */ /* $NetBSD: ns_input.c,v 1.9 1996/02/13 22:13:56 christos Exp $ */ /* @@ -277,7 +278,7 @@ idp_ctlinput(cmd, sa, arg) case PRC_HOSTDEAD: case PRC_HOSTUNREACH: sns = arg; - if (sns->sns_family != AF_NS) + if (arg == NULL || sns->sns_family != AF_NS) return NULL; ns = &sns->sns_addr; break; diff --git a/sys/netns/spp_usrreq.c b/sys/netns/spp_usrreq.c index 6712001e042..14558c39a35 100644 --- a/sys/netns/spp_usrreq.c +++ b/sys/netns/spp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spp_usrreq.c,v 1.3 1996/04/21 22:30:14 deraadt Exp $ */ +/* $OpenBSD: spp_usrreq.c,v 1.4 1996/12/23 08:47:07 mickey Exp $ */ /* $NetBSD: spp_usrreq.c,v 1.9 1996/02/13 22:14:13 christos Exp $ */ /* @@ -620,7 +620,7 @@ spp_ctlinput(cmd, sa, arg) case PRC_HOSTDEAD: case PRC_HOSTUNREACH: sns = arg; - if (sns->sns_family != AF_NS) + if (sns == NULL || sns->sns_family != AF_NS) return NULL; na = &sns->sns_addr; break;