gui/Makefile.in | 4 +++- gui/tkpppoe.in | 2 +- man/pppoe.conf.5 | 12 ++++++++---- scripts/pppoe-connect.in | 18 ++++++++---------- scripts/pppoe-init.in | 2 +- scripts/pppoe-stop.in | 4 ++++ src/configure.in | 14 +++++++------- 7 files changed, 32 insertions(+), 24 deletions(-) diff --git a/gui/Makefile.in b/gui/Makefile.in index c927902..78d5446 100644 --- a/gui/Makefile.in +++ b/gui/Makefile.in @@ -23,6 +23,7 @@ install_dir=@INSTALL@ -d sbindir=@sbindir@ bindir=@bindir@ datadir=@datadir@ +docdir=/usr/share/doc PPPOE_START_PATH=@sbindir@/pppoe-start PPPOE_STOP_PATH=@sbindir@/pppoe-stop @@ -45,6 +46,7 @@ wrapper.o: wrapper.c install: all -mkdir -p $(DESTDIR)$(sbindir) -mkdir -p $(DESTDIR)$(bindir) + -mkdir -p $(DESTDIR)$(docdir)/tkpppoe -mkdir -p $(DESTDIR)/etc/ppp/rp-pppoe-gui $(install) -m 4755 -s pppoe-wrapper $(DESTDIR)$(sbindir) $(install) -m 755 tkpppoe $(DESTDIR)$(bindir) @@ -53,7 +55,7 @@ install: all $(install) -m 644 tkpppoe.1 $(DESTDIR)$(mandir)/man1 -mkdir -p $(DESTDIR)$(datadir)/tkpppoe for i in tkpppoe.html mainwin-busy.png mainwin-nonroot.png mainwin.png props-advanced.png props-basic.png props-nic.png props-options.png; do \ - $(install) -m 644 html/$$i $(DESTDIR)$(datadir)/tkpppoe; \ + $(install) -m 644 html/$$i $(DESTDIR)$(docdir)/tkpppoe; \ done for i in en.msg ja.msg; do \ $(install) -m 644 $$i $(DESTDIR)$(datadir)/tkpppoe; \ diff --git a/gui/tkpppoe.in b/gui/tkpppoe.in index 148c8c8..7280260 100755 --- a/gui/tkpppoe.in +++ b/gui/tkpppoe.in @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/wish # -*-Mode: TCL;-*- # LIC: GPL diff --git a/man/pppoe.conf.5 b/man/pppoe.conf.5 index 58f77ca..b6f25b1 100644 --- a/man/pppoe.conf.5 +++ b/man/pppoe.conf.5 @@ -44,10 +44,9 @@ up all the time rather than being activated on demand. .B DNSTYPE One of \fBNOCHANGE\fR, \fBSPECIFY\fR or \fBSERVER\fR. If set to NOCHANGE, \fBpppoe-connect\fR will not adjust the DNS setup in -any way. If set to SPECIFY, it will re-write /etc/resolv.conf with -the values of DNS1 and DNS2. If set to \fBSERVER\fR, it will -supply the \fIusepeerdns\fR option to \fBpppd\fR, and make a symlink -from /etc/resolv.conf to /etc/ppp/resolv.conf. +any way. If set to SPECIFY, it will use \fBresolvconf\fR for adding +values of DNS1 and DNS2 to /etc/resolv.conf. If set to \fBSERVER\fR, it will +supply the \fIusepeerdns\fR option to \fBpppd\fR. .TP .B DNS1, DNS2 @@ -156,6 +155,11 @@ This code is experimental and unsupported. Use of the plugin causes \fBpppoe-connect\fR to ignore CLAMPMSS, PPPOE_EXTRA, SYNCHRONOUS and PPPOE_TIMEOUT. +.TP +.B RESOLVCONF_NAME +Name for \fBresolvconf\fR entry. When used DNSTYPE=SPECIFY this name passed to +\fBresolvconf\fR with -a option. + .P By using different configuration files with different PIDFILE settings, you can manage multiple PPPoE connections. Just specify the diff --git a/scripts/pppoe-connect.in b/scripts/pppoe-connect.in index 635cffe..d0c1a72 100755 --- a/scripts/pppoe-connect.in +++ b/scripts/pppoe-connect.in @@ -33,6 +33,7 @@ PPPD=@PPPD@ SETSID=@SETSID@ PPPOE=@sbindir@/pppoe LOGGER="/usr/bin/logger -t `basename $0`" +RESOLVCONF=/sbin/resolvconf # Set to "C" locale so we can parse messages from commands LANG=C @@ -214,16 +215,13 @@ fi PPP_STD_OPTIONS="$PLUGIN_OPTS noipdefault noauth default-asyncmap $DEFAULTROUTE hide-password nodetach $PEERDNS mtu 1492 mru 1492 noaccomp nodeflate nopcomp novj novjccomp user $USER lcp-echo-interval $LCP_INTERVAL lcp-echo-failure $LCP_FAILURE $PPPD_EXTRA" # Jigger DNS if required... -if test "$DNSTYPE" = "SERVER" ; then - # Sorry, dude... - rm -f /etc/resolv.conf - ln -s /etc/ppp/resolv.conf /etc/resolv.conf -elif test "$DNSTYPE" = "SPECIFY" ; then - # Sorry, dude... - rm -f /etc/resolv.conf - echo "nameserver $DNS1" > /etc/resolv.conf - if test -n "$DNS2" ; then - echo "nameserver $DNS2" >> /etc/resolv.conf +if test "$DNSTYPE" = "SPECIFY" ; then + dns_pppoe= + for i in $DNS1 $DNS2; do + dns_pppoe="${dns_pppoe}nameserver $i\n" + done + if test -n "$dns_pppoe" -a -x "$RESOLVCONF"; then + echo -ne "$dns_pppoe" | "$RESOLVCONF" -a "${RESOLVCONF_NAME:-pppoe}" fi fi diff --git a/scripts/pppoe-init.in b/scripts/pppoe-init.in index 26dbe0b..c4755f1 100755 --- a/scripts/pppoe-init.in +++ b/scripts/pppoe-init.in @@ -2,7 +2,7 @@ # # pppoe This script starts or stops a PPPoE connection # -# chkconfig: 2345 99 01 +# chkconfig: 2345 15 85 # description: Connects to PPPoE provider # # LIC: GPL diff --git a/scripts/pppoe-stop.in b/scripts/pppoe-stop.in index 1ba8756..05b1bf8 100755 --- a/scripts/pppoe-stop.in +++ b/scripts/pppoe-stop.in @@ -26,6 +26,7 @@ export LANG ME="`basename $0`" LOGGER="/usr/bin/logger -t $ME" +RESOLVCONF=/sbin/resolvconf CONFIG="$1" if [ "$CONFIG" = "" ] ; then CONFIG=/etc/ppp/pppoe.conf @@ -81,6 +82,9 @@ if [ -r "$PIDFILE" ] ; then echo "Killing pppoe-connect ($PID)" kill -9 $PID > /dev/null 2>&1 + # Remove resolvconf entry + [ -x "$RESOLVCONF" ] && "$RESOLVCONF" -fd "${RESOLVCONF_NAME:-pppoe}" + # Kill pppd again, in case it's still hanging around if [ -r "$PPPD_PIDFILE" ] ; then PPPD_PID=`cat "$PPPD_PIDFILE"` diff --git a/src/configure.in b/src/configure.in index bf20d6f..e8cf45f 100644 --- a/src/configure.in +++ b/src/configure.in @@ -11,7 +11,7 @@ AC_PREFIX_DEFAULT(/usr) dnl Checks for programs. AC_PROG_CC -AC_PROG_RANLIB +AC_PROG_LIBTOOL dnl Checks for libraries. @@ -45,7 +45,7 @@ ac_cv_struct_sockaddr_ll=no) AC_MSG_RESULT($ac_cv_struct_sockaddr_ll) if test "$ac_cv_struct_sockaddr_ll" = yes ; then -AC_DEFINE(HAVE_STRUCT_SOCKADDR_LL) +AC_DEFINE(HAVE_STRUCT_SOCKADDR_LL, 1, [struct sockaddr_ll]) fi dnl Check for N_HDLC line discipline @@ -56,7 +56,7 @@ AC_TRY_COMPILE([#include ], ac_cv_n_hdlc=no) AC_MSG_RESULT($ac_cv_n_hdlc) if test "$ac_cv_n_hdlc" = yes ; then -AC_DEFINE(HAVE_N_HDLC) +AC_DEFINE(HAVE_N_HDLC, 1, [Define if you have the N_HDLC line discipline in linux/termios.h]) fi AC_ARG_ENABLE(plugin, [ --enable-plugin=pppd_src_path build pppd plugin], ac_cv_pluginpath=$enableval, ac_cv_pluginpath=no) @@ -104,7 +104,7 @@ PPPD_INCDIR="" if test "$ac_cv_header_linux_if_pppox_h" = yes ; then if test "$ac_cv_pluginpath" != no ; then LINUX_KERNELMODE_PLUGIN=rp-pppoe.so - AC_DEFINE(HAVE_LINUX_KERNEL_PPPOE) + AC_DEFINE(HAVE_LINUX_KERNEL_PPPOE, 1, [Define if you have kernel-mode PPPoE in Linux file.]) PPPD_INCDIR=$ac_cv_pluginpath fi fi @@ -114,7 +114,7 @@ if test "$PPPD_INCDIR" = "" ; then fi if test "$ac_cv_debugging" = "yes" ; then - AC_DEFINE(DEBUGGING_ENABLED) + AC_DEFINE(DEBUGGING_ENABLED, 1, [Define to include debugging code]) fi AC_SUBST(LINUX_KERNELMODE_PLUGIN) @@ -190,7 +190,7 @@ fi dnl GCC warning level if test "$GCC" = yes; then - CFLAGS="$CFLAGS -Wall -Wstrict-prototypes" + CFLAGS="$CFLAGS -Wall -Wstrict-prototypes -fno-strict-aliasing" fi dnl If we couldn't find pppd, die @@ -258,7 +258,7 @@ $ECHO "no defaults for cross-compiling"; exit 0) if test "$rpppoe_cv_pack_bitfields" = "rev" ; then AC_MSG_RESULT(reversed) - AC_DEFINE(PACK_BITFIELDS_REVERSED) + AC_DEFINE(PACK_BITFIELDS_REVERSED, 1, [Define for reversed bitfields]) else AC_MSG_RESULT(normal) fi