Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Oct 2004 00:24:15 +0400 (MSD)
From:      Oleg Sharoiko <os@rsu.ru>
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        archie@freebsd.org
Subject:   PPPoE issues with net/mpd
Message-ID:  <200410062024.i96KOF8u047357@brain.cc.rsu.ru>

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

>Submitter-Id:	current-users
>Originator:	Oleg Sharoiko
>Organization:	Computer Center of Rostov State university
>Confidential:	no 
>Synopsis:	PPPoE issues with net/mpd
>Severity:	serious
>Priority:	medium
>Category:	ports
>Class:		sw-bug
>Release:	FreeBSD 5.3-BETA6 i386
>Environment:
System: FreeBSD wolf.os.rsu.ru 5.3-BETA6 FreeBSD 5.3-BETA6 #1: Sat Oct 2 19:44:22 MSD 2004 os@wolf.os.rsu.ru:/usr/obj/usr/src/sys/wolf.os.i686.RELENG_5.2004-09-30 i386


	
>Description:

	mpd fails to establish pppoe connection.

	mpd.conf
	----------
pppoe-aaanet-orig:
        new -i ng0 pppoe-aaanet-orig pppoe-fxp0-orig
        set bundle authname "authname"
        set bundle password "password"
        set bundle enable compression

        set link keep-alive 15 30
        set link disable pap chap
        set link accept pap chap
        set link enable acfcomp protocomp
        set link enable no-orig-auth

        set ccp enable mppc mpp-compress mpp-e40 mpp-e56 mpp-e128
        set ecp enable des

        set ipcp enable vjcomp
        set ipcp no req-pri-dns req-sec-dns req-pri-nbns req-sec-nbns

        set iface route default

        open iface
	--------

	mpd.links
	--------
pppoe-fxp0-orig:
        set link type pppoe
        set pppoe iface fxp0
        set pppoe disable incoming
        set pppoe enable originate

	--------

	log
	--------
Oct  6 22:26:36 wolf mpd: mpd: pid 507, version 3.18 (root@wolf.os.rsu.ru 20:32  5-Oct-2004)
Oct  6 22:26:36 wolf mpd: [pppoe-aaanet-orig] ppp node is "mpd507-pppoe-aaanet-orig"
Oct  6 22:26:36 wolf mpd: [pppoe-aaanet-orig] using interface ng0
Oct  6 22:26:36 wolf mpd: [pppoe-aaanet-orig] IFACE: Open event
Oct  6 22:26:36 wolf mpd: [pppoe-aaanet-orig] IPCP: Open event
Oct  6 22:26:36 wolf mpd: [pppoe-aaanet-orig] IPCP: state change Initial --> Starting
Oct  6 22:26:36 wolf mpd: [pppoe-aaanet-orig] IPCP: LayerStart
Oct  6 22:26:36 wolf mpd: [pppoe-aaanet-orig] bundle: OPEN event in state CLOSED
Oct  6 22:26:36 wolf mpd: [pppoe-aaanet-orig] opening link "pppoe-fxp0-orig"...
Oct  6 22:26:36 wolf mpd: [pppoe-fxp0-orig] link: OPEN event
Oct  6 22:26:36 wolf mpd: [pppoe-fxp0-orig] LCP: Open event
Oct  6 22:26:36 wolf mpd: [pppoe-fxp0-orig] LCP: state change Initial --> Starting
Oct  6 22:26:36 wolf mpd: [pppoe-fxp0-orig] LCP: LayerStart
Oct  6 22:26:36 wolf mpd: [pppoe-fxp0-orig] device: OPEN event in state DOWN
Oct  6 22:26:36 wolf mpd: [pppoe-aaanet-orig] can't connect bypass,link0 and fxp0:orphans,mpd507-pppoe-fxp0-orig: No such file or directory
Oct  6 22:26:36 wolf mpd: [pppoe-aaanet-orig] can't remove hook mpd507-pppoe-fxp0-orig from node "fxp0:orphans": No such file or directory
Oct  6 22:26:36 wolf mpd: [pppoe-fxp0-orig] device is now in state OPENING
Oct  6 22:26:36 wolf mpd: [pppoe-fxp0-orig] device: DOWN event in state OPENING
Oct  6 22:26:36 wolf mpd: [pppoe-fxp0-orig] device is now in state DOWN
Oct  6 22:26:36 wolf mpd: [pppoe-fxp0-orig] link: DOWN event
Oct  6 22:26:36 wolf mpd: [pppoe-fxp0-orig] LCP: Down event
Oct  6 22:26:36 wolf mpd: [pppoe-fxp0-orig] device: OPEN event in state DOWN
Oct  6 22:26:36 wolf mpd: [pppoe-fxp0-orig] pausing 6 seconds before open
Oct  6 22:26:36 wolf mpd: [pppoe-fxp0-orig] device is now in state DOWN
	--------

	This looks very similar to ports/62477.
	If mpd started after ppp with pppoe setup then mpd works fine.
	Executing

        /sbin/ifconfig fxp0 up
        /usr/sbin/ngctl mkpeer fxp0: pppoe orphans ethernet

	before mpd also make mpd happy.

	It looks like
	1) mpd doesn't put interface into UP state and
	2) mpd fails to create netgraph hook

>How-To-Repeat:

	Reboot a system
	Run mpd with pppoe setup

>Fix:

	Workaround:

	Execute

        /sbin/ifconfig fxp0 up
        /usr/sbin/ngctl mkpeer fxp0: pppoe orphans ethernet

	before running mpd.

	The following startup script will help starting mpd in such a situations:

	---------
#!/bin/sh

# PROVIDE: mpd
# REQUIRE: netif isdnd
# KEYWORD: FreeBSD nojail shutdown

. /etc/rc.subr

name="mpd"
rcvar=`set_rcvar`

mpd_start_precmd()
{
	/sbin/ifconfig fxp0 up
	/usr/sbin/ngctl mkpeer fxp0: pppoe orphans ethernet || true
}

mpd_stop_postcmd()
{
	/usr/sbin/ngctl rmhook fxp0: orphans
}

load_rc_config $name

start_precmd="mpd_start_precmd"
stop_postcmd="mpd_stop_postcmd"

command=${mpd_program:-"/usr/local/sbin/mpd"}
pidfile=${mpd_pidfile:-"/var/run/mpd.pid"}
flags=${mpd_flags:-"-b -p ${pidfile} ${mpd_profile}"}

run_rc_command "$1"
	---------

	It would be nice to switch mpd to rcNG startup script. This one can be used after this issues have been resolved and workarounds (mpd_start_precmd/mpd_stop_precmd) removed.



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