Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/net Revert previous commit because of mistake of commit log
details: https://anonhg.NetBSD.org/src/rev/99b32453d1bb
branches: trunk
changeset: 379094:99b32453d1bb
user: yamaguchi <yamaguchi%NetBSD.org@localhost>
date: Tue May 11 01:15:11 2021 +0000
description:
Revert previous commit because of mistake of commit log
back to r1.230(if_spppsubr.c) and r1.31(if_sppp.h)
diffstat:
sys/net/if_sppp.h | 12 +----------
sys/net/if_spppsubr.c | 52 +++++++-------------------------------------------
2 files changed, 9 insertions(+), 55 deletions(-)
diffs (175 lines):
diff -r 73c11a2125a4 -r 99b32453d1bb sys/net/if_sppp.h
--- a/sys/net/if_sppp.h Tue May 11 01:00:49 2021 +0000
+++ b/sys/net/if_sppp.h Tue May 11 01:15:11 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_sppp.h,v 1.32 2021/05/11 01:00:49 yamaguchi Exp $ */
+/* $NetBSD: if_sppp.h,v 1.33 2021/05/11 01:15:11 yamaguchi Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -233,15 +233,5 @@ struct spppipv6cpstatus {
#define SPPPGETIPV6CPSTATUS _IOWR('i', 137, struct spppipv6cpstatus)
-#define SPPP_NCP_IPCP __BIT(0)
-#define SPPP_NCP_IPV6CP __BIT(1)
-struct spppncpcfg {
- char ifname[IFNAMSIZ];
- u_int ncp_flags;
-};
-
-#define SPPPGETNCPCFG _IOWR('i', 138, struct spppncpcfg)
-#define SPPPSETNCPCFG _IOW('i', 139, struct spppncpcfg)
-
#endif /* !_NET_IF_SPPP_H_ */
diff -r 73c11a2125a4 -r 99b32453d1bb sys/net/if_spppsubr.c
--- a/sys/net/if_spppsubr.c Tue May 11 01:00:49 2021 +0000
+++ b/sys/net/if_spppsubr.c Tue May 11 01:15:11 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_spppsubr.c,v 1.231 2021/05/11 01:00:49 yamaguchi Exp $ */
+/* $NetBSD: if_spppsubr.c,v 1.232 2021/05/11 01:15:11 yamaguchi Exp $ */
/*
* Synchronous PPP/Cisco link level subroutines.
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.231 2021/05/11 01:00:49 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.232 2021/05/11 01:15:11 yamaguchi Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@@ -585,7 +585,11 @@ sppp_input(struct ifnet *ifp, struct mbu
log(LOG_DEBUG,
"%s: input packet is too small, %d bytes\n",
ifp->if_xname, m->m_pkthdr.len);
- goto drop;
+ drop:
+ if_statadd2(ifp, if_ierrors, 1, if_iqdrops, 1);
+ m_freem(m);
+ SPPP_UNLOCK(sp);
+ return;
}
if (sp->pp_flags & PP_NOFRAMING) {
@@ -659,7 +663,7 @@ sppp_input(struct ifnet *ifp, struct mbu
}
switch (protocol) {
- reject_protocol:
+ default:
if (sp->scp[IDX_LCP].state == STATE_OPENED) {
uint16_t prot = htons(protocol);
@@ -675,8 +679,6 @@ sppp_input(struct ifnet *ifp, struct mbu
"<proto=0x%x>\n", ifp->if_xname, ntohs(protocol));
if_statinc(ifp, if_noproto);
goto drop;
- default:
- goto reject_protocol;
case PPP_LCP:
SPPP_UNLOCK(sp);
sppp_cp_input(&lcp, sp, m);
@@ -698,8 +700,6 @@ sppp_input(struct ifnet *ifp, struct mbu
return;
#ifdef INET
case PPP_IPCP:
- if (!ISSET(sp->pp_ncpflags, SPPP_NCP_IPCP))
- goto reject_protocol;
SPPP_UNLOCK(sp);
if (sp->pp_phase == SPPP_PHASE_NETWORK) {
sppp_cp_input(&ipcp, sp, m);
@@ -717,8 +717,6 @@ sppp_input(struct ifnet *ifp, struct mbu
#endif
#ifdef INET6
case PPP_IPV6CP:
- if (!ISSET(sp->pp_ncpflags, SPPP_NCP_IPV6CP))
- goto reject_protocol;
SPPP_UNLOCK(sp);
if (sp->pp_phase == SPPP_PHASE_NETWORK) {
sppp_cp_input(&ipv6cp, sp, m);
@@ -768,13 +766,6 @@ queue_pkt:
IF_ENQUEUE(inq, m);
IFQ_UNLOCK(inq);
schednetisr(isr);
- return;
-
-drop:
- if_statadd2(ifp, if_ierrors, 1, if_iqdrops, 1);
- m_freem(m);
- SPPP_UNLOCK(sp);
- return;
}
/*
@@ -1038,7 +1029,6 @@ sppp_attach(struct ifnet *ifp)
sp->pp_phase = SPPP_PHASE_DEAD;
sp->pp_up = sppp_notify_up;
sp->pp_down = sppp_notify_down;
- sp->pp_ncpflags = SPPP_NCP_IPCP | SPPP_NCP_IPV6CP;
sppp_wq_set(&sp->work_ifdown, sppp_ifdown, NULL);
memset(sp->scp, 0, sizeof(sp->scp));
rw_init(&sp->pp_lock);
@@ -1275,7 +1265,6 @@ sppp_ioctl(struct ifnet *ifp, u_long cmd
case SPPPSETAUTHCFG:
case SPPPSETLCPCFG:
- case SPPPSETNCPCFG:
case SPPPSETIDLETO:
case SPPPSETAUTHFAILURE:
case SPPPSETDNSOPTS:
@@ -1295,7 +1284,6 @@ sppp_ioctl(struct ifnet *ifp, u_long cmd
case SPPPGETAUTHCFG:
case SPPPGETLCPCFG:
- case SPPPGETNCPCFG:
case SPPPGETAUTHFAILURES:
error = kauth_authorize_network(l->l_cred,
KAUTH_NETWORK_INTERFACE,
@@ -3503,9 +3491,6 @@ sppp_ipcp_open(struct sppp *sp, void *xc
KASSERT(SPPP_WLOCKED(sp));
KASSERT(!cpu_softintr_p());
- if (!ISSET(sp->pp_ncpflags, SPPP_NCP_IPCP))
- return;
-
sp->ipcp.flags &= ~(IPCP_HISADDR_SEEN|IPCP_MYADDR_SEEN|IPCP_MYADDR_DYN|IPCP_HISADDR_DYN);
sp->ipcp.req_myaddr = 0;
sp->ipcp.req_hisaddr = 0;
@@ -4080,9 +4065,6 @@ sppp_ipv6cp_open(struct sppp *sp, void *
KASSERT(SPPP_WLOCKED(sp));
KASSERT(!cpu_softintr_p());
- if (!ISSET(sp->pp_ncpflags, SPPP_NCP_IPV6CP))
- return;
-
#ifdef IPV6CP_MYIFID_DYN
sp->ipv6cp.flags &= ~(IPV6CP_MYIFID_SEEN|IPV6CP_MYIFID_DYN);
#else
@@ -6131,24 +6113,6 @@ sppp_params(struct sppp *sp, u_long cmd,
SPPP_UNLOCK(sp);
}
break;
- case SPPPGETNCPCFG:
- {
- struct spppncpcfg *ncpp = (struct spppncpcfg *) data;
-
- SPPP_LOCK(sp, RW_READER);
- ncpp->ncp_flags = sp->pp_ncpflags;
- SPPP_UNLOCK(sp);
- }
- break;
- case SPPPSETNCPCFG:
- {
- struct spppncpcfg *ncpp = (struct spppncpcfg *) data;
-
- SPPP_LOCK(sp, RW_WRITER);
- sp->pp_ncpflags = ncpp->ncp_flags;
- SPPP_UNLOCK(sp);
- }
- break;
case SPPPGETSTATUS:
{
struct spppstatus *status = (struct spppstatus *)data;
Home |
Main Index |
Thread Index |
Old Index