Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Jan 2001 20:31:43 +0100
From:      Thomas Moestl <tmoestl@gmx.net>
To:        freebsd-isdn@freebsd.org
Subject:   [PATCH] fix for i4b ppp in -CURRENT
Message-ID:  <20010107203143.A2567@crow.dom2ip.de>

next in thread | raw e-mail | index | archive | help

--IJpNTDwzlM2Ie8A6
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi,

could someone please review and, if OK, commit this?

These patch should fix the SyncPPP breakage I have recently reported on
this list.
Basically, a commit about 6 weeks ago that introduced interface queue
locking (as part of the SMPng effort, AFAIK) got one occurrence of
IF_HANDOFF_ADJ wrong: it gave NULL as the interface, resulting in the
interface not being restarted (also, the byte counters would not be
updated). That caused PPP authentication packets not to be sent.

The second part of the patch moves the mutex initialisation from 
avma1pp_bchannel_setup to avma1pp_attach_avma1pp in the ifpi driver.
This prevents the mutexes to be initialized multiple times (because
avma1pp_bchannel_setup my be called more than once). It is possible
that this is also needed in other drivers. 
This multiple initialisation has not caused crashes for me, I noticed
it only by using the WITNESS option. However, it could lead to problems,
and it certainly is not good style.

The patch is attached.

The other patch was posted already. It corrects a small typo in isdnd
that broke the ppp-expect-password option (second attachment).

I have used both patches for some time, they seem stable to me, however
YMMV.

Please let me know if I should file a PR with that patches, or post this 
somewhere else, too.

	- thomas

--IJpNTDwzlM2Ie8A6
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="isdn-kernel.diff"

*** i4b/driver/i4b_ispppsubr.c.orig	Sun Jan  7 18:20:54 2001
--- i4b/driver/i4b_ispppsubr.c	Sun Jan  7 18:20:07 2001
***************
*** 4012,4018 ****
  		sppp_print_bytes((u_char*) (lh+1), len);
  		log(-1, ">\n");
  	}
! 	if (! IF_HANDOFF_ADJ(&sp->pp_cpq, m, NULL, 3))
  		++ifp->if_oerrors;
  }
  
--- 4012,4018 ----
  		sppp_print_bytes((u_char*) (lh+1), len);
  		log(-1, ">\n");
  	}
! 	if (! IF_HANDOFF_ADJ(&sp->pp_cpq, m, ifp, 3))
  		++ifp->if_oerrors;
  }
  
*** i4b/layer1/ifpi/i4b_ifpi_pci.c.orig	Sun Jan  7 18:21:57 2001
--- i4b/layer1/ifpi/i4b_ifpi_pci.c	Sun Jan  7 17:36:14 2001
***************
*** 495,500 ****
--- 495,501 ----
  	void *ih = 0;
  	bus_space_handle_t bhandle;
  	bus_space_tag_t btag; 
+ 	l1_bchan_state_t *chan;
  
  	s = splimp();
  
***************
*** 647,652 ****
--- 648,661 ----
  	/* init the ISAC */
  	ifpi_isac_init(sc);
  
+ 	/* Init the channel mutexes */
+ 	chan = &sc->sc_chan[HSCX_CH_A];
+ 	mtx_init(&chan->rx_queue.ifq_mtx, "i4b_avma1pp_rx", MTX_DEF);
+ 	mtx_init(&chan->tx_queue.ifq_mtx, "i4b_avma1pp_tx", MTX_DEF);
+ 	chan = &sc->sc_chan[HSCX_CH_B];
+ 	mtx_init(&chan->rx_queue.ifq_mtx, "i4b_avma1pp_rx", MTX_DEF);
+ 	mtx_init(&chan->tx_queue.ifq_mtx, "i4b_avma1pp_tx", MTX_DEF);
+ 
  	/* init the "HSCX" */
  	avma1pp_bchannel_setup(sc->sc_unit, HSCX_CH_A, BPROT_NONE, 0);
  	
***************
*** 1118,1124 ****
  	/* receiver part */
  
  	chan->rx_queue.ifq_maxlen = IFQ_MAXLEN;
- 	mtx_init(&chan->rx_queue.ifq_mtx, "i4b_avma1pp_rx", MTX_DEF);
  
  	i4b_Bcleanifq(&chan->rx_queue);	/* clean rx queue */
  
--- 1127,1132 ----
***************
*** 1133,1139 ****
  	/* transmitter part */
  
  	chan->tx_queue.ifq_maxlen = IFQ_MAXLEN;
- 	mtx_init(&chan->tx_queue.ifq_mtx, "i4b_avma1pp_tx", MTX_DEF);
  	
  	i4b_Bcleanifq(&chan->tx_queue);	/* clean tx queue */
  
--- 1141,1146 ----

--IJpNTDwzlM2Ie8A6
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="isdnd.diff"

*** src/usr.sbin/i4b/isdnd/rc_scan.l~	Mon Oct  9 16:22:39 2000
--- src/usr.sbin/i4b/isdnd/rc_scan.l	Thu Jan  4 00:29:44 2001
***************
*** 149,155 ****
  ppp-auth-paranoid		{ return PPP_AUTH_PARANOID; }
  ppp-expect-auth			{ return PPP_EXPECT_AUTH; }
  ppp-expect-name			{ return PPP_EXPECT_NAME; }
! ppp-expect-password		{ return PPP_EXPECT_NAME; }
  ppp-send-auth			{ return PPP_SEND_AUTH; }
  ppp-send-name			{ return PPP_SEND_NAME; }
  ppp-send-password		{ return PPP_SEND_PASSWORD; }
--- 149,155 ----
  ppp-auth-paranoid		{ return PPP_AUTH_PARANOID; }
  ppp-expect-auth			{ return PPP_EXPECT_AUTH; }
  ppp-expect-name			{ return PPP_EXPECT_NAME; }
! ppp-expect-password		{ return PPP_EXPECT_PASSWORD; }
  ppp-send-auth			{ return PPP_SEND_AUTH; }
  ppp-send-name			{ return PPP_SEND_NAME; }
  ppp-send-password		{ return PPP_SEND_PASSWORD; }

--IJpNTDwzlM2Ie8A6--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isdn" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010107203143.A2567>