pppd: convert to gentargets, properly add radius support, fix l2tp for 2.6.35 headers
authorGustavo Zacarias <gustavo@zacarias.com.ar>
Wed, 6 Oct 2010 17:34:47 +0000 (14:34 -0300)
committerPeter Korsgaard <jacmet@sunsite.dk>
Mon, 18 Oct 2010 09:30:31 +0000 (11:30 +0200)
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
CHANGES
package/pppd/Config.in
package/pppd/pppd-2.4.5-ol2tpv3-2.6.35.patch [new file with mode: 0644]
package/pppd/pppd.mk

diff --git a/CHANGES b/CHANGES
index 72b79131363d67a3f728b90816e6fa0f78859da6..6d982be2b271dcd0f0cd08924cb43862927bb5c6 100644 (file)
--- a/CHANGES
+++ b/CHANGES
        metacity, mtd-utils, mysql_client, nano, nbd, ncftp, neon,
        netperf, netsnmp, ng-spice-rework, ntfsprogs, ntp, openntpd,
        openssh, openssl, openvpn, oprofile, pango, patch, pcre, php,
-       pkg-config, prboom, radvd, rdesktop, ruby, qt, quagga, samba,
-       sawman, sdl_mixer, sdl_sound, setserial, shared-mime-info,
-       speex, sqlite, squashfs, startup-notification, strace,
-       sylpheed, taglib, tcpdump, thttpd, tiff, tn5250, torsmo, udev,
-       udpcast, usbmount, usbutils, vsftpd, vtun, which,
-       wpa_supplicant, xapp_twm, xapp_xbacklight, xapp_xcursorgen,
-       xapp_xinput, xapp_xmore,
+       pkg-config, pppd, prboom, radvd, rdesktop, ruby, qt, quagga,
+       samba, sawman, sdl_mixer, sdl_sound, setserial,
+       shared-mime-info, speex, sqlite, squashfs,
+       startup-notification, strace, sylpheed, taglib, tcpdump,
+       thttpd, tiff, tn5250, torsmo, udev, udpcast, usbmount,
+       usbutils, vsftpd, vtun, which, wpa_supplicant, xapp_twm,
+       xapp_xbacklight, xapp_xcursorgen, xapp_xinput, xapp_xmore,
        xdriver_xf86-input-{acecad,aiptek,evdev,joystick,keyboard},
        xdriver-xf86-input-{mouse,synaptics,vmmouse,void},
        xdriver-xf86-video-{apm,ark,ast,ati,chips,cirrus,dummy,fbdev},
index daca876139900295046af77657a1fcaa507ff25e..879b263cf3832d9ccb733d16cd907f2f35d81346 100644 (file)
@@ -13,3 +13,9 @@ config BR2_PACKAGE_PPPD_FILTER
          Packet filtering abilities for pppd. If enabled,
          the pppd active-filter and pass-filter options
          are available.
+
+config BR2_PACKAGE_PPPD_RADIUS
+       depends on BR2_PACKAGE_PPPD
+       bool "radius"
+       help
+         Install RADIUS support for pppd
diff --git a/package/pppd/pppd-2.4.5-ol2tpv3-2.6.35.patch b/package/pppd/pppd-2.4.5-ol2tpv3-2.6.35.patch
new file mode 100644 (file)
index 0000000..0e71e24
--- /dev/null
@@ -0,0 +1,24 @@
+--- ppp-2.4.5/include/linux/if_pppol2tp.h       2009-11-16 22:26:07.000000000 +0000
++++ ppp-2.4.5/include/linux/if_pppol2tp.h       2010-07-16 22:35:22.000000000 +0100
+@@ -32,6 +32,20 @@
+       __u16 d_tunnel, d_session;      /* For sending outgoing packets */
+ };
+
++/* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
++ * bits. So we need a different sockaddr structure.
++ */
++struct pppol2tpv3_addr {
++       pid_t   pid;                    /* pid that owns the fd.
++                                        * 0 => current */
++       int     fd;                     /* FD of UDP or IP socket to use */
++
++       struct sockaddr_in addr;        /* IP address and port to send to */
++
++       __u32 s_tunnel, s_session;      /* For matching incoming packets */
++       __u32 d_tunnel, d_session;      /* For sending outgoing packets */
++};
++
+ /* Socket options:
+  * DEBUG      - bitmask of debug message categories
+  * SENDSEQ    - 0 => don't send packets with sequence numbers
+
index 35fd451d767fcd3ea828b6cbd5346c9cfa5da1c1..05c1c32c9d656dd0fffad9e6c6222d5482fcb9af 100644 (file)
@@ -9,7 +9,10 @@ PPPD_SOURCE = ppp-$(PPPD_VERSION).tar.gz
 PPPD_SITE = ftp://ftp.samba.org/pub/ppp
 PPPD_TARGET_BINS = chat pppd pppdump pppstats
 PPPD_MANPAGES = $(if $(BR2_HAVE_DOCUMENTATION),chat pppd pppdump pppstats)
-PPPD_MAKE = $(MAKE) CC="$(TARGET_CC)" COPTS="$(TARGET_CFLAGS)" -C $(PPPD_DIR) $(PPPD_MAKE_OPT)
+PPPD_RADIUS_MANPAGES = $(if $(BR2_HAVE_DOCUMENTATION),pppd-radattr pppd-radius)
+PPPD_RADIUS_CONF = dictionary dictionary.ascend dictionary.compat \
+                       dictionary.merit dictionary.microsoft \
+                       issue port-id-map realms server radiusclient.conf
 
 ifeq ($(BR2_PACKAGE_PPPD_FILTER),y)
        PPPD_DEPENDENCIES += libpcap
@@ -20,15 +23,56 @@ ifeq ($(BR2_INET_IPV6),y)
        PPPD_MAKE_OPT += HAVE_INET6=y
 endif
 
-$(eval $(call AUTOTARGETS,package,pppd))
-
-$(PPPD_HOOK_POST_EXTRACT):
+define PPPD_CONFIGURE_CMDS
        $(SED) 's/FILTER=y/#FILTER=y/' $(PPPD_DIR)/pppd/Makefile.linux
        $(SED) 's/ifneq ($$(wildcard \/usr\/include\/pcap-bpf.h),)/ifdef FILTER/' $(PPPD_DIR)/*/Makefile.linux
-       touch $@
+       ( cd $(@D); ./configure )
+endef
+
+define PPPD_BUILD_CMDS
+       $(MAKE) CC="$(TARGET_CC)" COPTS="$(TARGET_CFLAGS)" \
+               -C $(@D) $(PPPD_MAKE_OPT)
+endef
+
+define PPPD_UNINSTALL_TARGET_CMDS
+       rm -f $(addprefix $(TARGET_DIR)/usr/sbin/, $(PPPD_TARGET_BINS))
+       rm -f $(TARGET_DIR)/usr/sbin/pppoe-discovery
+       rm -rf $(TARGET_DIR)/usr/lib/pppd
+       rm -rf $(TARGET_DIR)/etc/ppp/radius
+       for m in $(PPPD_MANPAGES); do \
+               rm -f $(TARGET_DIR)/usr/share/man/man8/$$m.8; \
+       done
+       for m in $(PPPD_RADIUS_MANPAGES); do \
+               rm -f $(TARGET_DIR)/usr/share/man/man8/$$m.8; \
+       done
+endef
+
+ifeq ($(BR2_PACKAGE_PPPD_RADIUS),y)
+define PPPD_INSTALL_RADIUS
+       $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/radius/radattr.so \
+               $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/radattr.so
+       $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/radius/radius.so \
+               $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/radius.so
+       $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/radius/radrealms.so \
+               $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/radrealms.so
+       for m in $(PPPD_RADIUS_CONF); do \
+               $(INSTALL) -m 644 -D $(PPPD_DIR)/pppd/plugins/radius/etc/$$m \
+                       $(TARGET_DIR)/etc/ppp/radius/$$m; \
+       done
+       $(SED) 's:/usr/local/etc:/etc:' \
+               $(TARGET_DIR)/etc/ppp/radius/radiusclient.conf
+       $(SED) 's:/usr/local/sbin:/usr/sbin:' \
+               $(TARGET_DIR)/etc/ppp/radius/radiusclient.conf
+       $(SED) 's:/etc/radiusclient:/etc/ppp/radius:g' \
+               $(TARGET_DIR)/etc/ppp/radius/*
+       for m in $(PPPD_RADIUS_MANPAGES); do \
+               $(INSTALL) -m 644 -D $(PPPD_DIR)/pppd/plugins/radius/$$m.8 \
+                       $(TARGET_DIR)/usr/share/man/man8/$$m.8; \
+       done
+endef
+endif
 
-$(PPPD_TARGET_INSTALL_TARGET):
-       $(call MESSAGE,"Installing to target")
+define PPPD_INSTALL_TARGET_CMDS
        for sbin in $(PPPD_TARGET_BINS); do \
                $(INSTALL) -D $(PPPD_DIR)/$$sbin/$$sbin \
                        $(TARGET_DIR)/usr/sbin/$$sbin; \
@@ -51,24 +95,11 @@ $(PPPD_TARGET_INSTALL_TARGET):
                $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/openl2tp.so
        $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/pppol2tp/pppol2tp.so \
                $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/pppol2tp.so
-       $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/radius/radattr.so \
-               $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/radattr.so
-       $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/radius/radius.so \
-               $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/radius.so
-       $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/radius/radrealms.so \
-               $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/radrealms.so
+       $(PPPD_INSTALL_RADIUS)
        for m in $(PPPD_MANPAGES); do \
                $(INSTALL) -m 644 -D $(PPPD_DIR)/$$m/$$m.8 \
                        $(TARGET_DIR)/usr/share/man/man8/$$m.8; \
        done
-       touch $@
+endef
 
-$(PPPD_TARGET_UNINSTALL):
-       $(call MESSAGE,"Uninstalling")
-       rm -f $(addprefix $(TARGET_DIR)/usr/sbin/, $(PPPD_TARGET_BINS))
-       rm -f $(TARGET_DIR)/usr/sbin/pppoe-discovery
-       for m in $(PPPD_MANPAGES); do \
-               rm -f $(TARGET_DIR)/usr/share/man/man8/$$m.8; \
-       done
-       rm -rf $(TARGET_DIR)/usr/lib/pppd
-       rm -f $(PPPD_TARGET_INSTALL_TARGET) $(PPPD_HOOK_POST_INSTALL)
+$(eval $(call GENTARGETS,package,pppd))