]> git.ozlabs.org Git - ppp.git/commitdiff
Merge pull request #328 from pali/ipv6
authorPaul Mackerras <paulus@ozlabs.org>
Wed, 12 Jan 2022 09:41:33 +0000 (20:41 +1100)
committerGitHub <noreply@github.com>
Wed, 12 Jan 2022 09:41:33 +0000 (20:41 +1100)
ipv6cp: Add support for new ipv6cp-noremote, ipv6cp-nosend and ipv6cp-use-remotenumber options

.github/workflows/buildroot.yaml
pppd/plugins/pppoe/pppoe-discovery.8
pppd/plugins/pppoe/pppoe-discovery.c

index 3429d1764e28056c269be55898f85a48256f2718..a131f94b5e176ac3a9eb7f5d3e49096ad750bf03 100644 (file)
@@ -3,70 +3,29 @@ on: [push, pull_request]
 
 jobs:
   buildroot:
-    runs-on: ubuntu-latest
+    name: Buildroot
+    runs-on: ubuntu-20.04
     strategy:
       matrix:
         defconfig_name: [qemu_x86_defconfig, qemu_x86_64_defconfig, raspberrypi4_defconfig, raspberrypi4_64_defconfig, qemu_ppc64le_pseries_defconfig, qemu_mips32r2_malta_defconfig, qemu_mips64_malta_defconfig]
         libc_name: [glibc, uclibc, musl]
+    env:
+      PPP_CI_VERSION: v1.0
+      BUILDROOT_DIRECTORY_NAME: buildroot-${{ matrix.defconfig_name }}-${{ matrix.libc_name }}
     steps:
-      - name: Checkout Buildroot sources
-        run: git clone --depth=1 --branch=2021.02.3 https://git.busybox.net/buildroot
-      - name: Select latest PPP version
-        working-directory: buildroot/package/pppd
+      - name: Retrieve prebuilt Buildroot image...
+        working-directory: /home/runner
         run: |
-          # Allow package to build when musl libc is selected
-          sed -i '/depends on !BR2_TOOLCHAIN_USES_MUSL/d' Config.in
-          # Upstream version always needs OpenSSL
-          sed -i '/select BR2_PACKAGE_OPENSSL/c\\select BR2_PACKAGE_OPENSSL' Config.in
-          # Do not check for package hash, so there is no need to compute it
-          rm pppd.hash
-          # Buildroot patch is already applied upstream
-          rm -f 0001-pppd-Fix-bounds-check.patch
-          # Get package sources from head of master branch
-          sed -i "/PPPD_VERSION =/c\\PPPD_VERSION = ${GITHUB_SHA}" pppd.mk
-          sed -i '/PPPD_SITE =/c\\PPPD_SITE = https://github.com/ppp-project/ppp' pppd.mk
-          sed -i '9iPPPD_SITE_METHOD = git' pppd.mk
-          # Tell Buildroot to run autoreconf.sh
-          sed -i '16iPPPD_AUTORECONF = YES' pppd.mk
-          # Filters feature needs libpcap
-          sed -i '17iPPPD_DEPENDENCIES = libpcap openssl' pppd.mk
-          # Enable verbose build commands and force OpenSSL directory, otherwise the host system one might be used instead of Buildroot one
-          sed -i '18iPPPD_CONF_OPTS = --disable-silent-rules --with-openssl="$(STAGING_DIR)/usr"' pppd.mk
-          # Do not install build artifacts to staging directory
-          sed -i 's/PPPD_INSTALL_STAGING = YES/PPPD_INSTALL_STAGING = NO/' pppd.mk
-          # Delete custom configuration tool, it is now automatically handled by Buildroot
-          sed -i '/PPPD_CONFIGURE_CMDS/,+4d' pppd.mk
-          # Delete custom build rule, it is now generated by Autotools
-          sed -i '/define PPPD_BUILD_CMDS/,+4d' pppd.mk
-          # Delete custom installation to target rule, it is now generated by Autotools
-          sed -i '/define PPPD_INSTALL_TARGET_CMDS/,+27d' pppd.mk
-          # Delete custom staging installation rule as PPP does not need to be installed to staging in this CI
-          sed -i '/define PPPD_INSTALL_STAGING_CMDS/,+3d' pppd.mk
-          # Tell Buildroot that this package uses Autotools
-          sed -i 's/$(eval $(generic-package))/$(eval $(autotools-package))/' pppd.mk
-      - name: Enable PPP build
-        working-directory: buildroot
+          wget https://github.com/ppp-project/ppp-ci/releases/download/${{ env.PPP_CI_VERSION }}/${{ env.BUILDROOT_DIRECTORY_NAME }}.tar.zst
+          tar -xf ${{ env.BUILDROOT_DIRECTORY_NAME }}.tar.zst
+      - name: Select latest PPP upstream version
+        working-directory: /home/runner/${{ env.BUILDROOT_DIRECTORY_NAME }}/package/pppd
         run: |
-          # Enable all Buildroot PPP options as everything is built by upstream build system
-          echo "BR2_PACKAGE_PPPD=y" >> configs/${{ matrix.defconfig_name }}
-          echo "BR2_PACKAGE_PPPD_FILTER=y" >> configs/${{ matrix.defconfig_name }}
-          echo "BR2_PACKAGE_PPPD_RADIUS=y" >> configs/${{ matrix.defconfig_name }}
-          echo "BR2_PACKAGE_PPPD_OVERWRITE_RESOLV_CONF=y" >> configs/${{ matrix.defconfig_name }}
-      - name: Select glibc
-        if: ${{ matrix.libc_name == 'glibc' }}
-        working-directory: buildroot
-        run: echo "BR2_TOOLCHAIN_BUILDROOT_GLIBC=y" >> configs/${{ matrix.defconfig_name }}
-      - name: Select uClibc
-        if: ${{ matrix.libc_name == 'uclibc' }}
-        working-directory: buildroot
-        run: echo "BR2_TOOLCHAIN_BUILDROOT_UCLIBC=y" >> configs/${{ matrix.defconfig_name }}
-      - name: Select musl
-        if: ${{ matrix.libc_name == 'musl' }}
-        working-directory: buildroot
-        run: echo "BR2_TOOLCHAIN_BUILDROOT_MUSL=y" >> configs/${{ matrix.defconfig_name }}
-      - name: Configure Buildroot
-        working-directory: buildroot
-        run: make ${{ matrix.defconfig_name }}
+          # Get package sources from head of current branch
+          sed -i "/PPPD_VERSION =/c\\PPPD_VERSION = ${GITHUB_SHA}" pppd.mk
+      - name: Trigger a PPP package rebuild
+        working-directory: /home/runner/${{ env.BUILDROOT_DIRECTORY_NAME }}/output/build
+        run: rm -rf pppd*
       - name: Build
-        working-directory: buildroot
+        working-directory: /home/runner/${{ env.BUILDROOT_DIRECTORY_NAME }}
         run: make
index d0a93db02081c1a1f07e0e72e1bbab6885539530..e048f66b5d2f6b4966076bd3a1fcd47cf48d18cb 100644 (file)
@@ -26,7 +26,7 @@ Under Linux, it is typically eth0 or eth1.
 The interface should be \(lqup\(rq before you start
 \fBpppoe\-discovery\fR, but should \fInot\fR be configured to have an
 IP address.
-The default interface is eth0.
+This option is mandatory.
 .RE
 .TP
 .BI \-D " file_name"
index 1fe999dbdf55b16fa7bbefe5ce6557b1f848fa26..10f51dc975dbd9df1a851ca056f586770e09aa8d 100644 (file)
 
 #include "pppoe.h"
 
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifdef HAVE_NETPACKET_PACKET_H
-#include <netpacket/packet.h>
-#elif defined(HAVE_LINUX_IF_PACKET_H)
-#include <linux/if_packet.h>
-#endif
-
-#ifdef HAVE_ASM_TYPES_H
-#include <asm/types.h>
-#endif
-
-#ifdef HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
-#endif
-
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef HAVE_NET_IF_ARP_H
-#include <net/if_arp.h>
-#endif
-
 int debug;
 int got_sigterm;
 int pppoe_verbose;
@@ -251,9 +225,16 @@ int main(int argc, char *argv[])
        }
     }
 
-    /* default interface name */
-    if (!conn->ifName)
-       conn->ifName = xstrdup("eth0");
+    if (optind != argc) {
+       fprintf(stderr, "%s: extra argument '%s'\n", argv[0], argv[optind]);
+       usage();
+       exit(EXIT_FAILURE);
+    }
+
+    if (!conn->ifName) {
+       fprintf(stderr, "Interface was not specified\n");
+       exit(EXIT_FAILURE);
+    }
 
     conn->sessionSocket = -1;
 
@@ -276,7 +257,7 @@ usage(void)
 {
     fprintf(stderr, "Usage: pppoe-discovery [options]\n");
     fprintf(stderr, "Options:\n");
-    fprintf(stderr, "   -I if_name     -- Specify interface (default eth0)\n");
+    fprintf(stderr, "   -I if_name     -- Specify interface (mandatory option)\n");
     fprintf(stderr, "   -D filename    -- Log debugging information in filename.\n");
     fprintf(stderr,
            "   -t timeout     -- Initial timeout for discovery packets in seconds\n"