Merge Official Source
This commit is contained in:
commit
14d19b5644
@ -35,9 +35,11 @@ menu "Target Images"
|
||||
bool "lzma"
|
||||
|
||||
config TARGET_INITRAMFS_COMPRESSION_LZO
|
||||
depends on !TARGET_ROOTFS_INITRAMFS_SEPERATE
|
||||
bool "lzo"
|
||||
|
||||
config TARGET_INITRAMFS_COMPRESSION_LZ4
|
||||
depends on !TARGET_ROOTFS_INITRAMFS_SEPERATE
|
||||
bool "lz4"
|
||||
|
||||
config TARGET_INITRAMFS_COMPRESSION_XZ
|
||||
@ -62,6 +64,15 @@ menu "Target Images"
|
||||
help
|
||||
Ignore the initramfs passed by the bootloader.
|
||||
|
||||
config TARGET_ROOTFS_INITRAMFS_SEPERATE
|
||||
bool "seperate ramdisk"
|
||||
depends on TARGET_ROOTFS_INITRAMFS && !TARGET_INITRAMFS_FORCE
|
||||
default y if USES_SEPERATE_INITRAMFS
|
||||
help
|
||||
Generate seperate initrd.cpio instead of embedding it.
|
||||
This is useful for generating images with a dedicated
|
||||
ramdisk e.g. in U-Boot's uImage and uImage.FIT formats.
|
||||
|
||||
comment "Root filesystem archives"
|
||||
|
||||
config TARGET_ROOTFS_CPIOGZ
|
||||
|
||||
@ -90,7 +90,7 @@ endef
|
||||
|
||||
define gettext_version_target
|
||||
(cd $(PKG_BUILD_DIR) && \
|
||||
GETTEXT_VERSION=$(shell $(STAGING_DIR_HOSTPKG)/bin/gettext -V | $(STAGING_DIR_HOST)/bin/sed -ne '1s/.*\([0-9]\.[0-9]\{2\}\.[0-9]\).*/\1/p' ) && \
|
||||
GETTEXT_VERSION=$(shell $(STAGING_DIR_HOSTPKG)/bin/gettext -V | $(STAGING_DIR_HOST)/bin/sed -rne '1s/.*\b([0-9]\.[0-9]+(\.[0-9]+)?)\b.*/\1/p' ) && \
|
||||
$(STAGING_DIR_HOST)/bin/sed \
|
||||
-i $(PKG_BUILD_DIR)/configure.ac \
|
||||
-e "s/AM_GNU_GETTEXT_VERSION(.*)/AM_GNU_GETTEXT_VERSION(\[$$$$GETTEXT_VERSION\])/g" && \
|
||||
|
||||
@ -196,15 +196,28 @@ define Build/eva-image
|
||||
mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/initrd_compression
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),.bzip2) \
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),.gzip) \
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZMA),.lzma) \
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_XZ),.xz) \
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_ZSTD),.zstd)
|
||||
endef
|
||||
|
||||
define Build/fit
|
||||
$(TOPDIR)/scripts/mkits.sh \
|
||||
-D $(DEVICE_NAME) -o $@.its -k $@ \
|
||||
$(if $(word 2,$(1)),-d $(word 2,$(1))) -C $(word 1,$(1)) \
|
||||
$(if $(findstring with-rootfs,$(word 3,$(1))),-r $(IMAGE_ROOTFS)) \
|
||||
$(if $(findstring with-initrd,$(word 3,$(1))), \
|
||||
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPERATE), \
|
||||
-i $(KERNEL_BUILD_DIR)/initrd.cpio$(strip $(call Build/initrd_compression)))) \
|
||||
-a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
|
||||
$(if $(DEVICE_FDT_NUM),-n $(DEVICE_FDT_NUM)) \
|
||||
-c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config@1") \
|
||||
-A $(LINUX_KARCH) -v $(LINUX_VERSION)
|
||||
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
|
||||
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage $(if $(findstring external,$(word 3,$(1))),\
|
||||
-E -B 0x1000 $(if $(findstring static,$(word 3,$(1))),-p 0x1000)) -f $@.its $@.new
|
||||
@mv $@.new $@
|
||||
endef
|
||||
|
||||
@ -448,6 +461,22 @@ define Build/uImage
|
||||
mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/uImage-with-ramdisk
|
||||
mkimage \
|
||||
-A $(LINUX_KARCH) \
|
||||
-O linux \
|
||||
-T kernel \
|
||||
-C $(word 1,$(1)) \
|
||||
-a $(KERNEL_LOADADDR) \
|
||||
-e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
|
||||
-i $(KERNEL_BUILD_DIR)/initrd.cpio.$(strip $(call Build/initrd_compression)) \
|
||||
-n '$(if $(UIMAGE_NAME),$(UIMAGE_NAME),$(call toupper,$(LINUX_KARCH)) $(VERSION_DIST) Linux-$(LINUX_VERSION))' \
|
||||
$(if $(UIMAGE_MAGIC),-M $(UIMAGE_MAGIC)) \
|
||||
$(wordlist 2,$(words $(1)),$(1)) \
|
||||
-d $@ $@.new
|
||||
mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/xor-image
|
||||
$(STAGING_DIR_HOST)/bin/xorimage -i $@ -o $@.xor $(1)
|
||||
mv $@.xor $@
|
||||
|
||||
@ -48,6 +48,13 @@ else
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
|
||||
ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPERATE),y)
|
||||
define Kernel/SetInitramfs/PreConfigure
|
||||
grep -v -e CONFIG_BLK_DEV_INITRD $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config
|
||||
echo 'CONFIG_BLK_DEV_INITRD=y' >> $(LINUX_DIR)/.config
|
||||
echo 'CONFIG_INITRAMFS_SOURCE=""' >> $(LINUX_DIR)/.config
|
||||
endef
|
||||
else
|
||||
ifeq ($(strip $(CONFIG_EXTERNAL_CPIO)),"")
|
||||
define Kernel/SetInitramfs/PreConfigure
|
||||
grep -v -e INITRAMFS -e CONFIG_RD_ -e CONFIG_BLK_DEV_INITRD $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config
|
||||
@ -60,14 +67,19 @@ ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
|
||||
echo 'CONFIG_INITRAMFS_SOURCE="$(call qstrip,$(CONFIG_EXTERNAL_CPIO))"' >> $(LINUX_DIR)/.config
|
||||
endef
|
||||
endif
|
||||
endif
|
||||
|
||||
define Kernel/SetInitramfs
|
||||
rm -f $(LINUX_DIR)/.config.prev
|
||||
mv $(LINUX_DIR)/.config $(LINUX_DIR)/.config.old
|
||||
$(call Kernel/SetInitramfs/PreConfigure)
|
||||
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPERATE),y)
|
||||
echo 'CONFIG_INITRAMFS_ROOT_UID=$(shell id -u)' >> $(LINUX_DIR)/.config
|
||||
echo 'CONFIG_INITRAMFS_ROOT_GID=$(shell id -g)' >> $(LINUX_DIR)/.config
|
||||
echo "$(if $(CONFIG_TARGET_INITRAMFS_FORCE),CONFIG_INITRAMFS_FORCE=y,# CONFIG_INITRAMFS_FORCE is not set)" >> $(LINUX_DIR)/.config
|
||||
else
|
||||
echo "# CONFIG_INITRAMFS_FORCE is not set" >> $(LINUX_DIR)/.config
|
||||
endif
|
||||
echo "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_NONE),CONFIG_INITRAMFS_COMPRESSION_NONE=y,# CONFIG_INITRAMFS_COMPRESSION_NONE is not set)" >> $(LINUX_DIR)/.config
|
||||
echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),CONFIG_INITRAMFS_COMPRESSION_GZIP=y\nCONFIG_RD_GZIP=y,# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set\n# CONFIG_RD_GZIP is not set)" >> $(LINUX_DIR)/.config
|
||||
echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),CONFIG_INITRAMFS_COMPRESSION_BZIP2=y\nCONFIG_RD_BZIP2=y,# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set\n# CONFIG_RD_BZIP2 is not set)" >> $(LINUX_DIR)/.config
|
||||
@ -147,6 +159,20 @@ define Kernel/CompileImage/Initramfs
|
||||
$(CP) $(GENERIC_PLATFORM_DIR)/other-files/init $(TARGET_DIR)/init
|
||||
$(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $(TARGET_DIR)/init)
|
||||
rm -rf $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/usr/initramfs_data.cpio*
|
||||
ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPERATE),y)
|
||||
ifeq ($(CONFIG_EXTERNAL_CPIO),y)
|
||||
$(CP) $(CONFIG_EXTERNAL_CPIO) $(KERNEL_BUILD_DIR)/initrd.cpio
|
||||
else
|
||||
( cd $(TARGET_DIR); find . | cpio -o -H newc -R root:root > $(KERNEL_BUILD_DIR)/initrd.cpio )
|
||||
endif
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),bzip2 -9 -c < $(KERNEL_BUILD_DIR)/initrd.cpio > $(KERNEL_BUILD_DIR)/initrd.cpio.bzip2)
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),gzip -f -S .gzip -9n $(KERNEL_BUILD_DIR)/initrd.cpio)
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZMA),$(STAGING_DIR_HOST)/bin/lzma e -lc1 -lp2 -pb2 $(KERNEL_BUILD_DIR)/initrd.cpio $(KERNEL_BUILD_DIR)/initrd.cpio.lzma)
|
||||
# ? $(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZO),)
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_XZ),$(STAGING_DIR_HOST)/bin/xz -9 -fz --check=crc32 $(KERNEL_BUILD_DIR)/initrd.cpio)
|
||||
# ? $(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZ4),)
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_ZSTD),$(STAGING_DIR_HOST)/bin/zstd -T0 -f -o $(KERNEL_BUILD_DIR)/initrd.cpio.zstd $(KERNEL_BUILD_DIR)/initrd.cpio)
|
||||
endif
|
||||
+$(KERNEL_MAKE) $(KERNEL_MAKEOPTS_IMAGE) $(if $(KERNELNAME),$(KERNELNAME),all)
|
||||
$(call Kernel/CopyImage,-initramfs)
|
||||
endef
|
||||
|
||||
@ -3,13 +3,13 @@
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
# 'kernel' partition on NAND contains the kernel
|
||||
# 'kernel' partition or UBI volume on NAND contains the kernel
|
||||
CI_KERNPART="${CI_KERNPART:-kernel}"
|
||||
|
||||
# 'ubi' partition on NAND contains UBI
|
||||
CI_UBIPART="${CI_UBIPART:-ubi}"
|
||||
|
||||
# 'rootfs' partition on NAND contains the rootfs
|
||||
# 'rootfs' UBI volume on NAND contains the rootfs
|
||||
CI_ROOTPART="${CI_ROOTPART:-rootfs}"
|
||||
|
||||
ubi_mknod() {
|
||||
@ -117,9 +117,14 @@ nand_restore_config() {
|
||||
nand_upgrade_prepare_ubi() {
|
||||
local rootfs_length="$1"
|
||||
local rootfs_type="$2"
|
||||
local has_kernel="${3:-0}"
|
||||
local rootfs_data_max="$(fw_printenv -n rootfs_data_max 2>/dev/null)"
|
||||
[ -n "$rootfs_data_max" ] && rootfs_data_max=$(($rootfs_data_max))
|
||||
|
||||
local kernel_length="$3"
|
||||
local has_env="${4:-0}"
|
||||
|
||||
[ -n "$rootfs_length" -o -n "$kernel_length" ] || return 1
|
||||
|
||||
local mtdnum="$( find_mtd_index "$CI_UBIPART" )"
|
||||
if [ ! "$mtdnum" ]; then
|
||||
echo "cannot find ubi mtd partition $CI_UBIPART"
|
||||
@ -148,23 +153,24 @@ nand_upgrade_prepare_ubi() {
|
||||
local root_ubivol="$( nand_find_volume $ubidev $CI_ROOTPART )"
|
||||
local data_ubivol="$( nand_find_volume $ubidev rootfs_data )"
|
||||
|
||||
# remove ubiblock device of rootfs
|
||||
local root_ubiblk="ubiblock${root_ubivol:3}"
|
||||
if [ "$root_ubivol" -a -e "/dev/$root_ubiblk" ]; then
|
||||
echo "removing $root_ubiblk"
|
||||
if ! ubiblock -r /dev/$root_ubivol; then
|
||||
echo "cannot remove $root_ubiblk"
|
||||
return 1;
|
||||
fi
|
||||
local ubiblk ubiblkvol
|
||||
for ubiblk in /dev/ubiblock*_? ; do
|
||||
[ -e "$ubiblk" ] || continue
|
||||
echo "removing ubiblock${ubiblk:13}"
|
||||
ubiblkvol=ubi${ubiblk:13}
|
||||
if ! ubiblock -r /dev/$ubiblkvol; then
|
||||
echo "cannot remove $ubiblk"
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
|
||||
# kill volumes
|
||||
[ "$kern_ubivol" ] && ubirmvol /dev/$ubidev -N $CI_KERNPART || true
|
||||
[ "$root_ubivol" ] && ubirmvol /dev/$ubidev -N $CI_ROOTPART || true
|
||||
[ "$root_ubivol" -a "$root_ubivol" != "$kern_ubivol" ] && ubirmvol /dev/$ubidev -N $CI_ROOTPART || true
|
||||
[ "$data_ubivol" ] && ubirmvol /dev/$ubidev -N rootfs_data || true
|
||||
|
||||
# update kernel
|
||||
if [ "$has_kernel" = "1" ]; then
|
||||
if [ -n "$kernel_length" ]; then
|
||||
if ! ubimkvol /dev/$ubidev -N $CI_KERNPART -s $kernel_length; then
|
||||
echo "cannot create kernel volume"
|
||||
return 1;
|
||||
@ -172,20 +178,31 @@ nand_upgrade_prepare_ubi() {
|
||||
fi
|
||||
|
||||
# update rootfs
|
||||
local root_size_param
|
||||
if [ -n "$rootfs_length" ]; then
|
||||
local rootfs_size_param
|
||||
if [ "$rootfs_type" = "ubifs" ]; then
|
||||
root_size_param="-m"
|
||||
rootfs_size_param="-m"
|
||||
else
|
||||
root_size_param="-s $rootfs_length"
|
||||
rootfs_size_param="-s $rootfs_length"
|
||||
fi
|
||||
if ! ubimkvol /dev/$ubidev -N $CI_ROOTPART $root_size_param; then
|
||||
if ! ubimkvol /dev/$ubidev -N $CI_ROOTPART $rootfs_size_param; then
|
||||
echo "cannot create rootfs volume"
|
||||
return 1;
|
||||
fi
|
||||
fi
|
||||
|
||||
# create rootfs_data for non-ubifs rootfs
|
||||
if [ "$rootfs_type" != "ubifs" ]; then
|
||||
if ! ubimkvol /dev/$ubidev -N rootfs_data -m; then
|
||||
local availeb=$(cat /sys/devices/virtual/ubi/$ubidev/avail_eraseblocks)
|
||||
local ebsize=$(cat /sys/devices/virtual/ubi/$ubidev/eraseblock_size)
|
||||
local avail_size=$(( $availeb * $ebsize ))
|
||||
local rootfs_data_size_param="-m"
|
||||
if [ -n "$rootfs_data_max" ] &&
|
||||
[ "$rootfs_data_max" != "0" ] &&
|
||||
[ "$rootfs_data_max" -le "$avail_size" ]; then
|
||||
rootfs_data_size_param="-s $rootfs_data_max"
|
||||
fi
|
||||
if ! ubimkvol /dev/$ubidev -N rootfs_data $rootfs_data_size_param; then
|
||||
echo "cannot initialize rootfs_data volume"
|
||||
return 1
|
||||
fi
|
||||
@ -232,7 +249,7 @@ nand_upgrade_ubinized() {
|
||||
nand_upgrade_ubifs() {
|
||||
local rootfs_length=$( (cat $1 | wc -c) 2> /dev/null)
|
||||
|
||||
nand_upgrade_prepare_ubi "$rootfs_length" "ubifs" "0" "0"
|
||||
nand_upgrade_prepare_ubi "$rootfs_length" "ubifs" "" ""
|
||||
|
||||
local ubidev="$( nand_find_ubi "$CI_UBIPART" )"
|
||||
local root_ubivol="$(nand_find_volume $ubidev $CI_ROOTPART)"
|
||||
@ -241,39 +258,59 @@ nand_upgrade_ubifs() {
|
||||
nand_do_upgrade_success
|
||||
}
|
||||
|
||||
nand_upgrade_fit() {
|
||||
local fit_file="$1"
|
||||
local fit_length="$(wc -c < "$fit_file")"
|
||||
|
||||
nand_upgrade_prepare_ubi "" "" "$fit_length" "1"
|
||||
|
||||
local fit_ubidev="$(nand_find_ubi "$CI_UBIPART")"
|
||||
local fit_ubivol="$(nand_find_volume $fit_ubidev "$CI_KERNPART")"
|
||||
ubiupdatevol /dev/$fit_ubivol -s $fit_length $fit_file
|
||||
|
||||
nand_do_upgrade_success
|
||||
}
|
||||
|
||||
nand_upgrade_tar() {
|
||||
local tar_file="$1"
|
||||
local kernel_mtd="$(find_mtd_index $CI_KERNPART)"
|
||||
|
||||
local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$')
|
||||
local board_dir=$(tar tf "$tar_file" | grep -m 1 '^sysupgrade-.*/$')
|
||||
board_dir=${board_dir%/}
|
||||
|
||||
local kernel_length=$( (tar xf $tar_file ${board_dir}/kernel -O | wc -c) 2> /dev/null)
|
||||
local rootfs_length=$( (tar xf $tar_file ${board_dir}/root -O | wc -c) 2> /dev/null)
|
||||
kernel_length=$( (tar xf "$tar_file" ${board_dir}/kernel -O | wc -c) 2> /dev/null)
|
||||
local has_rootfs=0
|
||||
local rootfs_length
|
||||
local rootfs_type
|
||||
|
||||
local rootfs_type="$(identify_tar "$tar_file" ${board_dir}/root)"
|
||||
tar tf "$tar_file" ${board_dir}/root 1>/dev/null 2>/dev/null && has_rootfs=1
|
||||
[ "$has_rootfs" = "1" ] && {
|
||||
rootfs_length=$( (tar xf "$tar_file" ${board_dir}/root -O | wc -c) 2> /dev/null)
|
||||
rootfs_type="$(identify_tar "$tar_file" ${board_dir}/root)"
|
||||
}
|
||||
|
||||
local has_kernel=1
|
||||
local has_env=0
|
||||
|
||||
[ "$kernel_length" != 0 -a -n "$kernel_mtd" ] && {
|
||||
tar xf $tar_file ${board_dir}/kernel -O | mtd write - $CI_KERNPART
|
||||
tar xf "$tar_file" ${board_dir}/kernel -O | mtd write - $CI_KERNPART
|
||||
}
|
||||
[ "$kernel_length" = 0 -o ! -z "$kernel_mtd" ] && has_kernel=0
|
||||
[ "$kernel_length" = 0 -o ! -z "$kernel_mtd" ] && has_kernel=
|
||||
|
||||
nand_upgrade_prepare_ubi "$rootfs_length" "$rootfs_type" "$has_kernel" "$has_env"
|
||||
nand_upgrade_prepare_ubi "$rootfs_length" "$rootfs_type" "${has_kernel:+$kernel_length}" "$has_env"
|
||||
|
||||
local ubidev="$( nand_find_ubi "$CI_UBIPART" )"
|
||||
[ "$has_kernel" = "1" ] && {
|
||||
local kern_ubivol="$( nand_find_volume $ubidev $CI_KERNPART )"
|
||||
tar xf $tar_file ${board_dir}/kernel -O | \
|
||||
tar xf "$tar_file" ${board_dir}/kernel -O | \
|
||||
ubiupdatevol /dev/$kern_ubivol -s $kernel_length -
|
||||
}
|
||||
|
||||
[ "$has_rootfs" = "1" ] && {
|
||||
local root_ubivol="$( nand_find_volume $ubidev $CI_ROOTPART )"
|
||||
tar xf $tar_file ${board_dir}/root -O | \
|
||||
tar xf "$tar_file" ${board_dir}/root -O | \
|
||||
ubiupdatevol /dev/$root_ubivol -s $rootfs_length -
|
||||
|
||||
}
|
||||
nand_do_upgrade_success
|
||||
}
|
||||
|
||||
@ -284,6 +321,7 @@ nand_do_upgrade() {
|
||||
[ ! "$(find_mtd_index "$CI_UBIPART")" ] && CI_UBIPART="rootfs"
|
||||
|
||||
case "$file_type" in
|
||||
"fit") nand_upgrade_fit $1;;
|
||||
"ubi") nand_upgrade_ubinized $1;;
|
||||
"ubifs") nand_upgrade_ubifs $1;;
|
||||
*) nand_upgrade_tar $1;;
|
||||
@ -309,7 +347,7 @@ nand_do_platform_check() {
|
||||
local control_length=$( (tar xf $tar_file sysupgrade-$board_name/CONTROL -O | wc -c) 2> /dev/null)
|
||||
local file_type="$(identify $2)"
|
||||
|
||||
[ "$control_length" = 0 -a "$file_type" != "ubi" -a "$file_type" != "ubifs" ] && {
|
||||
[ "$control_length" = 0 -a "$file_type" != "ubi" -a "$file_type" != "ubifs" -a "$file_type" != "fit" ] && {
|
||||
echo "Invalid sysupgrade file."
|
||||
return 1
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#
|
||||
# Copyright (C) 2017 Hauke Mehrtens
|
||||
# Copyright (C) 2020 Daniel Golle
|
||||
# Copyright (C) 2021 Daniel Golle
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
@ -19,9 +19,22 @@ PKG_MIRROR_HASH:=b211b2f9143d4debc7ad8dc959cb606888af20af790855dd66c87e451b6a1bc
|
||||
|
||||
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
|
||||
|
||||
PKG_LICENSE+=proprietary
|
||||
PKG_LICENSE_FILES:=LICENCE.mediatek
|
||||
|
||||
BLOBS_TARBALL:=tfa-mtk-files-for-2020-11-09.tgz
|
||||
BROMIMAGE_EXEC:=bromimage-x64
|
||||
|
||||
include $(INCLUDE_DIR)/trusted-firmware-a.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Download/tfa-files
|
||||
URL:=@OPENWRT
|
||||
URL_FILE:=$(BLOBS_TARBALL)
|
||||
FILE:=$(BLOBS_TARBALL)
|
||||
HASH:=689b097e4531d3eeca0c477675ab3dc3cace6ba4ed8a339116a9ede6537839d7
|
||||
endef
|
||||
|
||||
define Download/mt7622-header-emmc
|
||||
URL:=https://raw.githubusercontent.com/frank-w/BPI-R64-ATF/a36efa5f7435b8079479d13b562fedc0aa0d42f0
|
||||
URL_FILE:=header_emmc.bin
|
||||
@ -36,74 +49,112 @@ define Download/mt7622-header-sdmmc
|
||||
HASH:=242908c04e25289d25ba9fab61a1930425af173051c43d275d1ac9877d6accb1
|
||||
endef
|
||||
|
||||
define Package/arm-trusted-firmware-mt7622/Default
|
||||
SECTION:=boot
|
||||
CATEGORY:=Boot Loaders
|
||||
TITLE:=ARM Trusted Firmware for MT7622
|
||||
DEPENDS:=@TARGET_mediatek_mt7622 @BROKEN
|
||||
# wait until bromimage gets replace by static build
|
||||
# libcrypto.so.1.1: version `OPENSSL_1_1_1' not found (required by tools/mediatek/bromimage/bromimage)
|
||||
define Trusted-Firmware-A/Default
|
||||
BUILD_TARGET:=mediatek
|
||||
BUILD_SUBTARGET:=mt7622
|
||||
PLAT:=mt7622
|
||||
TFA_IMAGE:=bl2.img bl31.bin
|
||||
BOOT_DEVICE:=
|
||||
DDR_BLOB:=
|
||||
endef
|
||||
|
||||
define Package/arm-trusted-firmware-mt7622-nor
|
||||
$(call Package/arm-trusted-firmware-mt7622/Default)
|
||||
VARIANT:=nor
|
||||
define Trusted-Firmware-A/mt7622-nor-1ddr
|
||||
NAME:=MediaTek MT7622 (SPI-NOR, 1x DDR3)
|
||||
BOOT_DEVICE:=nor
|
||||
DDR_BLOB:=1
|
||||
endef
|
||||
|
||||
define Package/arm-trusted-firmware-mt7622-snand
|
||||
$(call Package/arm-trusted-firmware-mt7622/Default)
|
||||
VARIANT:=snand
|
||||
define Trusted-Firmware-A/mt7622-nor-2ddr
|
||||
NAME:=MediaTek MT7622 (SPI-NOR, 2x DDR3)
|
||||
BOOT_DEVICE:=nor
|
||||
DDR_BLOB:=2
|
||||
endef
|
||||
|
||||
define Package/arm-trusted-firmware-mt7622-emmc
|
||||
$(call Package/arm-trusted-firmware-mt7622/Default)
|
||||
VARIANT:=emmc
|
||||
define Trusted-Firmware-A/mt7622-snand-1ddr
|
||||
NAME:=MediaTek MT7622 (SPI-NAND, 1x DDR3)
|
||||
BOOT_DEVICE:=snand
|
||||
DDR_BLOB:=1
|
||||
endef
|
||||
|
||||
define Package/arm-trusted-firmware-mt7622-sdmmc
|
||||
$(call Package/arm-trusted-firmware-mt7622/Default)
|
||||
VARIANT:=sdmmc
|
||||
define Trusted-Firmware-A/mt7622-snand-2ddr
|
||||
NAME:=MediaTek MT7622 (SPI-SNAND, 2x DDR3)
|
||||
BOOT_DEVICE:=snand
|
||||
DDR_BLOB:=2
|
||||
endef
|
||||
|
||||
MAKE_VARS = \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)"
|
||||
define Trusted-Firmware-A/mt7622-emmc-1ddr
|
||||
NAME:=MediaTek MT7622 (eMMC, 1x DDR3)
|
||||
BOOT_DEVICE:=emmc
|
||||
DDR_BLOB:=1
|
||||
endef
|
||||
|
||||
MAKE_FLAGS += \
|
||||
PLAT=mt7622 \
|
||||
BOOT_DEVICE=$(BUILD_VARIANT) \
|
||||
all
|
||||
define Trusted-Firmware-A/mt7622-emmc-2ddr
|
||||
NAME:=MediaTek MT7622 (eMMC, 2x DDR3)
|
||||
BOOT_DEVICE:=emmc
|
||||
DDR_BLOB:=2
|
||||
endef
|
||||
|
||||
define Trusted-Firmware-A/mt7622-sdmmc-1ddr
|
||||
NAME:=MediaTek MT7622 (SDcard, 1x DDR3)
|
||||
BOOT_DEVICE:=sdmmc
|
||||
DDR_BLOB:=1
|
||||
endef
|
||||
|
||||
define Trusted-Firmware-A/mt7622-sdmmc-2ddr
|
||||
NAME:=MediaTek MT7622 (SDcard, 2x DDR3)
|
||||
BOOT_DEVICE:=sdmmc
|
||||
DDR_BLOB:=2
|
||||
endef
|
||||
|
||||
TFA_TARGETS:= \
|
||||
mt7622-nor-1ddr \
|
||||
mt7622-nor-2ddr \
|
||||
mt7622-snand-1ddr \
|
||||
mt7622-snand-2ddr \
|
||||
mt7622-emmc-1ddr \
|
||||
mt7622-emmc-2ddr \
|
||||
mt7622-sdmmc-1ddr \
|
||||
mt7622-sdmmc-2ddr
|
||||
|
||||
TFA_MAKE_FLAGS += BOOT_DEVICE=$(BOOT_DEVICE) all
|
||||
|
||||
define Build/Prepare
|
||||
$(call Build/Prepare/Default)
|
||||
ifeq ($(BUILD_VARIANT),emmc)
|
||||
ifeq ($(BOOT_DEVICE),emmc)
|
||||
$(eval $(call Download,mt7622-header-emmc))
|
||||
endif
|
||||
ifeq ($(BUILD_VARIANT),sdmmc)
|
||||
ifeq ($(BOOT_DEVICE),sdmmc)
|
||||
$(eval $(call Download,mt7622-header-sdmmc))
|
||||
endif
|
||||
$(eval $(call Download,tfa-files))
|
||||
# replace 'bromimage' tool by static version
|
||||
$(TAR) -vxzf $(DL_DIR)/$(BLOBS_TARBALL) --wildcards \
|
||||
-O "*/$(BROMIMAGE_EXEC)" > $(PKG_BUILD_DIR)/tools/mediatek/bromimage/bromimage
|
||||
$(TAR) -vxzf $(DL_DIR)/$(BLOBS_TARBALL) --wildcards \
|
||||
-C $(PKG_BUILD_DIR) \
|
||||
--strip-components=1 */LICENCE.mediatek
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
define Build/Configure
|
||||
$(call Build/Configure/Default)
|
||||
# replace DRAM calib blobs if needed (variant '2' is shipped upstream)
|
||||
ifeq ($(DDR_BLOB),1)
|
||||
$(TAR) -vxzf $(DL_DIR)/$(BLOBS_TARBALL) --wildcards \
|
||||
-C $(PKG_BUILD_DIR)/plat/mediatek/mt7622/drivers/dram/release \
|
||||
--strip-components=1 */*.o
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/trusted-firmware-a/install
|
||||
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
|
||||
$(CP) $(PKG_BUILD_DIR)/build/mt7622/release/bl2.bin $(STAGING_DIR_IMAGE)/mt7622-bl2-$(BUILD_VARIANT).bin
|
||||
$(CP) $(PKG_BUILD_DIR)/build/mt7622/release/bl2.img $(STAGING_DIR_IMAGE)/mt7622-bl2-$(BUILD_VARIANT).img
|
||||
# bl31.bin turns out to be identical for all build variants
|
||||
$(CP) $(PKG_BUILD_DIR)/build/mt7622/release/bl31.bin $(STAGING_DIR_IMAGE)/mt7622-bl31.bin
|
||||
ifeq ($(BUILD_VARIANT),emmc)
|
||||
$(CP) $(DL_DIR)/mt7622-header_emmc.bin $(STAGING_DIR_IMAGE)
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/build/mt7622/release/bl2.img $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-bl2.img
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/build/mt7622/release/bl31.bin $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-bl31.bin
|
||||
ifeq ($(BOOT_DEVICE),emmc)
|
||||
$(INSTALL_DATA) $(DL_DIR)/mt7622-header_emmc.bin $(STAGING_DIR_IMAGE)/
|
||||
endif
|
||||
ifeq ($(BUILD_VARIANT),sdmmc)
|
||||
$(CP) $(DL_DIR)/mt7622-header_sdmmc.bin $(STAGING_DIR_IMAGE)
|
||||
ifeq ($(BOOT_DEVICE),sdmmc)
|
||||
$(INSTALL_DATA) $(DL_DIR)/mt7622-header_sdmmc.bin $(STAGING_DIR_IMAGE)/
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/arm-trusted-firmware-mt7622-nor/install
|
||||
endef
|
||||
Package/arm-trusted-firmware-mt7622-snand/install = $(Package/arm-trusted-firmware-mt7622-nor/install)
|
||||
Package/arm-trusted-firmware-mt7622-emmc/install = $(Package/arm-trusted-firmware-mt7622-nor/install)
|
||||
Package/arm-trusted-firmware-mt7622-sdmmc/install = $(Package/arm-trusted-firmware-mt7622-nor/install)
|
||||
|
||||
$(eval $(call BuildPackage,arm-trusted-firmware-mt7622-nor))
|
||||
$(eval $(call BuildPackage,arm-trusted-firmware-mt7622-snand))
|
||||
$(eval $(call BuildPackage,arm-trusted-firmware-mt7622-emmc))
|
||||
$(eval $(call BuildPackage,arm-trusted-firmware-mt7622-sdmmc))
|
||||
$(eval $(call BuildPackage/Trusted-Firmware-A))
|
||||
|
||||
@ -11,6 +11,8 @@ case "$board" in
|
||||
d-link,dgs-1210-16|\
|
||||
d-link,dgs-1210-28|\
|
||||
d-link,dgs-1210-10p|\
|
||||
zyxel,gs1900-8hp-v1|\
|
||||
zyxel,gs1900-8hp-v2|\
|
||||
zyxel,gs1900-10hp)
|
||||
idx="$(find_mtd_index u-boot-env)"
|
||||
[ -n "$idx" ] && \
|
||||
|
||||
@ -218,7 +218,7 @@ $(eval $(call KernelPackage,dax))
|
||||
define KernelPackage/dm
|
||||
SUBMENU:=$(BLOCK_MENU)
|
||||
TITLE:=Device Mapper
|
||||
DEPENDS:=+kmod-crypto-manager +kmod-dax
|
||||
DEPENDS:=+kmod-crypto-manager +kmod-dax +KERNEL_KEYS:kmod-keys-encrypted
|
||||
# All the "=n" are unnecessary, they're only there
|
||||
# to stop the config from asking the question.
|
||||
# MIRROR is M because I've needed it for pvmove.
|
||||
|
||||
@ -38,7 +38,9 @@ define KernelPackage/crypto-aead
|
||||
KCONFIG:= \
|
||||
CONFIG_CRYPTO_AEAD \
|
||||
CONFIG_CRYPTO_AEAD2
|
||||
FILES:=$(LINUX_DIR)/crypto/aead.ko
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/crypto/aead.ko \
|
||||
$(LINUX_DIR)/crypto/geniv.ko@ge5.10
|
||||
AUTOLOAD:=$(call AutoLoad,09,aead,1)
|
||||
$(call AddDepends/crypto, +kmod-crypto-null)
|
||||
endef
|
||||
@ -48,8 +50,12 @@ $(eval $(call KernelPackage,crypto-aead))
|
||||
|
||||
define KernelPackage/crypto-arc4
|
||||
TITLE:=ARC4 cipher CryptoAPI module
|
||||
KCONFIG:=CONFIG_CRYPTO_ARC4
|
||||
FILES:=$(LINUX_DIR)/crypto/arc4.ko
|
||||
KCONFIG:= \
|
||||
CONFIG_CRYPTO_ARC4 \
|
||||
CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE=y
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/crypto/arc4.ko \
|
||||
$(LINUX_DIR)/lib/crypto/libarc4.ko
|
||||
AUTOLOAD:=$(call AutoLoad,09,arc4)
|
||||
$(call AddDepends/crypto)
|
||||
endef
|
||||
@ -492,6 +498,7 @@ define KernelPackage/crypto-misc
|
||||
TITLE:=Other CryptoAPI modules
|
||||
DEPENDS:=+kmod-crypto-xts
|
||||
KCONFIG:= \
|
||||
CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE=y \
|
||||
CONFIG_CRYPTO_CAMELLIA_X86_64 \
|
||||
CONFIG_CRYPTO_BLOWFISH_X86_64 \
|
||||
CONFIG_CRYPTO_TWOFISH_X86_64 \
|
||||
|
||||
@ -368,7 +368,8 @@ define KernelPackage/fs-nfs-common
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/fs/lockd/lockd.ko \
|
||||
$(LINUX_DIR)/net/sunrpc/sunrpc.ko \
|
||||
$(LINUX_DIR)/fs/nfs_common/grace.ko
|
||||
$(LINUX_DIR)/fs/nfs_common/grace.ko \
|
||||
$(LINUX_DIR)/fs/nfs_common/nfs_ssc.ko@ge5.10
|
||||
AUTOLOAD:=$(call AutoLoad,30,grace sunrpc lockd)
|
||||
endef
|
||||
|
||||
|
||||
@ -146,8 +146,10 @@ define KernelPackage/mdio-gpio
|
||||
CONFIG_MDIO_BITBANG \
|
||||
CONFIG_MDIO_GPIO
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/drivers/net/phy/mdio-gpio.ko \
|
||||
$(LINUX_DIR)/drivers/net/phy/mdio-bitbang.ko
|
||||
$(LINUX_DIR)/drivers/net/phy/mdio-gpio.ko@lt5.10 \
|
||||
$(LINUX_DIR)/drivers/net/phy/mdio-bitbang.ko@lt5.10 \
|
||||
$(LINUX_DIR)/drivers/net/mdio/mdio-gpio.ko@ge5.10 \
|
||||
$(LINUX_DIR)/drivers/net/mdio/mdio-bitbang.ko@ge5.10
|
||||
AUTOLOAD:=$(call AutoProbe,mdio-gpio)
|
||||
endef
|
||||
|
||||
@ -990,7 +992,8 @@ define KernelPackage/of-mdio
|
||||
KCONFIG:=CONFIG_OF_MDIO
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/drivers/net/phy/fixed_phy.ko \
|
||||
$(LINUX_DIR)/drivers/of/of_mdio.ko
|
||||
$(LINUX_DIR)/drivers/of/of_mdio.ko@lt5.10 \
|
||||
$(LINUX_DIR)/drivers/net/mdio/of_mdio.ko@ge5.10
|
||||
AUTOLOAD:=$(call AutoLoad,41,of_mdio)
|
||||
endef
|
||||
|
||||
@ -1187,7 +1190,8 @@ define KernelPackage/sfp
|
||||
CONFIG_MDIO_I2C
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/drivers/net/phy/sfp.ko \
|
||||
$(LINUX_DIR)/drivers/net/phy/mdio-i2c.ko
|
||||
$(LINUX_DIR)/drivers/net/phy/mdio-i2c.ko@lt5.10 \
|
||||
$(LINUX_DIR)/drivers/net/mdio/mdio-i2c.ko@ge5.10
|
||||
AUTOLOAD:=$(call AutoProbe,mdio-i2c sfp)
|
||||
endef
|
||||
|
||||
|
||||
@ -1126,7 +1126,9 @@ define KernelPackage/keys-trusted
|
||||
TITLE:=TPM trusted keys on kernel keyring
|
||||
DEPENDS:=@KERNEL_KEYS +kmod-crypto-hash +kmod-crypto-hmac +kmod-crypto-sha1 +kmod-tpm
|
||||
KCONFIG:=CONFIG_TRUSTED_KEYS
|
||||
FILES:=$(LINUX_DIR)/security/keys/trusted.ko
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/security/keys/trusted.ko@lt5.10 \
|
||||
$(LINUX_DIR)/security/keys/trusted-keys/trusted.ko@ge5.10
|
||||
AUTOLOAD:=$(call AutoLoad,01,trusted-keys,1)
|
||||
endef
|
||||
|
||||
|
||||
@ -412,7 +412,7 @@ $(eval $(call KernelPackage,usb2-pci))
|
||||
|
||||
define KernelPackage/usb-dwc2
|
||||
TITLE:=DWC2 USB controller driver
|
||||
DEPENDS:=+USB_GADGET_SUPPORT:kmod-usb-gadget
|
||||
DEPENDS:=+USB_GADGET_SUPPORT:kmod-usb-gadget +kmod-usb-roles
|
||||
KCONFIG:= \
|
||||
CONFIG_USB_PCI=y \
|
||||
CONFIG_USB_DWC2 \
|
||||
@ -1326,7 +1326,7 @@ define KernelPackage/usb-net-rtl8152
|
||||
KCONFIG:=CONFIG_USB_RTL8152
|
||||
FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/r8152.ko
|
||||
AUTOLOAD:=$(call AutoProbe,r8152)
|
||||
$(call AddDepends/usb-net)
|
||||
$(call AddDepends/usb-net, +LINUX_5_10:kmod-crypto-hash)
|
||||
endef
|
||||
|
||||
define KernelPackage/usb-net-rtl8152/description
|
||||
@ -1588,21 +1588,20 @@ endef
|
||||
|
||||
$(eval $(call KernelPackage,usbip-server))
|
||||
|
||||
|
||||
define KernelPackage/usb-chipidea
|
||||
TITLE:=Host and device support for Chipidea controllers
|
||||
DEPENDS:=+USB_GADGET_SUPPORT:kmod-usb-gadget @TARGET_ath79 +kmod-usb-ehci +kmod-usb-phy-nop
|
||||
DEPENDS:=+USB_GADGET_SUPPORT:kmod-usb-gadget @TARGET_ath79 +kmod-usb-ehci +kmod-usb-phy-nop +kmod-usb-roles
|
||||
KCONFIG:= \
|
||||
CONFIG_EXTCON \
|
||||
CONFIG_USB_CHIPIDEA \
|
||||
CONFIG_USB_CHIPIDEA_GENERIC \
|
||||
CONFIG_USB_CHIPIDEA_HOST=y \
|
||||
CONFIG_USB_CHIPIDEA_UDC=y \
|
||||
CONFIG_USB_CHIPIDEA_DEBUG=y
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/drivers/extcon/extcon-core.ko \
|
||||
$(LINUX_DIR)/drivers/usb/chipidea/ci_hdrc.ko \
|
||||
$(LINUX_DIR)/drivers/usb/common/ulpi.ko \
|
||||
$(LINUX_DIR)/drivers/usb/roles/roles.ko
|
||||
$(LINUX_DIR)/drivers/usb/common/ulpi.ko
|
||||
AUTOLOAD:=$(call AutoLoad,39,ci_hdrc,1)
|
||||
$(call AddDepends/usb)
|
||||
endef
|
||||
@ -1700,6 +1699,21 @@ endef
|
||||
|
||||
$(eval $(call KernelPackage,usb-net2280))
|
||||
|
||||
define KernelPackage/usb-roles
|
||||
TITLE:=USB Role Switch Library Module
|
||||
KCONFIG:=CONFIG_USB_ROLE_SWITCH
|
||||
HIDDEN:=1
|
||||
FILES:=$(LINUX_DIR)/drivers/usb/roles/roles.ko
|
||||
$(call AddDepends/usb)
|
||||
endef
|
||||
|
||||
define KernelPackage/usb-roles/description
|
||||
Support for USB Role Switch
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,usb-roles))
|
||||
|
||||
|
||||
define KernelPackage/chaoskey
|
||||
SUBMENU:=$(USB_MENU)
|
||||
TITLE:=Chaoskey hardware RNG support
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=rtl8812au-ct
|
||||
PKG_RELEASE=2
|
||||
PKG_RELEASE=1
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/greearb/rtl8812AU_8821AU_linux.git
|
||||
PKG_MIRROR_HASH:=fa689e034cad9e4683ea784b8f3cb590492ab5c68e8babd492a4e8bf2de3b114
|
||||
PKG_MIRROR_HASH:=09e33b1cede3f4457d4324fe30ea5fb92b240bcd6e647bbb689fa336f3b07968
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2020-01-12
|
||||
PKG_SOURCE_VERSION:=e0d586aa93cb8687dd7dc0e593b6a820df2d6e1d
|
||||
PKG_SOURCE_DATE:=2020-12-07
|
||||
PKG_SOURCE_VERSION:=1e9689c89fa627d2d764ba0e8359fd444fe8458f
|
||||
|
||||
PKG_MAINTAINER:=Ben Greear <greearb@candelatech.com>
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/os_dep/linux/ioctl_cfg80211.c
|
||||
+++ b/os_dep/linux/ioctl_cfg80211.c
|
||||
@@ -5177,6 +5177,14 @@ exit:
|
||||
@@ -5177,6 +5177,15 @@ exit:
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -11,19 +11,12 @@
|
||||
+{
|
||||
+
|
||||
+}
|
||||
+#else
|
||||
static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
|
||||
struct wireless_dev *wdev,
|
||||
@@ -5205,6 +5213,7 @@ static void cfg80211_rtw_mgmt_frame_regi
|
||||
exit:
|
||||
return;
|
||||
}
|
||||
+#endif
|
||||
|
||||
+
|
||||
#if defined(CONFIG_TDLS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
|
||||
static int cfg80211_rtw_tdls_mgmt(struct wiphy *wiphy,
|
||||
@@ -6019,7 +6028,10 @@ static struct cfg80211_ops rtw_cfg80211_
|
||||
struct net_device *ndev,
|
||||
@@ -5990,7 +5999,10 @@ static struct cfg80211_ops rtw_cfg80211_
|
||||
.cancel_remain_on_channel = cfg80211_rtw_cancel_remain_on_channel,
|
||||
#endif
|
||||
|
||||
@ -33,5 +26,5 @@
|
||||
+ .update_mgmt_frame_registrations = cfg80211_rtw_update_mgmt_frame_registrations,
|
||||
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
|
||||
.mgmt_tx = cfg80211_rtw_mgmt_tx,
|
||||
.mgmt_frame_register = cfg80211_rtw_mgmt_frame_register,
|
||||
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,34) && LINUX_VERSION_CODE<=KERNEL_VERSION(2,6,35))
|
||||
.action = cfg80211_rtw_mgmt_tx,
|
||||
|
||||
@ -297,15 +297,4 @@ config OPENSSL_WITH_ASYNC
|
||||
initiate crypto operations asynchronously. In order to work
|
||||
this will require the presence of an async capable engine.
|
||||
|
||||
config OPENSSL_WITH_GOST
|
||||
bool
|
||||
prompt "Prepare library for GOST engine"
|
||||
depends on OPENSSL_ENGINE
|
||||
help
|
||||
This option prepares the library to accept engine support
|
||||
for Russian GOST crypto algorithms.
|
||||
The gost engine is not included in standard openwrt feeds.
|
||||
To build such engine yourself, see:
|
||||
https://github.com/gost-engine/engine
|
||||
|
||||
endif
|
||||
|
||||
@ -11,7 +11,7 @@ PKG_NAME:=openssl
|
||||
PKG_BASE:=1.1.1
|
||||
PKG_BUGFIX:=j
|
||||
PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX)
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
PKG_USE_MIPS16:=0
|
||||
ENGINES_DIR=engines-1.1
|
||||
|
||||
@ -54,7 +54,6 @@ PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_OPENSSL_WITH_DTLS \
|
||||
CONFIG_OPENSSL_WITH_EC2M \
|
||||
CONFIG_OPENSSL_WITH_ERROR_MESSAGES \
|
||||
CONFIG_OPENSSL_WITH_GOST \
|
||||
CONFIG_OPENSSL_WITH_IDEA \
|
||||
CONFIG_OPENSSL_WITH_MDC2 \
|
||||
CONFIG_OPENSSL_WITH_NPN \
|
||||
@ -291,10 +290,6 @@ else
|
||||
OPENSSL_OPTIONS += no-engine
|
||||
endif
|
||||
|
||||
ifndef CONFIG_OPENSSL_WITH_GOST
|
||||
OPENSSL_OPTIONS += no-gost
|
||||
endif
|
||||
|
||||
ifndef CONFIG_OPENSSL_WITH_DTLS
|
||||
OPENSSL_OPTIONS += no-dtls
|
||||
endif
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/apps/openssl.cnf
|
||||
+++ b/apps/openssl.cnf
|
||||
@@ -22,6 +22,82 @@ oid_section = new_oids
|
||||
@@ -22,6 +22,99 @@ oid_section = new_oids
|
||||
# (Alternatively, use a configuration file that has only
|
||||
# X.509v3 extensions in its main [= default] section.)
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
+#devcrypto=devcrypto
|
||||
+#afalg=afalg
|
||||
+#padlock=padlock
|
||||
+##gost=gost
|
||||
+
|
||||
+[afalg]
|
||||
+# Leave this alone and configure algorithms with CIPERS/DIGESTS below
|
||||
@ -79,6 +80,22 @@
|
||||
+
|
||||
+[padlock]
|
||||
+default_algorithms = ALL
|
||||
+
|
||||
+[gost]
|
||||
+default_algorithms = ALL
|
||||
+# CRYPT_PARAMS: OID of default GOST 28147-89 parameters It allows the
|
||||
+# user to choose between different parameter sets of symmetric cipher
|
||||
+# algorithm. RFC 4357 specifies several parameters for the
|
||||
+# GOST 28147-89 algorithm, but OpenSSL doesn't provide user interface
|
||||
+# to choose one when encrypting. So use engine configuration parameter
|
||||
+# instead.
|
||||
+# Value of this parameter can be either short name, defined in OpenSSL
|
||||
+# obj_dat.h header file or numeric representation of OID, defined in
|
||||
+# RFC 4357. Defaults to id-tc26-gost-28147-param-Z
|
||||
+#CRYPT_PARAMS = id-tc26-gost-28147-param-Z
|
||||
+
|
||||
+# PBE_PARAMS: Shortname of default digest alg for PBE
|
||||
+#PBE_PARAMS =
|
||||
+
|
||||
[ new_oids ]
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=pcre
|
||||
PKG_VERSION:=8.44
|
||||
PKG_RELEASE:=3
|
||||
PKG_RELEASE:=4
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
PKG_SOURCE_URL:=@SF/$(PKG_NAME)
|
||||
@ -24,10 +24,8 @@ PKG_INSTALL:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
PKG_CONFIG_DEPENDS:=\
|
||||
CONFIG_PACKAGE_libpcrecpp \
|
||||
CONFIG_PCRE_JIT_ENABLED
|
||||
|
||||
include $(INCLUDE_DIR)/uclibc++.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
|
||||
@ -56,19 +54,12 @@ define Package/libpcre32
|
||||
TITLE:=A Perl Compatible Regular Expression library (32bit support)
|
||||
endef
|
||||
|
||||
define Package/libpcrecpp
|
||||
$(call Package/libpcre/default)
|
||||
TITLE:=C++ wrapper for Perl Compatible Regular Expression library
|
||||
DEPENDS:=+libpcre $(CXX_DEPENDS)
|
||||
endef
|
||||
|
||||
|
||||
HOST_CONFIGURE_ARGS += \
|
||||
--enable-utf8 \
|
||||
--enable-unicode-properties \
|
||||
--enable-pcre16 \
|
||||
--with-match-limit-recursion=16000 \
|
||||
--enable-cpp
|
||||
--disable-cpp
|
||||
|
||||
TARGET_CFLAGS += $(FPIC)
|
||||
|
||||
@ -79,7 +70,7 @@ CONFIGURE_ARGS += \
|
||||
--enable-pcre32 \
|
||||
$(if $(CONFIG_PCRE_JIT_ENABLED),--enable-jit,--disable-jit) \
|
||||
--with-match-limit-recursion=16000 \
|
||||
$(if $(CONFIG_PACKAGE_libpcrecpp),--enable,--disable)-cpp
|
||||
-disable-cpp
|
||||
|
||||
MAKE_FLAGS += \
|
||||
CFLAGS="$(TARGET_CFLAGS)"
|
||||
@ -118,13 +109,7 @@ define Package/libpcre32/install
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre32.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libpcrecpp/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcrecpp.so.* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libpcre))
|
||||
$(eval $(call BuildPackage,libpcre16))
|
||||
$(eval $(call BuildPackage,libpcre32))
|
||||
$(eval $(call BuildPackage,libpcrecpp))
|
||||
$(eval $(call HostBuild))
|
||||
|
||||
@ -8,12 +8,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wolfssl
|
||||
PKG_VERSION:=4.6.0-stable
|
||||
PKG_RELEASE:=2
|
||||
PKG_VERSION:=4.7.0-stable
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION)
|
||||
PKG_HASH:=053aefbb02d0b06b27c5e2df6875b4b587318755b7db9d6aa8d72206b310a848
|
||||
PKG_HASH:=b0e740b31d4d877d540ad50cc539a8873fc41af02bd3091c4357b403f7106e31
|
||||
|
||||
PKG_FIXUP:=libtool libtool-abiver
|
||||
PKG_INSTALL:=1
|
||||
|
||||
@ -1,53 +0,0 @@
|
||||
From fad1e67677bf7797b6bd6e1f21a513c289d963a7 Mon Sep 17 00:00:00 2001
|
||||
From: Sean Parkinson <sean@wolfssl.com>
|
||||
Date: Thu, 21 Jan 2021 08:24:38 +1000
|
||||
Subject: [PATCH] TLS 1.3: ensure key for signature in CertificateVerify
|
||||
|
||||
---
|
||||
src/tls13.c | 18 +++++++++++++-----
|
||||
1 file changed, 13 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/src/tls13.c
|
||||
+++ b/src/tls13.c
|
||||
@@ -5624,28 +5624,36 @@ static int DoTls13CertificateVerify(WOLF
|
||||
#ifdef HAVE_ED25519
|
||||
if (args->sigAlgo == ed25519_sa_algo &&
|
||||
!ssl->peerEd25519KeyPresent) {
|
||||
- WOLFSSL_MSG("Oops, peer sent ED25519 key but not in verify");
|
||||
+ WOLFSSL_MSG("Peer sent ED22519 sig but not ED22519 cert");
|
||||
+ ret = SIG_VERIFY_E;
|
||||
+ goto exit_dcv;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_ED448
|
||||
if (args->sigAlgo == ed448_sa_algo && !ssl->peerEd448KeyPresent) {
|
||||
- WOLFSSL_MSG("Oops, peer sent ED448 key but not in verify");
|
||||
+ WOLFSSL_MSG("Peer sent ED448 sig but not ED448 cert");
|
||||
+ ret = SIG_VERIFY_E;
|
||||
+ goto exit_dcv;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_ECC
|
||||
if (args->sigAlgo == ecc_dsa_sa_algo &&
|
||||
!ssl->peerEccDsaKeyPresent) {
|
||||
- WOLFSSL_MSG("Oops, peer sent ECC key but not in verify");
|
||||
+ WOLFSSL_MSG("Peer sent ECC sig but not ECC cert");
|
||||
+ ret = SIG_VERIFY_E;
|
||||
+ goto exit_dcv;
|
||||
}
|
||||
#endif
|
||||
#ifndef NO_RSA
|
||||
if (args->sigAlgo == rsa_sa_algo) {
|
||||
- WOLFSSL_MSG("Oops, peer sent PKCS#1.5 signature");
|
||||
+ WOLFSSL_MSG("Peer sent PKCS#1.5 algo but not in certificate");
|
||||
ERROR_OUT(INVALID_PARAMETER, exit_dcv);
|
||||
}
|
||||
if (args->sigAlgo == rsa_pss_sa_algo &&
|
||||
(ssl->peerRsaKey == NULL || !ssl->peerRsaKeyPresent)) {
|
||||
- WOLFSSL_MSG("Oops, peer sent RSA key but not in verify");
|
||||
+ WOLFSSL_MSG("Peer sent RSA sig but not RSA cert");
|
||||
+ ret = SIG_VERIFY_E;
|
||||
+ goto exit_dcv;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/wolfssl/wolfcrypt/settings.h
|
||||
+++ b/wolfssl/wolfcrypt/settings.h
|
||||
@@ -2248,7 +2248,7 @@ extern void uITRON4_free(void *p) ;
|
||||
@@ -2255,7 +2255,7 @@ extern void uITRON4_free(void *p) ;
|
||||
#endif
|
||||
|
||||
/* warning for not using harden build options (default with ./configure) */
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
From 391ecbd647c121300dc7dcf209e412ccb7b8d432 Mon Sep 17 00:00:00 2001
|
||||
From: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
Date: Fri, 1 Jan 2021 21:57:56 +0100
|
||||
Subject: [PATCH] Fix linking against hostapd with LTO
|
||||
|
||||
When running LTO on wolfssl the ecc_map() function is removed from the
|
||||
binary by GCC 8.4.0. This function is used by multiple functions from
|
||||
the crypto_wolfssl.c implementation of hostapd master.
|
||||
|
||||
Fixes: 780e8a4619b6 ("Fixes for building `--enable-wpas=small` with WPA Supplicant v2.7.")
|
||||
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
---
|
||||
configure.ac | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -947,6 +947,7 @@ then
|
||||
AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA_X509_SMALL"
|
||||
|
||||
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_PUBLIC_MP"
|
||||
+ AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_PUBLIC_ECC_ADD_DBL"
|
||||
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DER_LOAD"
|
||||
AM_CFLAGS="$AM_CFLAGS -DATOMIC_USER"
|
||||
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN"
|
||||
@ -1,10 +0,0 @@
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -943,6 +943,7 @@ then
|
||||
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALWAYS_KEEP_SNI"
|
||||
AM_CFLAGS="$AM_CFLAGS -DHAVE_EX_DATA"
|
||||
AM_CFLAGS="$AM_CFLAGS -DHAVE_EXT_CACHE"
|
||||
+ AM_CFLAGS="$AM_CFLAGS -DHAVE_SECRET_CALLBACK"
|
||||
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_EITHER_SIDE"
|
||||
AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA_X509_SMALL"
|
||||
|
||||
@ -13,14 +13,14 @@ PKG_RELEASE:=6
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/paulusmack/ppp
|
||||
PKG_SOURCE_DATE:=2020-10-03
|
||||
PKG_SOURCE_VERSION:=ad3937a0a38a696eb1a37dbf8f92e8e6072cdccb
|
||||
PKG_MIRROR_HASH:=c5b39615eb62728431b19f3ae5428eb1e2fc705b4b7b960228fe5b5d7b5a4bca
|
||||
PKG_SOURCE_DATE:=2021-01-04
|
||||
PKG_SOURCE_VERSION:=4fb319056f168bb8379865b91b4fd3e1ada73f1e
|
||||
PKG_MIRROR_HASH:=429cb5fcff36e1d8698766130711d4764347f08b83233dfb4831bea21616efef
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_LICENSE:=BSD-4-Clause
|
||||
PKG_CPE_ID:=cpe:/a:samba:ppp
|
||||
|
||||
PKG_RELEASE_VERSION:=2.4.8
|
||||
PKG_RELEASE_VERSION:=2.4.9
|
||||
PKG_VERSION:=$(PKG_RELEASE_VERSION).git-$(PKG_SOURCE_DATE)
|
||||
|
||||
PKG_BUILD_DEPENDS:=libpcap
|
||||
@ -242,7 +242,7 @@ endef
|
||||
|
||||
define Package/ppp-mod-pppoe/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION)
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_RELEASE_VERSION)/rp-pppoe.so \
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_RELEASE_VERSION)/pppoe.so \
|
||||
$(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION)/
|
||||
endef
|
||||
|
||||
|
||||
@ -241,7 +241,7 @@ proto_pppoe_setup() {
|
||||
|
||||
ppp_generic_setup "$config" \
|
||||
$syncppp_option \
|
||||
plugin rp-pppoe.so \
|
||||
plugin pppoe.so \
|
||||
${ac:+rp_pppoe_ac "$ac"} \
|
||||
${service:+rp_pppoe_service "$service"} \
|
||||
${host_uniq:+host-uniq "$host_uniq"} \
|
||||
@ -338,7 +338,7 @@ proto_pptp_teardown() {
|
||||
|
||||
[ -n "$INCLUDE_ONLY" ] || {
|
||||
add_protocol ppp
|
||||
[ -f /usr/lib/pppd/*/rp-pppoe.so ] && add_protocol pppoe
|
||||
[ -f /usr/lib/pppd/*/pppoe.so ] && add_protocol pppoe
|
||||
[ -f /usr/lib/pppd/*/pppoatm.so ] && add_protocol pppoa
|
||||
[ -f /usr/lib/pppd/*/pptp.so ] && add_protocol pptp
|
||||
}
|
||||
|
||||
@ -9,16 +9,16 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -8,9 +8,9 @@ SYSCONF=/etc
|
||||
# if [ -d /NextApps ]; then
|
||||
# system="NeXTStep"
|
||||
# else
|
||||
@@ -10,9 +10,9 @@ CROSS_COMPILE=
|
||||
CC=cc
|
||||
CFLAGS=
|
||||
|
||||
-system=`uname -s`
|
||||
-release=`uname -r`
|
||||
-arch=`uname -m`
|
||||
+system=${UNAME_S:-`uname -s`}
|
||||
+release=${UNAME_R:-`uname -r`}
|
||||
+arch=${UNAME_M:-`uname -m`}
|
||||
# fi
|
||||
state="unknown"
|
||||
|
||||
case $system in
|
||||
|
||||
@ -1,96 +0,0 @@
|
||||
pppd: Allow specifying ip-up and ip-down scripts
|
||||
|
||||
This patch implements the "ip-up-script" and "ip-down-script" options which
|
||||
allow to specify the path of the ip-up and ip-down scripts to call.
|
||||
|
||||
These options default to _PATH_IPUP and _PATH_IPDOWN to retain the
|
||||
existing behaviour.
|
||||
|
||||
The patch originated from the Debian project.
|
||||
|
||||
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
--- a/pppd/ipcp.c
|
||||
+++ b/pppd/ipcp.c
|
||||
@@ -1957,7 +1957,7 @@ ipcp_up(f)
|
||||
*/
|
||||
if (ipcp_script_state == s_down && ipcp_script_pid == 0) {
|
||||
ipcp_script_state = s_up;
|
||||
- ipcp_script(_PATH_IPUP, 0);
|
||||
+ ipcp_script(path_ipup, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2007,7 +2007,7 @@ ipcp_down(f)
|
||||
/* Execute the ip-down script */
|
||||
if (ipcp_script_state == s_up && ipcp_script_pid == 0) {
|
||||
ipcp_script_state = s_down;
|
||||
- ipcp_script(_PATH_IPDOWN, 0);
|
||||
+ ipcp_script(path_ipdown, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2061,13 +2061,13 @@ ipcp_script_done(arg)
|
||||
case s_up:
|
||||
if (ipcp_fsm[0].state != OPENED) {
|
||||
ipcp_script_state = s_down;
|
||||
- ipcp_script(_PATH_IPDOWN, 0);
|
||||
+ ipcp_script(path_ipdown, 0);
|
||||
}
|
||||
break;
|
||||
case s_down:
|
||||
if (ipcp_fsm[0].state == OPENED) {
|
||||
ipcp_script_state = s_up;
|
||||
- ipcp_script(_PATH_IPUP, 0);
|
||||
+ ipcp_script(path_ipup, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
--- a/pppd/main.c
|
||||
+++ b/pppd/main.c
|
||||
@@ -306,6 +306,9 @@ main(argc, argv)
|
||||
struct protent *protp;
|
||||
char numbuf[16];
|
||||
|
||||
+ strlcpy(path_ipup, _PATH_IPUP, sizeof(path_ipup));
|
||||
+ strlcpy(path_ipdown, _PATH_IPDOWN, sizeof(path_ipdown));
|
||||
+
|
||||
link_stats_valid = 0;
|
||||
new_phase(PHASE_INITIALIZE);
|
||||
|
||||
--- a/pppd/options.c
|
||||
+++ b/pppd/options.c
|
||||
@@ -117,6 +117,8 @@ bool tune_kernel; /* may alter kernel s
|
||||
int connect_delay = 1000; /* wait this many ms after connect script */
|
||||
int req_unit = -1; /* requested interface unit */
|
||||
char req_ifname[MAXIFNAMELEN]; /* requested interface name */
|
||||
+char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */
|
||||
+char path_ipdown[MAXPATHLEN];/* pathname of ip-down script */
|
||||
bool multilink = 0; /* Enable multilink operation */
|
||||
char *bundle_name = NULL; /* bundle name for multilink */
|
||||
bool dump_options; /* print out option values */
|
||||
@@ -316,6 +318,13 @@ option_t general_options[] = {
|
||||
"Metric to use for the default route (Linux only; -1 for default behavior)",
|
||||
OPT_PRIV|OPT_LLIMIT|OPT_INITONLY, NULL, 0, -1 },
|
||||
|
||||
+ { "ip-up-script", o_string, path_ipup,
|
||||
+ "Set pathname of ip-up script",
|
||||
+ OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
|
||||
+ { "ip-down-script", o_string, path_ipdown,
|
||||
+ "Set pathname of ip-down script",
|
||||
+ OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
|
||||
+
|
||||
#ifdef HAVE_MULTILINK
|
||||
{ "multilink", o_bool, &multilink,
|
||||
"Enable multilink operation", OPT_PRIO | 1 },
|
||||
--- a/pppd/pppd.h
|
||||
+++ b/pppd/pppd.h
|
||||
@@ -335,6 +335,8 @@ extern int connect_delay; /* Time to del
|
||||
extern int max_data_rate; /* max bytes/sec through charshunt */
|
||||
extern int req_unit; /* interface unit number to use */
|
||||
extern char req_ifname[MAXIFNAMELEN]; /* interface name to use */
|
||||
+extern char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */
|
||||
+extern char path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */
|
||||
extern bool multilink; /* enable multilink operation */
|
||||
extern bool noendpoint; /* don't send or accept endpt. discrim. */
|
||||
extern char *bundle_name; /* bundle name for multilink */
|
||||
@ -1,28 +0,0 @@
|
||||
pppd: Close already open ppp descriptors
|
||||
|
||||
When using the kernel PPPoE driver in conjunction with the "persist" option,
|
||||
the already open descriptor to /dev/ppp is not closed when the link is
|
||||
reestablished. This eventually leads to high CPU load because the stray
|
||||
descriptors are always reported as ready by select().
|
||||
|
||||
This patch closes the descriptor if it is already open when establishing a
|
||||
new connection. It originated from the Debian project.
|
||||
|
||||
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
--- a/pppd/sys-linux.c
|
||||
+++ b/pppd/sys-linux.c
|
||||
@@ -467,6 +467,13 @@ int generic_establish_ppp (int fd)
|
||||
if (new_style_driver) {
|
||||
int flags;
|
||||
|
||||
+ /* if a ppp_fd is already open, close it first */
|
||||
+ if(ppp_fd > 0) {
|
||||
+ close(ppp_fd);
|
||||
+ remove_fd(ppp_fd);
|
||||
+ ppp_fd = -1;
|
||||
+ }
|
||||
+
|
||||
/* Open an instance of /dev/ppp and connect the channel to it */
|
||||
if (ioctl(fd, PPPIOCGCHAN, &chindex) == -1) {
|
||||
error("Couldn't get channel number: %m");
|
||||
@ -1,23 +0,0 @@
|
||||
pppd: Fix creation of linkpidfile
|
||||
|
||||
When pppd is run without "nodetach" or with "updetach", the linkpidfile is
|
||||
never created. The call to create_linkpidfile() is protected by a check for
|
||||
linkpidfile[0] but this is only filled in when create_linkpidfile() is called.
|
||||
|
||||
This patch changes to code to allways uncondiationally call
|
||||
create_linkpidfile(), it originated from the Debian project.
|
||||
|
||||
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
--- a/pppd/main.c
|
||||
+++ b/pppd/main.c
|
||||
@@ -780,8 +780,7 @@ detach()
|
||||
/* update pid files if they have been written already */
|
||||
if (pidfilename[0])
|
||||
create_pidfile(pid);
|
||||
- if (linkpidfile[0])
|
||||
- create_linkpidfile(pid);
|
||||
+ create_linkpidfile(pid);
|
||||
exit(0); /* parent dies */
|
||||
}
|
||||
setsid();
|
||||
@ -18,7 +18,7 @@
|
||||
#ifdef PPP_FILTER
|
||||
#include <pcap-bpf.h>
|
||||
#endif
|
||||
@@ -220,6 +224,14 @@ loop_chars(p, n)
|
||||
@@ -218,6 +222,14 @@ loop_chars(unsigned char *p, int n)
|
||||
int c, rv;
|
||||
|
||||
rv = 0;
|
||||
@ -33,14 +33,12 @@
|
||||
for (; n > 0; --n) {
|
||||
c = *p++;
|
||||
if (c == PPP_FLAG) {
|
||||
@@ -298,17 +310,102 @@ loop_frame(frame, len)
|
||||
@@ -294,16 +306,100 @@ loop_frame(unsigned char *frame, int len
|
||||
* loopback, now that the real serial link is up.
|
||||
*/
|
||||
void
|
||||
-demand_rexmit(proto)
|
||||
+demand_rexmit(proto, newip)
|
||||
int proto;
|
||||
+ u_int32_t newip;
|
||||
-demand_rexmit(int proto)
|
||||
+demand_rexmit(int proto, u_int32_t newip)
|
||||
{
|
||||
struct packet *pkt, *prev, *nextpkt;
|
||||
+ unsigned short checksum;
|
||||
@ -139,7 +137,7 @@
|
||||
} else {
|
||||
--- a/pppd/ipcp.c
|
||||
+++ b/pppd/ipcp.c
|
||||
@@ -1882,7 +1882,7 @@ ipcp_up(f)
|
||||
@@ -1850,7 +1850,7 @@ ipcp_up(fsm *f)
|
||||
proxy_arp_set[f->unit] = 1;
|
||||
|
||||
}
|
||||
@ -150,7 +148,7 @@
|
||||
} else {
|
||||
--- a/pppd/ipv6cp.c
|
||||
+++ b/pppd/ipv6cp.c
|
||||
@@ -1258,7 +1258,7 @@ ipv6cp_up(f)
|
||||
@@ -1253,7 +1253,7 @@ ipv6cp_up(fsm *f)
|
||||
if (sif6defaultroute(f->unit, go->ourid, ho->hisid))
|
||||
default_route_set[f->unit] = 1;
|
||||
}
|
||||
@ -161,12 +159,12 @@
|
||||
} else {
|
||||
--- a/pppd/pppd.h
|
||||
+++ b/pppd/pppd.h
|
||||
@@ -602,7 +602,7 @@ void demand_conf __P((void)); /* config
|
||||
void demand_block __P((void)); /* set all NPs to queue up packets */
|
||||
void demand_unblock __P((void)); /* set all NPs to pass packets */
|
||||
void demand_discard __P((void)); /* set all NPs to discard packets */
|
||||
-void demand_rexmit __P((int)); /* retransmit saved frames for an NP */
|
||||
+void demand_rexmit __P((int, u_int32_t)); /* retransmit saved frames for an NP*/
|
||||
int loop_chars __P((unsigned char *, int)); /* process chars from loopback */
|
||||
int loop_frame __P((unsigned char *, int)); /* should we bring link up? */
|
||||
@@ -598,7 +598,7 @@ void demand_conf(void); /* config interf
|
||||
void demand_block(void); /* set all NPs to queue up packets */
|
||||
void demand_unblock(void); /* set all NPs to pass packets */
|
||||
void demand_discard(void); /* set all NPs to discard packets */
|
||||
-void demand_rexmit(int); /* retransmit saved frames for an NP */
|
||||
+void demand_rexmit(int, u_int32_t); /* retransmit saved frames for an NP*/
|
||||
int loop_chars(unsigned char *, int); /* process chars from loopback */
|
||||
int loop_frame(unsigned char *, int); /* should we bring link up? */
|
||||
|
||||
|
||||
@ -1,47 +0,0 @@
|
||||
pppd: Implement option to strip domain part from MS CHAP response
|
||||
|
||||
This patch implements a new boolean option "chapms-strip-domain" which
|
||||
strips the leading domain part of the username in a received MS Chap
|
||||
response.
|
||||
|
||||
When the option is set, all leading chars up to and including the last
|
||||
backslash in the username are stripped. The option defaults to false.
|
||||
|
||||
The patch originated from the Debian project.
|
||||
|
||||
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
--- a/pppd/chap-new.c
|
||||
+++ b/pppd/chap-new.c
|
||||
@@ -58,6 +58,7 @@ int (*chap_verify_hook)(char *name, char
|
||||
int chap_timeout_time = 3;
|
||||
int chap_max_transmits = 10;
|
||||
int chap_rechallenge_time = 0;
|
||||
+int chapms_strip_domain = 0;
|
||||
|
||||
/*
|
||||
* Command-line options.
|
||||
@@ -69,6 +70,8 @@ static option_t chap_option_list[] = {
|
||||
"Set max #xmits for challenge", OPT_PRIO },
|
||||
{ "chap-interval", o_int, &chap_rechallenge_time,
|
||||
"Set interval for rechallenge", OPT_PRIO },
|
||||
+ { "chapms-strip-domain", o_bool, &chapms_strip_domain,
|
||||
+ "Strip the domain prefix before the Username", 1 },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
@@ -336,6 +339,14 @@ chap_handle_response(struct chap_server_
|
||||
/* Null terminate and clean remote name. */
|
||||
slprintf(rname, sizeof(rname), "%.*v", len, name);
|
||||
name = rname;
|
||||
+
|
||||
+ /* strip the MS domain name */
|
||||
+ if (chapms_strip_domain && strrchr(rname, '\\')) {
|
||||
+ char tmp[MAXNAMELEN+1];
|
||||
+
|
||||
+ strcpy(tmp, strrchr(rname, '\\') + 1);
|
||||
+ strcpy(rname, tmp);
|
||||
+ }
|
||||
}
|
||||
|
||||
if (chap_verify_hook)
|
||||
@ -1,25 +0,0 @@
|
||||
pppoatm: Allow wildcard ATM devices
|
||||
|
||||
When operating pppd's pppoatm plugin with an USB ADSL modem, e.g. an
|
||||
Alcatel Speedtouch, the ATM device number might change when the modem is
|
||||
reconnected to the USB port or when the host controller resets the USB
|
||||
device.
|
||||
|
||||
This patch allows to specify the ATM device as wildcard which gives
|
||||
enough flexibility to cope with changing device names.
|
||||
|
||||
The patch originated from the Debain project.
|
||||
|
||||
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
--- a/pppd/plugins/pppoatm/pppoatm.c
|
||||
+++ b/pppd/plugins/pppoatm/pppoatm.c
|
||||
@@ -75,7 +75,7 @@ static int setdevname_pppoatm(const char
|
||||
//info("PPPoATM setdevname_pppoatm: '%s'", cp);
|
||||
memset(&addr, 0, sizeof addr);
|
||||
if (text2atm(cp, (struct sockaddr *) &addr, sizeof(addr),
|
||||
- T2A_PVC | T2A_NAME) < 0) {
|
||||
+ T2A_PVC | T2A_NAME | T2A_WILDCARD) < 0) {
|
||||
if(doit)
|
||||
info("atm does not recognize: %s", cp);
|
||||
return 0;
|
||||
@ -1,314 +0,0 @@
|
||||
pppd: Add "replacedefaultroute" and "noreplacedefaultroute" options
|
||||
|
||||
This patch implements two new options, "replacedefaultroute" to replace any
|
||||
existing system default route when specified and "noreplacedefaultroute" to
|
||||
disable the "replacedefaultroute" option, which is useful in multi user
|
||||
environments where the administrator wants to allow users to dial pppd
|
||||
connections but not allow them to change the system default route.
|
||||
|
||||
The patch originated from the Debian project.
|
||||
|
||||
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
--- a/pppd/ipcp.c
|
||||
+++ b/pppd/ipcp.c
|
||||
@@ -197,6 +197,14 @@ static option_t ipcp_option_list[] = {
|
||||
"disable defaultroute option", OPT_ALIAS | OPT_A2CLR,
|
||||
&ipcp_wantoptions[0].default_route },
|
||||
|
||||
+ { "replacedefaultroute", o_bool,
|
||||
+ &ipcp_wantoptions[0].replace_default_route,
|
||||
+ "Replace default route", 1
|
||||
+ },
|
||||
+ { "noreplacedefaultroute", o_bool,
|
||||
+ &ipcp_allowoptions[0].replace_default_route,
|
||||
+ "Never replace default route", OPT_A2COPY,
|
||||
+ &ipcp_wantoptions[0].replace_default_route },
|
||||
{ "proxyarp", o_bool, &ipcp_wantoptions[0].proxy_arp,
|
||||
"Add proxy ARP entry", OPT_ENABLE|1, &ipcp_allowoptions[0].proxy_arp },
|
||||
{ "noproxyarp", o_bool, &ipcp_allowoptions[0].proxy_arp,
|
||||
@@ -270,7 +278,7 @@ struct protent ipcp_protent = {
|
||||
ip_active_pkt
|
||||
};
|
||||
|
||||
-static void ipcp_clear_addrs __P((int, u_int32_t, u_int32_t));
|
||||
+static void ipcp_clear_addrs __P((int, u_int32_t, u_int32_t, bool));
|
||||
static void ipcp_script __P((char *, int)); /* Run an up/down script */
|
||||
static void ipcp_script_done __P((void *));
|
||||
|
||||
@@ -1760,7 +1768,8 @@ ip_demand_conf(u)
|
||||
if (!sifnpmode(u, PPP_IP, NPMODE_QUEUE))
|
||||
return 0;
|
||||
if (wo->default_route)
|
||||
- if (sifdefaultroute(u, wo->ouraddr, wo->hisaddr))
|
||||
+ if (sifdefaultroute(u, wo->ouraddr, wo->hisaddr,
|
||||
+ wo->replace_default_route))
|
||||
default_route_set[u] = 1;
|
||||
if (wo->proxy_arp)
|
||||
if (sifproxyarp(u, wo->hisaddr))
|
||||
@@ -1848,7 +1857,8 @@ ipcp_up(f)
|
||||
*/
|
||||
if (demand) {
|
||||
if (go->ouraddr != wo->ouraddr || ho->hisaddr != wo->hisaddr) {
|
||||
- ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr);
|
||||
+ ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr,
|
||||
+ wo->replace_default_route);
|
||||
if (go->ouraddr != wo->ouraddr) {
|
||||
warn("Local IP address changed to %I", go->ouraddr);
|
||||
script_setenv("OLDIPLOCAL", ip_ntoa(wo->ouraddr), 0);
|
||||
@@ -1873,7 +1883,8 @@ ipcp_up(f)
|
||||
|
||||
/* assign a default route through the interface if required */
|
||||
if (ipcp_wantoptions[f->unit].default_route)
|
||||
- if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr))
|
||||
+ if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr,
|
||||
+ wo->replace_default_route))
|
||||
default_route_set[f->unit] = 1;
|
||||
|
||||
/* Make a proxy ARP entry if requested. */
|
||||
@@ -1923,7 +1934,8 @@ ipcp_up(f)
|
||||
|
||||
/* assign a default route through the interface if required */
|
||||
if (ipcp_wantoptions[f->unit].default_route)
|
||||
- if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr))
|
||||
+ if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr,
|
||||
+ wo->replace_default_route))
|
||||
default_route_set[f->unit] = 1;
|
||||
|
||||
/* Make a proxy ARP entry if requested. */
|
||||
@@ -2001,7 +2013,7 @@ ipcp_down(f)
|
||||
sifnpmode(f->unit, PPP_IP, NPMODE_DROP);
|
||||
sifdown(f->unit);
|
||||
ipcp_clear_addrs(f->unit, ipcp_gotoptions[f->unit].ouraddr,
|
||||
- ipcp_hisoptions[f->unit].hisaddr);
|
||||
+ ipcp_hisoptions[f->unit].hisaddr, 0);
|
||||
}
|
||||
|
||||
/* Execute the ip-down script */
|
||||
@@ -2017,16 +2029,25 @@ ipcp_down(f)
|
||||
* proxy arp entries, etc.
|
||||
*/
|
||||
static void
|
||||
-ipcp_clear_addrs(unit, ouraddr, hisaddr)
|
||||
+ipcp_clear_addrs(unit, ouraddr, hisaddr, replacedefaultroute)
|
||||
int unit;
|
||||
u_int32_t ouraddr; /* local address */
|
||||
u_int32_t hisaddr; /* remote address */
|
||||
+ bool replacedefaultroute;
|
||||
{
|
||||
if (proxy_arp_set[unit]) {
|
||||
cifproxyarp(unit, hisaddr);
|
||||
proxy_arp_set[unit] = 0;
|
||||
}
|
||||
- if (default_route_set[unit]) {
|
||||
+ /* If replacedefaultroute, sifdefaultroute will be called soon
|
||||
+ * with replacedefaultroute set and that will overwrite the current
|
||||
+ * default route. This is the case only when doing demand, otherwise
|
||||
+ * during demand, this cifdefaultroute would restore the old default
|
||||
+ * route which is not what we want in this case. In the non-demand
|
||||
+ * case, we'll delete the default route and restore the old if there
|
||||
+ * is one saved by an sifdefaultroute with replacedefaultroute.
|
||||
+ */
|
||||
+ if (!replacedefaultroute && default_route_set[unit]) {
|
||||
cifdefaultroute(unit, ouraddr, hisaddr);
|
||||
default_route_set[unit] = 0;
|
||||
}
|
||||
--- a/pppd/ipcp.h
|
||||
+++ b/pppd/ipcp.h
|
||||
@@ -70,6 +70,7 @@ typedef struct ipcp_options {
|
||||
bool old_addrs; /* Use old (IP-Addresses) option? */
|
||||
bool req_addr; /* Ask peer to send IP address? */
|
||||
bool default_route; /* Assign default route through interface? */
|
||||
+ bool replace_default_route; /* Replace default route through interface? */
|
||||
bool proxy_arp; /* Make proxy ARP entry for peer? */
|
||||
bool neg_vj; /* Van Jacobson Compression? */
|
||||
bool old_vj; /* use old (short) form of VJ option? */
|
||||
--- a/pppd/pppd.8
|
||||
+++ b/pppd/pppd.8
|
||||
@@ -133,6 +133,11 @@ the gateway, when IPv6CP negotiation is
|
||||
This entry is removed when the PPP connection is broken. This option
|
||||
is privileged if the \fInodefaultroute6\fR option has been specified.
|
||||
.TP
|
||||
+.B replacedefaultroute
|
||||
+This option is a flag to the defaultroute option. If defaultroute is
|
||||
+set and this flag is also set, pppd replaces an existing default route
|
||||
+with the new default route.
|
||||
+.TP
|
||||
.B disconnect \fIscript
|
||||
Execute the command specified by \fIscript\fR, by passing it to a
|
||||
shell, after
|
||||
@@ -756,7 +761,12 @@ disable both forms of hardware flow cont
|
||||
.TP
|
||||
.B nodefaultroute
|
||||
Disable the \fIdefaultroute\fR option. The system administrator who
|
||||
-wishes to prevent users from creating default routes with pppd
|
||||
+wishes to prevent users from adding a default route with pppd
|
||||
+can do so by placing this option in the /etc/ppp/options file.
|
||||
+.TP
|
||||
+.B noreplacedefaultroute
|
||||
+Disable the \fIreplacedefaultroute\fR option. The system administrator who
|
||||
+wishes to prevent users from replacing a default route with pppd
|
||||
can do so by placing this option in the /etc/ppp/options file.
|
||||
.TP
|
||||
.B nodefaultroute6
|
||||
--- a/pppd/pppd.h
|
||||
+++ b/pppd/pppd.h
|
||||
@@ -684,7 +684,7 @@ int sif6addr __P((int, eui64_t, eui64_t
|
||||
int cif6addr __P((int, eui64_t, eui64_t));
|
||||
/* Remove an IPv6 address from i/f */
|
||||
#endif
|
||||
-int sifdefaultroute __P((int, u_int32_t, u_int32_t));
|
||||
+int sifdefaultroute __P((int, u_int32_t, u_int32_t, bool replace_default_rt));
|
||||
/* Create default route through i/f */
|
||||
int cifdefaultroute __P((int, u_int32_t, u_int32_t));
|
||||
/* Delete default route through i/f */
|
||||
--- a/pppd/sys-linux.c
|
||||
+++ b/pppd/sys-linux.c
|
||||
@@ -209,6 +209,8 @@ static int if_is_up; /* Interface has be
|
||||
static int if6_is_up; /* Interface has been marked up for IPv6, to help differentiate */
|
||||
static int have_default_route; /* Gateway for default route added */
|
||||
static int have_default_route6; /* Gateway for default IPv6 route added */
|
||||
+static struct rtentry old_def_rt; /* Old default route */
|
||||
+static int default_rt_repl_rest; /* replace and restore old default rt */
|
||||
static u_int32_t proxy_arp_addr; /* Addr for proxy arp entry added */
|
||||
static char proxy_arp_dev[16]; /* Device for proxy arp entry */
|
||||
static u_int32_t our_old_addr; /* for detecting address changes */
|
||||
@@ -1577,6 +1579,9 @@ static int read_route_table(struct rtent
|
||||
p = NULL;
|
||||
}
|
||||
|
||||
+ SET_SA_FAMILY (rt->rt_dst, AF_INET);
|
||||
+ SET_SA_FAMILY (rt->rt_gateway, AF_INET);
|
||||
+
|
||||
SIN_ADDR(rt->rt_dst) = strtoul(cols[route_dest_col], NULL, 16);
|
||||
SIN_ADDR(rt->rt_gateway) = strtoul(cols[route_gw_col], NULL, 16);
|
||||
SIN_ADDR(rt->rt_genmask) = strtoul(cols[route_mask_col], NULL, 16);
|
||||
@@ -1649,20 +1654,52 @@ int have_route_to(u_int32_t addr)
|
||||
/********************************************************************
|
||||
*
|
||||
* sifdefaultroute - assign a default route through the address given.
|
||||
- */
|
||||
-
|
||||
-int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway)
|
||||
-{
|
||||
- struct rtentry rt;
|
||||
-
|
||||
- if (defaultroute_exists(&rt, dfl_route_metric) && strcmp(rt.rt_dev, ifname) != 0) {
|
||||
- if (rt.rt_flags & RTF_GATEWAY)
|
||||
- error("not replacing existing default route via %I with metric %d",
|
||||
- SIN_ADDR(rt.rt_gateway), dfl_route_metric);
|
||||
- else
|
||||
+ *
|
||||
+ * If the global default_rt_repl_rest flag is set, then this function
|
||||
+ * already replaced the original system defaultroute with some other
|
||||
+ * route and it should just replace the current defaultroute with
|
||||
+ * another one, without saving the current route. Use: demand mode,
|
||||
+ * when pppd sets first a defaultroute it it's temporary ppp0 addresses
|
||||
+ * and then changes the temporary addresses to the addresses for the real
|
||||
+ * ppp connection when it has come up.
|
||||
+ */
|
||||
+
|
||||
+int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway, bool replace)
|
||||
+{
|
||||
+ struct rtentry rt, tmp_rt;
|
||||
+ struct rtentry *del_rt = NULL;
|
||||
+
|
||||
+ if (default_rt_repl_rest) {
|
||||
+ /* We have already reclaced the original defaultroute, if we
|
||||
+ are called again, we will delete the current default route
|
||||
+ and set the new default route in this function.
|
||||
+ - this is normally only the case the doing demand: */
|
||||
+ if (defaultroute_exists(&tmp_rt, dfl_route_metric))
|
||||
+ del_rt = &tmp_rt;
|
||||
+ } else if (defaultroute_exists(&old_def_rt, dfl_route_metric) &&
|
||||
+ strcmp(old_def_rt.rt_dev, ifname) != 0) {
|
||||
+ /* We did not yet replace an existing default route, let's
|
||||
+ check if we should save and replace a default route: */
|
||||
+ if (old_def_rt.rt_flags & RTF_GATEWAY) {
|
||||
+ if (!replace) {
|
||||
+ error("not replacing existing default route via %I with metric %d",
|
||||
+ SIN_ADDR(old_def_rt.rt_gateway), dfl_route_metric);
|
||||
+ return 0;
|
||||
+ } else {
|
||||
+ /* we need to copy rt_dev because we need it permanent too: */
|
||||
+ char *tmp_dev = malloc(strlen(old_def_rt.rt_dev) + 1);
|
||||
+ strcpy(tmp_dev, old_def_rt.rt_dev);
|
||||
+ old_def_rt.rt_dev = tmp_dev;
|
||||
+
|
||||
+ notice("replacing old default route to %s [%I] with metric %d",
|
||||
+ old_def_rt.rt_dev, SIN_ADDR(old_def_rt.rt_gateway),
|
||||
+ dfl_route_metric);
|
||||
+ default_rt_repl_rest = 1;
|
||||
+ del_rt = &old_def_rt;
|
||||
+ }
|
||||
+ } else
|
||||
error("not replacing existing default route through %s with metric %d",
|
||||
- rt.rt_dev, dfl_route_metric);
|
||||
- return 0;
|
||||
+ old_def_rt.rt_dev, dfl_route_metric);
|
||||
}
|
||||
|
||||
memset (&rt, 0, sizeof (rt));
|
||||
@@ -1678,10 +1715,16 @@ int sifdefaultroute (int unit, u_int32_t
|
||||
|
||||
rt.rt_flags = RTF_UP;
|
||||
if (ioctl(sock_fd, SIOCADDRT, &rt) < 0) {
|
||||
- if ( ! ok_error ( errno ))
|
||||
+ if (!ok_error(errno))
|
||||
error("default route ioctl(SIOCADDRT): %m");
|
||||
return 0;
|
||||
}
|
||||
+ if (default_rt_repl_rest && del_rt)
|
||||
+ if (ioctl(sock_fd, SIOCDELRT, del_rt) < 0) {
|
||||
+ if (!ok_error(errno))
|
||||
+ error("del old default route ioctl(SIOCDELRT): %m");
|
||||
+ return 0;
|
||||
+ }
|
||||
|
||||
have_default_route = 1;
|
||||
return 1;
|
||||
@@ -1715,11 +1758,21 @@ int cifdefaultroute (int unit, u_int32_t
|
||||
rt.rt_flags = RTF_UP;
|
||||
if (ioctl(sock_fd, SIOCDELRT, &rt) < 0 && errno != ESRCH) {
|
||||
if (still_ppp()) {
|
||||
- if ( ! ok_error ( errno ))
|
||||
+ if (!ok_error(errno))
|
||||
error("default route ioctl(SIOCDELRT): %m");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+ if (default_rt_repl_rest) {
|
||||
+ notice("restoring old default route to %s [%I]",
|
||||
+ old_def_rt.rt_dev, SIN_ADDR(old_def_rt.rt_gateway));
|
||||
+ if (ioctl(sock_fd, SIOCADDRT, &old_def_rt) < 0) {
|
||||
+ if (!ok_error(errno))
|
||||
+ error("restore default route ioctl(SIOCADDRT): %m");
|
||||
+ return 0;
|
||||
+ }
|
||||
+ default_rt_repl_rest = 0;
|
||||
+ }
|
||||
|
||||
return 1;
|
||||
}
|
||||
--- a/pppd/sys-solaris.c
|
||||
+++ b/pppd/sys-solaris.c
|
||||
@@ -2120,12 +2120,18 @@ cifaddr(u, o, h)
|
||||
* sifdefaultroute - assign a default route through the address given.
|
||||
*/
|
||||
int
|
||||
-sifdefaultroute(u, l, g)
|
||||
+sifdefaultroute(u, l, g, replace)
|
||||
int u;
|
||||
u_int32_t l, g;
|
||||
+ bool replace;
|
||||
{
|
||||
struct rtentry rt;
|
||||
|
||||
+ if (replace) {
|
||||
+ error("replacedefaultroute not supported on this platform");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
#if defined(__USLC__)
|
||||
g = l; /* use the local address as gateway */
|
||||
#endif
|
||||
@ -12,7 +12,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
--- a/pppd/main.c
|
||||
+++ b/pppd/main.c
|
||||
@@ -308,6 +308,8 @@ main(argc, argv)
|
||||
@@ -295,6 +295,8 @@ main(int argc, char *argv[])
|
||||
|
||||
strlcpy(path_ipup, _PATH_IPUP, sizeof(path_ipup));
|
||||
strlcpy(path_ipdown, _PATH_IPDOWN, sizeof(path_ipdown));
|
||||
@ -23,16 +23,16 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
new_phase(PHASE_INITIALIZE);
|
||||
--- a/pppd/options.c
|
||||
+++ b/pppd/options.c
|
||||
@@ -119,6 +119,8 @@ int req_unit = -1; /* requested interfa
|
||||
char req_ifname[MAXIFNAMELEN]; /* requested interface name */
|
||||
@@ -118,6 +118,8 @@ int req_unit = -1; /* requested interfa
|
||||
char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */
|
||||
char path_ipdown[MAXPATHLEN];/* pathname of ip-down script */
|
||||
char req_ifname[MAXIFNAMELEN]; /* requested interface name */
|
||||
+char path_ipv6up[MAXPATHLEN]; /* pathname of ipv6-up script */
|
||||
+char path_ipv6down[MAXPATHLEN];/* pathname of ipv6-down script */
|
||||
bool multilink = 0; /* Enable multilink operation */
|
||||
char *bundle_name = NULL; /* bundle name for multilink */
|
||||
bool dump_options; /* print out option values */
|
||||
@@ -325,6 +327,13 @@ option_t general_options[] = {
|
||||
@@ -324,6 +326,13 @@ option_t general_options[] = {
|
||||
"Set pathname of ip-down script",
|
||||
OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
|
||||
|
||||
@ -48,7 +48,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
"Enable multilink operation", OPT_PRIO | 1 },
|
||||
--- a/pppd/ipv6cp.c
|
||||
+++ b/pppd/ipv6cp.c
|
||||
@@ -1300,7 +1300,7 @@ ipv6cp_up(f)
|
||||
@@ -1295,7 +1295,7 @@ ipv6cp_up(fsm *f)
|
||||
*/
|
||||
if (ipv6cp_script_state == s_down && ipv6cp_script_pid == 0) {
|
||||
ipv6cp_script_state = s_up;
|
||||
@ -57,7 +57,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1352,7 +1352,7 @@ ipv6cp_down(f)
|
||||
@@ -1346,7 +1346,7 @@ ipv6cp_down(fsm *f)
|
||||
/* Execute the ipv6-down script */
|
||||
if (ipv6cp_script_state == s_up && ipv6cp_script_pid == 0) {
|
||||
ipv6cp_script_state = s_down;
|
||||
@ -66,7 +66,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1395,13 +1395,13 @@ ipv6cp_script_done(arg)
|
||||
@@ -1384,13 +1384,13 @@ ipv6cp_script_done(void *arg)
|
||||
case s_up:
|
||||
if (ipv6cp_fsm[0].state != OPENED) {
|
||||
ipv6cp_script_state = s_down;
|
||||
@ -84,10 +84,10 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
}
|
||||
--- a/pppd/pppd.h
|
||||
+++ b/pppd/pppd.h
|
||||
@@ -337,6 +337,8 @@ extern int req_unit; /* interface unit n
|
||||
extern char req_ifname[MAXIFNAMELEN]; /* interface name to use */
|
||||
@@ -328,6 +328,8 @@ extern int req_unit; /* interface unit n
|
||||
extern char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */
|
||||
extern char path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */
|
||||
extern char req_ifname[MAXIFNAMELEN]; /* interface name to use */
|
||||
+extern char path_ipv6up[MAXPATHLEN]; /* pathname of ipv6-up script */
|
||||
+extern char path_ipv6down[MAXPATHLEN]; /* pathname of ipv6-down script */
|
||||
extern bool multilink; /* enable multilink operation */
|
||||
|
||||
@ -1,36 +0,0 @@
|
||||
--- a/pppd/plugins/rp-pppoe/pppoe.h
|
||||
+++ b/pppd/plugins/rp-pppoe/pppoe.h
|
||||
@@ -48,11 +48,7 @@
|
||||
#include <netinet/in.h>
|
||||
|
||||
/* Ugly header files on some Linux boxes... */
|
||||
-#if defined(HAVE_LINUX_IF_H)
|
||||
-#include <linux/if.h>
|
||||
-#elif defined(HAVE_NET_IF_H)
|
||||
#include <net/if.h>
|
||||
-#endif
|
||||
|
||||
#ifdef HAVE_NET_IF_TYPES_H
|
||||
#include <net/if_types.h>
|
||||
@@ -80,20 +76,7 @@ typedef unsigned long UINT32_t;
|
||||
#error Could not find a 32-bit integer type
|
||||
#endif
|
||||
|
||||
-#ifdef HAVE_LINUX_IF_ETHER_H
|
||||
-#include <linux/if_ether.h>
|
||||
-#endif
|
||||
-
|
||||
-#ifdef HAVE_NETINET_IF_ETHER_H
|
||||
-#include <sys/types.h>
|
||||
-
|
||||
-#ifdef HAVE_SYS_SOCKET_H
|
||||
-#include <sys/socket.h>
|
||||
-#endif
|
||||
-#ifndef HAVE_SYS_DLPI_H
|
||||
-#include <netinet/if_ether.h>
|
||||
-#endif
|
||||
-#endif
|
||||
+#include <net/ethernet.h>
|
||||
|
||||
|
||||
/* Ethernet frame types according to RFC 2516 */
|
||||
@ -7,7 +7,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
--- a/pppd/Makefile.linux
|
||||
+++ b/pppd/Makefile.linux
|
||||
@@ -48,7 +48,7 @@ MPPE=y
|
||||
@@ -49,7 +49,7 @@ MPPE=y
|
||||
# Uncomment the next line to include support for PPP packet filtering.
|
||||
# This requires that the libpcap library and headers be installed
|
||||
# and that the kernel driver support PPP packet filtering.
|
||||
@ -16,7 +16,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
# Uncomment the next line to enable multilink PPP (enabled by default)
|
||||
# Linux distributions: Please leave multilink ENABLED in your builds
|
||||
@@ -58,7 +58,7 @@ HAVE_MULTILINK=y
|
||||
@@ -59,7 +59,7 @@ HAVE_MULTILINK=y
|
||||
# Uncomment the next line to enable the TDB database (enabled by default.)
|
||||
# If you enable multilink, then TDB is automatically enabled also.
|
||||
# Linux distributions: Please leave TDB ENABLED in your builds.
|
||||
@ -25,21 +25,28 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
# Uncomment the next line to enable Type=notify services in systemd
|
||||
# If enabled, and the user sets the up_sdnotify option, then
|
||||
@@ -85,7 +85,7 @@ MAXOCTETS=y
|
||||
@@ -85,13 +85,13 @@ USE_LIBUTIL=y
|
||||
endif
|
||||
|
||||
# Enable EAP-TLS authentication (requires MPPE support, libssl and libcrypto)
|
||||
-USE_EAPTLS=y
|
||||
+#USE_EAPTLS=y
|
||||
|
||||
MAXOCTETS=y
|
||||
|
||||
INCLUDE_DIRS= -I../include
|
||||
|
||||
-COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP
|
||||
+COMPILE_FLAGS= -DHAVE_PATHS_H -DHAVE_MMAP
|
||||
-COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP -pipe
|
||||
+COMPILE_FLAGS= -DHAVE_PATHS_H -DHAVE_MMAP -pipe
|
||||
|
||||
CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"'
|
||||
|
||||
@@ -126,10 +126,10 @@ CFLAGS += -DHAS_SHADOW
|
||||
@@ -143,10 +143,10 @@ CFLAGS += -DHAS_SHADOW
|
||||
#LIBS += -lshadow $(LIBS)
|
||||
endif
|
||||
|
||||
-ifneq ($(wildcard $(shell $(CC) --print-sysroot)/usr/include/crypt.h),)
|
||||
+#ifneq ($(wildcard $(shell $(CC) --print-sysroot)/usr/include/crypt.h),)
|
||||
-ifeq ($(shell echo '\#include <crypt.h>' | $(CC) -E - >/dev/null 2>&1 && echo yes),yes)
|
||||
+#ifeq ($(shell echo '\#include <crypt.h>' | $(CC) -E - >/dev/null 2>&1 && echo yes),yes)
|
||||
CFLAGS += -DHAVE_CRYPT_H=1
|
||||
LIBS += -lcrypt
|
||||
-endif
|
||||
|
||||
@ -88,7 +88,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
*/
|
||||
--- a/pppd/ccp.c
|
||||
+++ b/pppd/ccp.c
|
||||
@@ -61,12 +61,10 @@ static int setdeflate __P((char **));
|
||||
@@ -61,12 +61,10 @@ static int setdeflate (char **);
|
||||
static char bsd_value[8];
|
||||
static char deflate_value[8];
|
||||
|
||||
@ -197,7 +197,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
/*
|
||||
* Local state (mainly for handling reset-reqs and reset-acks).
|
||||
@@ -343,6 +323,100 @@ setdeflate(argv)
|
||||
@@ -341,6 +321,100 @@ setdeflate(char **argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -298,7 +298,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
/*
|
||||
* ccp_init - initialize CCP.
|
||||
*/
|
||||
@@ -377,6 +451,30 @@ ccp_init(unit)
|
||||
@@ -374,6 +448,30 @@ ccp_init(int unit)
|
||||
ccp_allowoptions[0].bsd_bits = BSD_MAX_BITS;
|
||||
|
||||
ccp_allowoptions[0].predictor_1 = 1;
|
||||
@ -329,7 +329,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -454,11 +552,11 @@ ccp_input(unit, p, len)
|
||||
@@ -443,11 +541,11 @@ ccp_input(int unit, u_char *p, int len)
|
||||
if (oldstate == OPENED && p[0] == TERMREQ && f->state != OPENED) {
|
||||
notice("Compression disabled by peer.");
|
||||
#ifdef MPPE
|
||||
@ -343,7 +343,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -486,6 +584,15 @@ ccp_extcode(f, code, id, p, len)
|
||||
@@ -471,6 +569,15 @@ ccp_extcode(fsm *f, int code, int id, u_
|
||||
break;
|
||||
/* send a reset-ack, which the transmitter will see and
|
||||
reset its compression state. */
|
||||
@ -359,7 +359,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
fsm_sdata(f, CCP_RESETACK, id, NULL, 0);
|
||||
break;
|
||||
|
||||
@@ -514,12 +621,11 @@ ccp_protrej(unit)
|
||||
@@ -498,12 +605,11 @@ ccp_protrej(int unit)
|
||||
fsm_lowerdown(&ccp_fsm[unit]);
|
||||
|
||||
#ifdef MPPE
|
||||
@ -374,7 +374,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -536,7 +642,7 @@ ccp_resetci(f)
|
||||
@@ -519,7 +625,7 @@ ccp_resetci(fsm *f)
|
||||
all_rejected[f->unit] = 0;
|
||||
|
||||
#ifdef MPPE
|
||||
@ -382,11 +382,27 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
+ if (go->mppe || go->mppc) {
|
||||
ccp_options *ao = &ccp_allowoptions[f->unit];
|
||||
int auth_mschap_bits = auth_done[f->unit];
|
||||
int numbits;
|
||||
@@ -550,80 +656,109 @@ ccp_resetci(f)
|
||||
#ifdef USE_EAPTLS
|
||||
@@ -536,95 +642,124 @@ ccp_resetci(fsm *f)
|
||||
* NB: If MPPE is required, all other compression opts are invalid.
|
||||
* So, we return right away if we can't do it.
|
||||
*/
|
||||
-
|
||||
- /* Leave only the mschap auth bits set */
|
||||
- auth_mschap_bits &= (CHAP_MS_WITHPEER | CHAP_MS_PEER |
|
||||
- CHAP_MS2_WITHPEER | CHAP_MS2_PEER);
|
||||
- /* Count the mschap auths */
|
||||
- auth_mschap_bits >>= CHAP_MS_SHIFT;
|
||||
- numbits = 0;
|
||||
- do {
|
||||
- numbits += auth_mschap_bits & 1;
|
||||
- auth_mschap_bits >>= 1;
|
||||
- } while (auth_mschap_bits);
|
||||
- if (numbits > 1) {
|
||||
- error("MPPE required, but auth done in both directions.");
|
||||
- lcp_close(f->unit, "MPPE required but not available");
|
||||
- return;
|
||||
- }
|
||||
+ if (ccp_wantoptions[f->unit].mppe) {
|
||||
+ /* Leave only the mschap auth bits set */
|
||||
+ auth_mschap_bits &= (CHAP_MS_WITHPEER | CHAP_MS_PEER |
|
||||
@ -403,33 +419,42 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
+ lcp_close(f->unit, "MPPE required but not available");
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
#ifdef USE_EAPTLS
|
||||
- /*
|
||||
- * MPPE is also possible in combination with EAP-TLS.
|
||||
- * It is not possible to detect if we're doing EAP or EAP-TLS
|
||||
- * at this stage, hence we accept all forms of EAP. If TLS is
|
||||
- * not used then the MPPE keys will not be derived anyway.
|
||||
- */
|
||||
- /* Leave only the eap auth bits set */
|
||||
- auth_eap_bits &= (EAP_WITHPEER | EAP_PEER );
|
||||
+ /*
|
||||
+ * MPPE is also possible in combination with EAP-TLS.
|
||||
+ * It is not possible to detect if we're doing EAP or EAP-TLS
|
||||
+ * at this stage, hence we accept all forms of EAP. If TLS is
|
||||
+ * not used then the MPPE keys will not be derived anyway.
|
||||
+ */
|
||||
+ /* Leave only the eap auth bits set */
|
||||
+ auth_eap_bits &= (EAP_WITHPEER | EAP_PEER );
|
||||
|
||||
- if ((numbits == 0) && (auth_eap_bits == 0)) {
|
||||
- error("MPPE required, but MS-CHAP[v2] nor EAP-TLS auth are performed.");
|
||||
+ if ((numbits == 0) && (auth_eap_bits == 0)) {
|
||||
+ error("MPPE required, but MS-CHAP[v2] nor EAP-TLS auth are performed.");
|
||||
#else
|
||||
- if (!numbits) {
|
||||
- error("MPPE required, but MS-CHAP[v2] auth not performed.");
|
||||
+ if (!numbits) {
|
||||
+ error("MPPE required, but MS-CHAP[v2] auth not performed.");
|
||||
#endif
|
||||
- lcp_close(f->unit, "MPPE required but not available");
|
||||
- return;
|
||||
- }
|
||||
+ lcp_close(f->unit, "MPPE required but not available");
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
- /* Leave only the mschap auth bits set */
|
||||
- auth_mschap_bits &= (CHAP_MS_WITHPEER | CHAP_MS_PEER |
|
||||
- CHAP_MS2_WITHPEER | CHAP_MS2_PEER);
|
||||
- /* Count the mschap auths */
|
||||
- auth_mschap_bits >>= CHAP_MS_SHIFT;
|
||||
- numbits = 0;
|
||||
- do {
|
||||
- numbits += auth_mschap_bits & 1;
|
||||
- auth_mschap_bits >>= 1;
|
||||
- } while (auth_mschap_bits);
|
||||
- if (numbits > 1) {
|
||||
- error("MPPE required, but auth done in both directions.");
|
||||
- lcp_close(f->unit, "MPPE required but not available");
|
||||
- return;
|
||||
- }
|
||||
- if (!numbits) {
|
||||
- error("MPPE required, but MS-CHAP[v2] auth not performed.");
|
||||
- lcp_close(f->unit, "MPPE required but not available");
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- /* A plugin (eg radius) may not have obtained key material. */
|
||||
- if (!mppe_keys_set) {
|
||||
- error("MPPE required, but keys are not available. "
|
||||
@ -559,7 +584,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
if (go->bsd_compress) {
|
||||
opt_buf[0] = CI_BSD_COMPRESS;
|
||||
opt_buf[1] = CILEN_BSD_COMPRESS;
|
||||
@@ -679,7 +814,8 @@ ccp_cilen(f)
|
||||
@@ -679,7 +814,8 @@ static int
|
||||
+ (go->deflate && go->deflate_draft? CILEN_DEFLATE: 0)
|
||||
+ (go->predictor_1? CILEN_PREDICTOR_1: 0)
|
||||
+ (go->predictor_2? CILEN_PREDICTOR_2: 0)
|
||||
@ -569,7 +594,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -693,6 +829,8 @@ ccp_addci(f, p, lenp)
|
||||
@@ -690,6 +826,8 @@ static void
|
||||
{
|
||||
int res;
|
||||
ccp_options *go = &ccp_gotoptions[f->unit];
|
||||
@ -578,7 +603,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
u_char *p0 = p;
|
||||
|
||||
/*
|
||||
@@ -701,22 +839,43 @@ ccp_addci(f, p, lenp)
|
||||
@@ -698,22 +836,43 @@ static void
|
||||
* in case it gets Acked.
|
||||
*/
|
||||
#ifdef MPPE
|
||||
@ -631,7 +656,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
if (go->deflate) {
|
||||
p[0] = go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT;
|
||||
p[1] = CILEN_DEFLATE;
|
||||
@@ -802,7 +961,7 @@ ccp_addci(f, p, lenp)
|
||||
@@ -799,30 +958,50 @@ static void
|
||||
|
||||
/*
|
||||
* ccp_ackci - process a received configure-ack, and return
|
||||
@ -639,9 +664,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
+ * 1 if the packet was OK.
|
||||
*/
|
||||
static int
|
||||
ccp_ackci(f, p, len)
|
||||
@@ -811,24 +970,44 @@ ccp_ackci(f, p, len)
|
||||
int len;
|
||||
ccp_ackci(fsm *f, u_char *p, int len)
|
||||
{
|
||||
ccp_options *go = &ccp_gotoptions[f->unit];
|
||||
+ ccp_options *ao = &ccp_allowoptions[f->unit];
|
||||
@ -694,8 +717,8 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
if (go->deflate) {
|
||||
if (len < CILEN_DEFLATE
|
||||
|| p[0] != (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT)
|
||||
@@ -901,6 +1080,8 @@ ccp_nakci(f, p, len, treat_as_reject)
|
||||
int treat_as_reject;
|
||||
@@ -891,6 +1070,8 @@ static int
|
||||
ccp_nakci(fsm *f, u_char *p, int len, int treat_as_reject)
|
||||
{
|
||||
ccp_options *go = &ccp_gotoptions[f->unit];
|
||||
+ ccp_options *ao = &ccp_allowoptions[f->unit];
|
||||
@ -703,7 +726,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
ccp_options no; /* options we've seen already */
|
||||
ccp_options try; /* options to ask for next time */
|
||||
|
||||
@@ -908,28 +1089,100 @@ ccp_nakci(f, p, len, treat_as_reject)
|
||||
@@ -898,28 +1079,100 @@ static int
|
||||
try = *go;
|
||||
|
||||
#ifdef MPPE
|
||||
@ -822,7 +845,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
if (go->deflate && len >= CILEN_DEFLATE
|
||||
&& p[0] == (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT)
|
||||
&& p[1] == CILEN_DEFLATE) {
|
||||
@@ -1002,14 +1255,50 @@ ccp_rejci(f, p, len)
|
||||
@@ -989,14 +1242,50 @@ ccp_rejci(fsm *f, u_char *p, int len)
|
||||
return -1;
|
||||
|
||||
#ifdef MPPE
|
||||
@ -877,8 +900,8 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
if (go->deflate_correct && len >= CILEN_DEFLATE
|
||||
&& p[0] == CI_DEFLATE && p[1] == CILEN_DEFLATE) {
|
||||
if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size)
|
||||
@@ -1073,14 +1362,15 @@ ccp_reqci(f, p, lenp, dont_nak)
|
||||
int dont_nak;
|
||||
@@ -1056,14 +1345,15 @@ static int
|
||||
ccp_reqci(fsm *f, u_char *p, int *lenp, int dont_nak)
|
||||
{
|
||||
int ret, newret, res;
|
||||
- u_char *p0, *retp;
|
||||
@ -897,7 +920,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
ret = CONFACK;
|
||||
retp = p0 = p;
|
||||
@@ -1103,106 +1393,302 @@ ccp_reqci(f, p, lenp, dont_nak)
|
||||
@@ -1086,106 +1376,302 @@ ccp_reqci(fsm *f, u_char *p, int *lenp,
|
||||
switch (type) {
|
||||
#ifdef MPPE
|
||||
case CI_MPPE:
|
||||
@ -910,10 +933,6 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
-
|
||||
- /* Nak if anything unsupported or unknown are set. */
|
||||
- if (ho->mppe & MPPE_OPT_UNSUPPORTED) {
|
||||
- newret = CONFNAK;
|
||||
- ho->mppe &= ~MPPE_OPT_UNSUPPORTED;
|
||||
- }
|
||||
- if (ho->mppe & MPPE_OPT_UNKNOWN) {
|
||||
+ p2 = p[2];
|
||||
+ p5 = p[5];
|
||||
+ /* not sure what they want, tell 'em what we got */
|
||||
@ -922,6 +941,10 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
+ MPPE_MPPC)) != 0 || p[5] == 0) ||
|
||||
+ (p[2] == 0 && p[3] == 0 && p[4] == 0 && p[5] == 0)) {
|
||||
newret = CONFNAK;
|
||||
- ho->mppe &= ~MPPE_OPT_UNSUPPORTED;
|
||||
- }
|
||||
- if (ho->mppe & MPPE_OPT_UNKNOWN) {
|
||||
- newret = CONFNAK;
|
||||
- ho->mppe &= ~MPPE_OPT_UNKNOWN;
|
||||
- }
|
||||
-
|
||||
@ -1293,7 +1316,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
case CI_DEFLATE:
|
||||
case CI_DEFLATE_DRAFT:
|
||||
if (!ao->deflate || clen != CILEN_DEFLATE
|
||||
@@ -1344,12 +1830,6 @@ ccp_reqci(f, p, lenp, dont_nak)
|
||||
@@ -1327,12 +1813,6 @@ ccp_reqci(fsm *f, u_char *p, int *lenp,
|
||||
else
|
||||
*lenp = retp - p0;
|
||||
}
|
||||
@ -1306,7 +1329,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1371,24 +1851,35 @@ method_name(opt, opt2)
|
||||
@@ -1353,24 +1833,35 @@ method_name(ccp_options *opt, ccp_option
|
||||
char *p = result;
|
||||
char *q = result + sizeof(result); /* 1 past result */
|
||||
|
||||
@ -1358,7 +1381,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
case CI_DEFLATE:
|
||||
case CI_DEFLATE_DRAFT:
|
||||
if (opt2 != NULL && opt2->deflate_size != opt->deflate_size)
|
||||
@@ -1444,12 +1935,12 @@ ccp_up(f)
|
||||
@@ -1425,12 +1916,12 @@ ccp_up(fsm *f)
|
||||
} else if (ANY_COMPRESS(*ho))
|
||||
notice("%s transmit compression enabled", method_name(ho, NULL));
|
||||
#ifdef MPPE
|
||||
@ -1373,7 +1396,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1472,7 +1963,7 @@ ccp_down(f)
|
||||
@@ -1452,7 +1943,7 @@ ccp_down(fsm *f)
|
||||
lcp_close(f->unit, "MPPE disabled");
|
||||
}
|
||||
}
|
||||
@ -1382,7 +1405,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1532,24 +2023,28 @@ ccp_printpkt(p, plen, printer, arg)
|
||||
@@ -1509,24 +2000,28 @@ ccp_printpkt(u_char *p, int plen,
|
||||
#ifdef MPPE
|
||||
case CI_MPPE:
|
||||
if (optlen >= CILEN_MPPE) {
|
||||
@ -1423,7 +1446,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
case CI_DEFLATE:
|
||||
case CI_DEFLATE_DRAFT:
|
||||
if (optlen >= CILEN_DEFLATE) {
|
||||
@@ -1635,6 +2130,7 @@ ccp_datainput(unit, pkt, len)
|
||||
@@ -1609,6 +2104,7 @@ ccp_datainput(int unit, u_char *pkt, int
|
||||
error("Lost compression sync: disabling compression");
|
||||
ccp_close(unit, "Lost compression sync");
|
||||
#ifdef MPPE
|
||||
@ -1431,7 +1454,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
/*
|
||||
* If we were doing MPPE, we must also take the link down.
|
||||
*/
|
||||
@@ -1642,9 +2138,18 @@ ccp_datainput(unit, pkt, len)
|
||||
@@ -1616,9 +2112,18 @@ ccp_datainput(int unit, u_char *pkt, int
|
||||
error("Too many MPPE errors, closing LCP");
|
||||
lcp_close(unit, "Too many MPPE errors");
|
||||
}
|
||||
|
||||
@ -1,88 +0,0 @@
|
||||
build: Do not strip binaries on install
|
||||
|
||||
Strippign executables should be handled by the distro packaging, not by ppp
|
||||
itself. This patch removes the "-s" (strip) switch from all "install" commands
|
||||
in order to install unstripped binaries into the destination prefix.
|
||||
|
||||
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
--- a/chat/Makefile.linux
|
||||
+++ b/chat/Makefile.linux
|
||||
@@ -25,7 +25,7 @@ chat.o: chat.c
|
||||
|
||||
install: chat
|
||||
mkdir -p $(BINDIR) $(MANDIR)
|
||||
- $(INSTALL) -s -c chat $(BINDIR)
|
||||
+ $(INSTALL) -c chat $(BINDIR)
|
||||
$(INSTALL) -c -m 644 chat.8 $(MANDIR)
|
||||
|
||||
clean:
|
||||
--- a/pppd/Makefile.linux
|
||||
+++ b/pppd/Makefile.linux
|
||||
@@ -108,7 +108,7 @@ ifdef USE_SRP
|
||||
CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
|
||||
LIBS += -lsrp -L/usr/local/ssl/lib -lcrypto
|
||||
TARGETS += srp-entry
|
||||
-EXTRAINSTALL = $(INSTALL) -s -c -m 555 srp-entry $(BINDIR)/srp-entry
|
||||
+EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry
|
||||
MANPAGES += srp-entry.8
|
||||
EXTRACLEAN += srp-entry.o
|
||||
NEEDDES=y
|
||||
@@ -220,7 +220,7 @@ all: $(TARGETS)
|
||||
install: pppd
|
||||
mkdir -p $(BINDIR) $(MANDIR)
|
||||
$(EXTRAINSTALL)
|
||||
- $(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd
|
||||
+ $(INSTALL) -c -m 555 pppd $(BINDIR)/pppd
|
||||
if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
|
||||
chmod o-rx,u+s $(BINDIR)/pppd; fi
|
||||
$(INSTALL) -c -m 444 pppd.8 $(MANDIR)
|
||||
--- a/pppd/plugins/radius/Makefile.linux
|
||||
+++ b/pppd/plugins/radius/Makefile.linux
|
||||
@@ -36,9 +36,9 @@ all: $(PLUGIN)
|
||||
|
||||
install: all
|
||||
$(INSTALL) -d -m 755 $(LIBDIR)
|
||||
- $(INSTALL) -s -c -m 755 radius.so $(LIBDIR)
|
||||
- $(INSTALL) -s -c -m 755 radattr.so $(LIBDIR)
|
||||
- $(INSTALL) -s -c -m 755 radrealms.so $(LIBDIR)
|
||||
+ $(INSTALL) -c -m 755 radius.so $(LIBDIR)
|
||||
+ $(INSTALL) -c -m 755 radattr.so $(LIBDIR)
|
||||
+ $(INSTALL) -c -m 755 radrealms.so $(LIBDIR)
|
||||
$(INSTALL) -c -m 444 pppd-radius.8 $(MANDIR)
|
||||
$(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)
|
||||
|
||||
--- a/pppd/plugins/rp-pppoe/Makefile.linux
|
||||
+++ b/pppd/plugins/rp-pppoe/Makefile.linux
|
||||
@@ -43,9 +43,9 @@ rp-pppoe.so: plugin.o discovery.o if.o c
|
||||
|
||||
install: all
|
||||
$(INSTALL) -d -m 755 $(LIBDIR)
|
||||
- $(INSTALL) -s -c -m 4550 rp-pppoe.so $(LIBDIR)
|
||||
+ $(INSTALL) -c -m 4550 rp-pppoe.so $(LIBDIR)
|
||||
$(INSTALL) -d -m 755 $(BINDIR)
|
||||
- $(INSTALL) -s -c -m 555 pppoe-discovery $(BINDIR)
|
||||
+ $(INSTALL) -c -m 555 pppoe-discovery $(BINDIR)
|
||||
|
||||
clean:
|
||||
rm -f *.o *.so pppoe-discovery
|
||||
--- a/pppdump/Makefile.linux
|
||||
+++ b/pppdump/Makefile.linux
|
||||
@@ -17,5 +17,5 @@ clean:
|
||||
|
||||
install:
|
||||
mkdir -p $(BINDIR) $(MANDIR)
|
||||
- $(INSTALL) -s -c pppdump $(BINDIR)
|
||||
+ $(INSTALL) -c pppdump $(BINDIR)
|
||||
$(INSTALL) -c -m 444 pppdump.8 $(MANDIR)
|
||||
--- a/pppstats/Makefile.linux
|
||||
+++ b/pppstats/Makefile.linux
|
||||
@@ -22,7 +22,7 @@ all: pppstats
|
||||
|
||||
install: pppstats
|
||||
-mkdir -p $(MANDIR)
|
||||
- $(INSTALL) -s -c pppstats $(BINDIR)
|
||||
+ $(INSTALL) -c pppstats $(BINDIR)
|
||||
$(INSTALL) -c -m 444 pppstats.8 $(MANDIR)
|
||||
|
||||
pppstats: $(PPPSTATSRCS)
|
||||
@ -8,17 +8,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
--- a/pppd/plugins/radius/Makefile.linux
|
||||
+++ b/pppd/plugins/radius/Makefile.linux
|
||||
@@ -12,7 +12,8 @@ VERSION = $(shell awk -F '"' '/VERSION/
|
||||
INSTALL = install
|
||||
|
||||
PLUGIN=radius.so radattr.so radrealms.so
|
||||
-CFLAGS=-I. -I../.. -I../../../include -O2 -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
|
||||
+COPTS = -O2
|
||||
+CFLAGS=-I. -I../.. -I../../../include $(COPTS) -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
|
||||
|
||||
# Uncomment the next line to include support for Microsoft's
|
||||
# MS-CHAP authentication protocol.
|
||||
@@ -43,13 +44,13 @@ install: all
|
||||
@@ -47,13 +47,13 @@ install: all
|
||||
$(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)
|
||||
|
||||
radius.so: radius.o libradiusclient.a
|
||||
@ -35,26 +25,14 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
CLIENTOBJS = avpair.o buildreq.o config.o dict.o ip_util.o \
|
||||
clientid.o sendserver.o lock.o util.o md5.o
|
||||
--- a/pppdump/Makefile.linux
|
||||
+++ b/pppdump/Makefile.linux
|
||||
@@ -2,7 +2,8 @@ DESTDIR = $(INSTROOT)@DESTDIR@
|
||||
BINDIR = $(DESTDIR)/sbin
|
||||
MANDIR = $(DESTDIR)/share/man/man8
|
||||
|
||||
-CFLAGS= -O -I../include/net
|
||||
+COPTS = -O
|
||||
+CFLAGS= $(COPTS) -I../include/net
|
||||
OBJS = pppdump.o bsd-comp.o deflate.o zlib.o
|
||||
|
||||
INSTALL= install
|
||||
--- a/pppd/plugins/rp-pppoe/Makefile.linux
|
||||
+++ b/pppd/plugins/rp-pppoe/Makefile.linux
|
||||
@@ -39,7 +39,7 @@ debug.o: debug.c
|
||||
--- a/pppd/plugins/pppoe/Makefile.linux
|
||||
+++ b/pppd/plugins/pppoe/Makefile.linux
|
||||
@@ -38,7 +38,7 @@ debug.o: debug.c
|
||||
$(CC) $(CFLAGS) -I../../.. -c -o debug.o debug.c
|
||||
|
||||
rp-pppoe.so: plugin.o discovery.o if.o common.o
|
||||
- $(CC) $(LDFLAGS) -o rp-pppoe.so -shared plugin.o discovery.o if.o common.o
|
||||
+ $(CC) $(LDFLAGS) -fPIC -o rp-pppoe.so -shared plugin.o discovery.o if.o common.o
|
||||
pppoe.so: plugin.o discovery.o if.o common.o
|
||||
- $(CC) $(LDFLAGS) -o pppoe.so -shared plugin.o discovery.o if.o common.o
|
||||
+ $(CC) $(LDFLAGS) -fPIC -o pppoe.so -shared plugin.o discovery.o if.o common.o
|
||||
|
||||
install: all
|
||||
$(INSTALL) -d -m 755 $(LIBDIR)
|
||||
|
||||
@ -5,8 +5,8 @@ discovery attempts.
|
||||
|
||||
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
--- a/pppd/plugins/rp-pppoe/discovery.c
|
||||
+++ b/pppd/plugins/rp-pppoe/discovery.c
|
||||
--- a/pppd/plugins/pppoe/discovery.c
|
||||
+++ b/pppd/plugins/pppoe/discovery.c
|
||||
@@ -632,7 +632,9 @@ discovery(PPPoEConnection *conn)
|
||||
conn->discoveryState = STATE_SENT_PADI;
|
||||
waitForPADO(conn, timeout);
|
||||
|
||||
@ -8,7 +8,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
--- a/pppd/lcp.c
|
||||
+++ b/pppd/lcp.c
|
||||
@@ -1916,12 +1916,12 @@ lcp_up(f)
|
||||
@@ -1862,12 +1862,12 @@ lcp_up(fsm *f)
|
||||
* the interface MTU is set to the lowest of that, the
|
||||
* MTU we want to use, and our link MRU.
|
||||
*/
|
||||
|
||||
@ -12,7 +12,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
--- a/pppd/main.c
|
||||
+++ b/pppd/main.c
|
||||
@@ -1052,7 +1052,8 @@ get_input()
|
||||
@@ -1034,7 +1034,8 @@ get_input(void)
|
||||
}
|
||||
notice("Modem hangup");
|
||||
hungup = 1;
|
||||
|
||||
@ -7,14 +7,14 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
--- a/pppd/Makefile.linux
|
||||
+++ b/pppd/Makefile.linux
|
||||
@@ -190,8 +190,8 @@ endif
|
||||
@@ -210,8 +210,8 @@ LIBS += -ldl
|
||||
endif
|
||||
|
||||
ifdef FILTER
|
||||
ifneq ($(wildcard /usr/include/pcap-bpf.h),)
|
||||
-LIBS += -lpcap
|
||||
-CFLAGS += -DPPP_FILTER
|
||||
+LIBS += -lpcap -L$(STAGING_DIR)/usr/lib
|
||||
+CFLAGS += -DPPP_FILTER -I$(STAGING_DIR)/usr/include
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef HAVE_INET6
|
||||
|
||||
@ -13,7 +13,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
--- a/pppd/Makefile.linux
|
||||
+++ b/pppd/Makefile.linux
|
||||
@@ -50,6 +50,9 @@ MPPE=y
|
||||
@@ -51,6 +51,9 @@ MPPE=y
|
||||
# and that the kernel driver support PPP packet filtering.
|
||||
#FILTER=y
|
||||
|
||||
@ -23,8 +23,8 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
# Uncomment the next line to enable multilink PPP (enabled by default)
|
||||
# Linux distributions: Please leave multilink ENABLED in your builds
|
||||
# of pppd!
|
||||
@@ -195,6 +198,14 @@ CFLAGS += -DPPP_FILTER -I$(STAGING_DIR)
|
||||
endif
|
||||
@@ -214,6 +217,14 @@ LIBS += -lpcap -L$(STAGING_DIR)/usr/l
|
||||
CFLAGS += -DPPP_FILTER -I$(STAGING_DIR)/usr/include
|
||||
endif
|
||||
|
||||
+ifdef PRECOMPILED_FILTER
|
||||
@ -40,7 +40,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
HEADERS += ipv6cp.h eui64.h
|
||||
--- a/pppd/options.c
|
||||
+++ b/pppd/options.c
|
||||
@@ -57,6 +57,7 @@
|
||||
@@ -56,6 +56,7 @@
|
||||
|
||||
#ifdef PPP_FILTER
|
||||
#include <pcap.h>
|
||||
@ -48,21 +48,21 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
/*
|
||||
* There have been 3 or 4 different names for this in libpcap CVS, but
|
||||
* this seems to be what they have settled on...
|
||||
@@ -169,6 +170,13 @@ static int setlogfile __P((char **));
|
||||
static int loadplugin __P((char **));
|
||||
@@ -168,6 +169,13 @@ static int setlogfile(char **);
|
||||
static int loadplugin(char **);
|
||||
#endif
|
||||
|
||||
+#ifdef PPP_PRECOMPILED_FILTER
|
||||
+#include "pcap_pcc.h"
|
||||
+static int setprecompiledpassfilter __P((char **));
|
||||
+static int setprecompiledactivefilter __P((char **));
|
||||
+static int setprecompiledpassfilter(char **);
|
||||
+static int setprecompiledactivefilter(char **);
|
||||
+#undef PPP_FILTER
|
||||
+#endif
|
||||
+
|
||||
#ifdef PPP_FILTER
|
||||
static int setpassfilter __P((char **));
|
||||
static int setactivefilter __P((char **));
|
||||
@@ -361,6 +369,14 @@ option_t general_options[] = {
|
||||
static int setpassfilter(char **);
|
||||
static int setactivefilter(char **);
|
||||
@@ -360,6 +368,14 @@ option_t general_options[] = {
|
||||
"set filter for active pkts", OPT_PRIO },
|
||||
#endif
|
||||
|
||||
@ -77,7 +77,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
#ifdef MAXOCTETS
|
||||
{ "maxoctets", o_int, &maxoctets,
|
||||
"Set connection traffic limit",
|
||||
@@ -1516,6 +1532,29 @@ callfile(argv)
|
||||
@@ -1468,6 +1484,27 @@ callfile(char **argv)
|
||||
return ok;
|
||||
}
|
||||
|
||||
@ -87,8 +87,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
+ * precompiled expression
|
||||
+ */
|
||||
+static int
|
||||
+setprecompiledpassfilter(argv)
|
||||
+ char **argv;
|
||||
+setprecompiledpassfilter(char **argv)
|
||||
+{
|
||||
+ return pcap_pre_compiled (*argv, &pass_filter);
|
||||
+}
|
||||
@ -97,8 +96,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
+ * setactivefilter - Set the active filter for packets
|
||||
+ */
|
||||
+static int
|
||||
+setprecompiledactivefilter(argv)
|
||||
+ char **argv;
|
||||
+setprecompiledactivefilter(char **argv)
|
||||
+{
|
||||
+ return pcap_pre_compiled (*argv, &active_filter);
|
||||
+}
|
||||
|
||||
@ -16,17 +16,17 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
|
||||
|
||||
#include "pppd.h"
|
||||
#include "fsm.h"
|
||||
@@ -56,7 +57,8 @@ static void iterate_bundle_links __P((vo
|
||||
@@ -56,7 +57,8 @@ static void iterate_bundle_links(void (*
|
||||
|
||||
static int get_default_epdisc __P((struct epdisc *));
|
||||
static int parse_num __P((char *str, const char *key, int *valp));
|
||||
-static int owns_unit __P((TDB_DATA pid, int unit));
|
||||
+static int parse_str __P((char *str, const char *key, char *buf, int buflen));
|
||||
+static int owns_link __P((TDB_DATA pid, char *ifname));
|
||||
static int get_default_epdisc(struct epdisc *);
|
||||
static int parse_num(char *str, const char *key, int *valp);
|
||||
-static int owns_unit(TDB_DATA pid, int unit);
|
||||
+static int parse_str(char *str, const char *key, char *buf, int buflen);
|
||||
+static int owns_link(TDB_DATA pid, char *ifname);
|
||||
|
||||
#define set_ip_epdisc(ep, addr) do { \
|
||||
ep->length = 4; \
|
||||
@@ -197,35 +199,38 @@ mp_join_bundle()
|
||||
@@ -197,35 +199,38 @@ mp_join_bundle(void)
|
||||
key.dptr = bundle_id;
|
||||
key.dsize = p - bundle_id;
|
||||
pid = tdb_fetch(pppdb, key);
|
||||
@ -73,16 +73,12 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
|
||||
}
|
||||
|
||||
/* we have to make a new bundle */
|
||||
@@ -408,22 +413,45 @@ parse_num(str, key, valp)
|
||||
@@ -405,20 +410,39 @@ parse_num(char *str, const char *key, in
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int
|
||||
+parse_str(str, key, buf, buflen)
|
||||
+ char *str;
|
||||
+ const char *key;
|
||||
+ char *buf;
|
||||
+ int buflen;
|
||||
+parse_str(char *str, const char *key, char *buf, int buflen)
|
||||
+{
|
||||
+ char *p, *endp;
|
||||
+ int i;
|
||||
@ -103,11 +99,8 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
|
||||
+ * Check whether the pppd identified by `key' still owns ppp link `ifname'.
|
||||
*/
|
||||
static int
|
||||
-owns_unit(key, unit)
|
||||
+owns_link(key, ifname)
|
||||
TDB_DATA key;
|
||||
- int unit;
|
||||
+ char *ifname;
|
||||
-owns_unit(TDB_DATA key, int unit)
|
||||
+owns_link(TDB_DATA key, char *ifname)
|
||||
{
|
||||
- char ifkey[32];
|
||||
+ char ifkey[7 + IFNAMSIZ];
|
||||
@ -126,7 +119,7 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
|
||||
&& memcmp(vd.dptr, key.dptr, vd.dsize) == 0;
|
||||
--- a/pppd/sys-linux.c
|
||||
+++ b/pppd/sys-linux.c
|
||||
@@ -700,6 +700,16 @@ void cfg_bundle(int mrru, int mtru, int
|
||||
@@ -706,6 +706,16 @@ void cfg_bundle(int mrru, int mtru, int
|
||||
add_fd(ppp_dev_fd);
|
||||
}
|
||||
|
||||
@ -143,7 +136,7 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
|
||||
/*
|
||||
* make_new_bundle - create a new PPP unit (i.e. a bundle)
|
||||
* and connect our channel to it. This should only get called
|
||||
@@ -718,6 +728,8 @@ void make_new_bundle(int mrru, int mtru,
|
||||
@@ -724,6 +734,8 @@ void make_new_bundle(int mrru, int mtru,
|
||||
|
||||
/* set the mrru and flags */
|
||||
cfg_bundle(mrru, mtru, rssn, tssn);
|
||||
|
||||
@ -12,7 +12,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
--- a/pppd/sys-linux.c
|
||||
+++ b/pppd/sys-linux.c
|
||||
@@ -1767,6 +1767,7 @@ int cifdefaultroute (int unit, u_int32_t
|
||||
@@ -1770,6 +1770,7 @@ int cifdefaultroute (int unit, u_int32_t
|
||||
SIN_ADDR(rt.rt_genmask) = 0L;
|
||||
}
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
--- a/pppd/sys-linux.c
|
||||
+++ b/pppd/sys-linux.c
|
||||
@@ -1717,6 +1717,9 @@ int sifdefaultroute (int unit, u_int32_t
|
||||
@@ -1720,6 +1720,9 @@ int sifdefaultroute (int unit, u_int32_t
|
||||
memset (&rt, 0, sizeof (rt));
|
||||
SET_SA_FAMILY (rt.rt_dst, AF_INET);
|
||||
|
||||
@ -23,7 +23,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
rt.rt_dev = ifname;
|
||||
rt.rt_metric = dfl_route_metric + 1; /* +1 for binary compatibility */
|
||||
|
||||
@@ -1725,7 +1728,7 @@ int sifdefaultroute (int unit, u_int32_t
|
||||
@@ -1728,7 +1731,7 @@ int sifdefaultroute (int unit, u_int32_t
|
||||
SIN_ADDR(rt.rt_genmask) = 0L;
|
||||
}
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
--- a/pppd/sys-linux.c
|
||||
+++ b/pppd/sys-linux.c
|
||||
@@ -200,7 +200,7 @@ static int driver_is_old = 0;
|
||||
@@ -206,7 +206,7 @@ static int driver_is_old = 0;
|
||||
static int restore_term = 0; /* 1 => we've munged the terminal */
|
||||
static struct termios inittermios; /* Initial TTY termios */
|
||||
|
||||
@ -19,7 +19,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
static char loop_name[20];
|
||||
static unsigned char inbuf[512]; /* buffer for chars read from loopback */
|
||||
@@ -219,8 +219,8 @@ static int looped; /* 1 if using loop
|
||||
@@ -225,8 +225,8 @@ static int looped; /* 1 if using loop
|
||||
static int link_mtu; /* mtu for the link (not bundle) */
|
||||
|
||||
static struct utsname utsname; /* for the kernel version */
|
||||
@ -29,7 +29,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
#define MAX_IFS 100
|
||||
|
||||
@@ -1453,11 +1453,12 @@ int ccp_fatal_error (int unit)
|
||||
@@ -1455,11 +1455,12 @@ int ccp_fatal_error (int unit)
|
||||
*
|
||||
* path_to_procfs - find the path to the proc file system mount point
|
||||
*/
|
||||
@ -44,7 +44,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
struct mntent *mntent;
|
||||
FILE *fp;
|
||||
|
||||
@@ -1479,6 +1480,7 @@ static char *path_to_procfs(const char *
|
||||
@@ -1481,6 +1482,7 @@ static char *path_to_procfs(const char *
|
||||
fclose (fp);
|
||||
}
|
||||
}
|
||||
@ -52,7 +52,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
strlcpy(proc_path + proc_path_len, tail,
|
||||
sizeof(proc_path) - proc_path_len);
|
||||
@@ -2332,15 +2334,19 @@ int ppp_available(void)
|
||||
@@ -2365,15 +2367,19 @@ int ppp_available(void)
|
||||
int my_version, my_modification, my_patch;
|
||||
int osmaj, osmin, ospatch;
|
||||
|
||||
@ -72,7 +72,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
/* XXX should get from driver */
|
||||
driver_version = 2;
|
||||
@@ -2400,6 +2406,7 @@ int ppp_available(void)
|
||||
@@ -2433,6 +2439,7 @@ int ppp_available(void)
|
||||
|
||||
if (ok && ((ifr.ifr_hwaddr.sa_family & ~0xFF) != ARPHRD_PPP))
|
||||
ok = 0;
|
||||
@ -80,7 +80,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
/*
|
||||
* This is the PPP device. Validate the version of the driver at this
|
||||
@@ -2936,6 +2943,7 @@ get_pty(master_fdp, slave_fdp, slave_nam
|
||||
@@ -3106,6 +3113,7 @@ get_pty(int *master_fdp, int *slave_fdp,
|
||||
}
|
||||
#endif /* TIOCGPTN */
|
||||
|
||||
@ -88,7 +88,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
if (sfd < 0) {
|
||||
/* the old way - scan through the pty name space */
|
||||
for (i = 0; i < 64; ++i) {
|
||||
@@ -2954,6 +2962,7 @@ get_pty(master_fdp, slave_fdp, slave_nam
|
||||
@@ -3124,6 +3132,7 @@ get_pty(int *master_fdp, int *slave_fdp,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -98,11 +98,11 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
return 0;
|
||||
--- a/pppd/plugins/pppoatm/pppoatm.c
|
||||
+++ b/pppd/plugins/pppoatm/pppoatm.c
|
||||
@@ -168,14 +168,6 @@ static void disconnect_pppoatm(void)
|
||||
@@ -171,14 +171,6 @@ static void disconnect_pppoatm(void)
|
||||
|
||||
void plugin_init(void)
|
||||
{
|
||||
-#if defined(__linux__)
|
||||
-#ifdef linux
|
||||
- extern int new_style_driver; /* From sys-linux.c */
|
||||
- if (!ppp_available() && !new_style_driver)
|
||||
- fatal("Kernel doesn't support ppp_generic - "
|
||||
@ -110,12 +110,12 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
-#else
|
||||
- fatal("No PPPoATM support on this OS");
|
||||
-#endif
|
||||
info("PPPoATM plugin_init");
|
||||
add_options(pppoa_options);
|
||||
}
|
||||
--- a/pppd/plugins/rp-pppoe/plugin.c
|
||||
+++ b/pppd/plugins/rp-pppoe/plugin.c
|
||||
@@ -59,9 +59,6 @@ static char const RCSID[] =
|
||||
|
||||
--- a/pppd/plugins/pppoe/plugin.c
|
||||
+++ b/pppd/plugins/pppoe/plugin.c
|
||||
@@ -58,9 +58,6 @@ static char const RCSID[] =
|
||||
|
||||
char pppd_version[] = VERSION;
|
||||
|
||||
@ -125,7 +125,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
char *pppd_pppoe_service = NULL;
|
||||
static char *acName = NULL;
|
||||
static char *existingSession = NULL;
|
||||
@@ -394,10 +391,6 @@ PPPoEDevnameHook(char *cmd, char **argv,
|
||||
@@ -407,10 +404,6 @@ PPPoEDevnameHook(char *cmd, char **argv,
|
||||
void
|
||||
plugin_init(void)
|
||||
{
|
||||
@ -135,7 +135,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
-
|
||||
add_options(Options);
|
||||
|
||||
info("RP-PPPoE plugin version %s compiled against pppd %s",
|
||||
info("PPPoE plugin from pppd %s", VERSION);
|
||||
--- a/pppd/plugins/pppol2tp/pppol2tp.c
|
||||
+++ b/pppd/plugins/pppol2tp/pppol2tp.c
|
||||
@@ -490,12 +490,7 @@ static void pppol2tp_cleanup(void)
|
||||
|
||||
@ -7,7 +7,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
--- a/pppd/pppd.h
|
||||
+++ b/pppd/pppd.h
|
||||
@@ -326,7 +326,6 @@ extern int holdoff; /* Dead time before
|
||||
@@ -317,7 +317,6 @@ extern int holdoff; /* Dead time before
|
||||
extern bool holdoff_specified; /* true if user gave a holdoff value */
|
||||
extern bool notty; /* Stdin/out is not a tty */
|
||||
extern char *pty_socket; /* Socket to connect to pty */
|
||||
@ -17,7 +17,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
extern char linkname[MAXPATHLEN]; /* logical name for link */
|
||||
--- a/pppd/tty.c
|
||||
+++ b/pppd/tty.c
|
||||
@@ -145,7 +145,7 @@ char *disconnect_script = NULL; /* Scrip
|
||||
@@ -143,7 +143,7 @@ char *disconnect_script = NULL; /* Scrip
|
||||
char *welcomer = NULL; /* Script to run after phys link estab. */
|
||||
char *ptycommand = NULL; /* Command to run on other side of pty */
|
||||
bool notty = 0; /* Stdin/out is not a tty */
|
||||
@ -26,7 +26,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
int max_data_rate; /* max bytes/sec through charshunt */
|
||||
bool sync_serial = 0; /* Device is synchronous serial device */
|
||||
char *pty_socket = NULL; /* Socket to connect to pty */
|
||||
@@ -201,8 +201,10 @@ option_t tty_options[] = {
|
||||
@@ -199,8 +199,10 @@ option_t tty_options[] = {
|
||||
"Send and receive over socket, arg is host:port",
|
||||
OPT_PRIO | OPT_DEVNAM },
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
--- a/pppd/sys-linux.c
|
||||
+++ b/pppd/sys-linux.c
|
||||
@@ -2470,6 +2470,7 @@ int ppp_available(void)
|
||||
@@ -2503,6 +2503,7 @@ int ppp_available(void)
|
||||
|
||||
void logwtmp (const char *line, const char *name, const char *host)
|
||||
{
|
||||
@ -15,7 +15,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
struct utmp ut, *utp;
|
||||
pid_t mypid = getpid();
|
||||
#if __GLIBC__ < 2
|
||||
@@ -2535,6 +2536,7 @@ void logwtmp (const char *line, const ch
|
||||
@@ -2568,6 +2569,7 @@ void logwtmp (const char *line, const ch
|
||||
close (wtmp);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -7,7 +7,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
--- a/pppd/main.c
|
||||
+++ b/pppd/main.c
|
||||
@@ -883,14 +883,17 @@ struct protocol_list {
|
||||
@@ -866,14 +866,17 @@ struct protocol_list {
|
||||
const char *name;
|
||||
} protocol_list[] = {
|
||||
{ 0x21, "IP" },
|
||||
@ -25,7 +25,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
{ 0x33, "Stream Protocol ST-II" },
|
||||
{ 0x35, "Banyan Vines" },
|
||||
{ 0x39, "AppleTalk EDDP" },
|
||||
@@ -904,8 +907,11 @@ struct protocol_list {
|
||||
@@ -887,8 +890,11 @@ struct protocol_list {
|
||||
{ 0x49, "Serial Data Transport Protocol (PPP-SDTP)" },
|
||||
{ 0x4b, "SNA over 802.2" },
|
||||
{ 0x4d, "SNA" },
|
||||
@ -37,7 +37,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
{ 0x53, "Encryption" },
|
||||
{ 0x55, "Individual Link Encryption" },
|
||||
{ 0x57, "IPv6" },
|
||||
@@ -916,12 +922,15 @@ struct protocol_list {
|
||||
@@ -899,12 +905,15 @@ struct protocol_list {
|
||||
{ 0x65, "RTP IPHC Compressed non-TCP" },
|
||||
{ 0x67, "RTP IPHC Compressed UDP 8" },
|
||||
{ 0x69, "RTP IPHC Compressed RTP 8" },
|
||||
@ -53,7 +53,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
{ 0x0203, "IBM Source Routing BPDU" },
|
||||
{ 0x0205, "DEC LANBridge100 Spanning Tree" },
|
||||
{ 0x0207, "Cisco Discovery Protocol" },
|
||||
@@ -933,15 +942,19 @@ struct protocol_list {
|
||||
@@ -916,15 +925,19 @@ struct protocol_list {
|
||||
{ 0x0231, "Luxcom" },
|
||||
{ 0x0233, "Sigma Network Systems" },
|
||||
{ 0x0235, "Apple Client Server Protocol" },
|
||||
@ -73,7 +73,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
{ 0x4001, "Cray Communications Control Protocol" },
|
||||
{ 0x4003, "CDPD Mobile Network Registration Protocol" },
|
||||
{ 0x4005, "Expand accelerator protocol" },
|
||||
@@ -952,8 +965,10 @@ struct protocol_list {
|
||||
@@ -935,8 +948,10 @@ struct protocol_list {
|
||||
{ 0x4023, "RefTek Protocol" },
|
||||
{ 0x4025, "Fibre Channel" },
|
||||
{ 0x4027, "EMIT Protocols" },
|
||||
@ -84,7 +84,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
{ 0x8023, "OSI Network Layer Control Protocol" },
|
||||
{ 0x8025, "Xerox NS IDP Control Protocol" },
|
||||
{ 0x8027, "DECnet Phase IV Control Protocol" },
|
||||
@@ -962,7 +977,9 @@ struct protocol_list {
|
||||
@@ -945,7 +960,9 @@ struct protocol_list {
|
||||
{ 0x8031, "Bridging NCP" },
|
||||
{ 0x8033, "Stream Protocol Control Protocol" },
|
||||
{ 0x8035, "Banyan Vines Control Protocol" },
|
||||
@ -94,7 +94,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
{ 0x803f, "NETBIOS Framing Control Protocol" },
|
||||
{ 0x8041, "Cisco Systems Control Protocol" },
|
||||
{ 0x8043, "Ascom Timeplex" },
|
||||
@@ -971,18 +988,24 @@ struct protocol_list {
|
||||
@@ -954,18 +971,24 @@ struct protocol_list {
|
||||
{ 0x8049, "Serial Data Control Protocol (PPP-SDCP)" },
|
||||
{ 0x804b, "SNA over 802.2 Control Protocol" },
|
||||
{ 0x804d, "SNA Control Protocol" },
|
||||
@ -119,7 +119,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
{ 0x8207, "Cisco Discovery Protocol Control" },
|
||||
{ 0x8209, "Netcs Twin Routing" },
|
||||
{ 0x820b, "STP - Control Protocol" },
|
||||
@@ -991,24 +1014,29 @@ struct protocol_list {
|
||||
@@ -974,24 +997,29 @@ struct protocol_list {
|
||||
{ 0x8281, "MPLSCP" },
|
||||
{ 0x8285, "IEEE p1284.4 standard - Protocol Control" },
|
||||
{ 0x8287, "ETSI TETRA TNP1 Control Protocol" },
|
||||
|
||||
@ -9,7 +9,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
--- a/pppd/options.c
|
||||
+++ b/pppd/options.c
|
||||
@@ -349,13 +349,14 @@ option_t general_options[] = {
|
||||
@@ -348,13 +348,14 @@ option_t general_options[] = {
|
||||
"Enable multilink operation", OPT_PRIOSUB | OPT_ALIAS | 1 },
|
||||
{ "nomultilink", o_bool, &multilink,
|
||||
"Disable multilink operation", OPT_PRIOSUB | 0 },
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -195,7 +195,7 @@ if [ -d "$ksrc" ]; then
|
||||
@@ -133,7 +133,7 @@ if [ -d "$ksrc" ]; then
|
||||
mkmkf $ksrc/Makedefs$compiletype Makedefs.com
|
||||
for dir in pppd pppstats chat pppdump pppd/plugins pppd/plugins/rp-pppoe \
|
||||
for dir in pppd pppstats chat pppdump pppd/plugins pppd/plugins/pppoe \
|
||||
pppd/plugins/radius pppd/plugins/pppoatm \
|
||||
- pppd/plugins/pppol2tp; do
|
||||
+ pppd/plugins/pppol2tp pppd/plugins/pptp ; do
|
||||
@ -11,12 +11,12 @@
|
||||
if [ -f $ksrc/Makefile.$makext$archvariant ]; then
|
||||
--- a/pppd/plugins/Makefile.linux
|
||||
+++ b/pppd/plugins/Makefile.linux
|
||||
@@ -9,7 +9,7 @@ BINDIR = $(DESTDIR)/sbin
|
||||
MANDIR = $(DESTDIR)/share/man/man8
|
||||
LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION)
|
||||
@@ -14,7 +14,7 @@ INSTALL = install
|
||||
# EAP-TLS
|
||||
CFLAGS += -DUSE_EAPTLS=1
|
||||
|
||||
-SUBDIRS := rp-pppoe pppoatm pppol2tp
|
||||
+SUBDIRS := rp-pppoe pppoatm pppol2tp pptp
|
||||
-SUBDIRS := pppoe pppoatm pppol2tp
|
||||
+SUBDIRS := pppoe pppoatm pppol2tp pptp
|
||||
# Uncomment the next line to include the radius authentication plugin
|
||||
SUBDIRS += radius
|
||||
PLUGINS := minconn.so passprompt.so passwordfd.so winbind.so
|
||||
|
||||
@ -15,9 +15,9 @@ This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875.
|
||||
|
||||
--- a/pppd/Makefile.linux
|
||||
+++ b/pppd/Makefile.linux
|
||||
@@ -35,10 +35,10 @@ endif
|
||||
COPTS = -O2 -pipe -Wall -g
|
||||
LIBS = -lpthread
|
||||
@@ -36,10 +36,10 @@ endif
|
||||
|
||||
LIBS = -lrt
|
||||
|
||||
-# Uncomment the next line to include support for Microsoft's
|
||||
+# Uncomment the next 2 lines to include support for Microsoft's
|
||||
@ -28,19 +28,19 @@ This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875.
|
||||
# Don't use MSLANMAN unless you really know what you're doing.
|
||||
#MSLANMAN=y
|
||||
# Uncomment the next line to include support for MPPE. CHAPMS (above) must
|
||||
@@ -141,8 +141,7 @@ endif
|
||||
@@ -158,8 +158,7 @@ endif
|
||||
|
||||
ifdef NEEDDES
|
||||
ifndef USE_CRYPT
|
||||
-CFLAGS += -I$(shell $(CC) --print-sysroot)/usr/include/openssl
|
||||
-LIBS += -lcrypto
|
||||
-NEEDCRYPTOLIB = y
|
||||
+LIBS += -ldes $(LIBS)
|
||||
else
|
||||
CFLAGS += -DUSE_CRYPT=1
|
||||
endif
|
||||
--- a/pppd/pppcrypt.c
|
||||
+++ b/pppd/pppcrypt.c
|
||||
@@ -64,7 +64,7 @@ u_char *des_key; /* OUT 64 bit DES key w
|
||||
@@ -62,7 +62,7 @@ MakeKey(u_char *key, u_char *des_key)
|
||||
des_key[7] = Get7Bits(key, 49);
|
||||
|
||||
#ifndef USE_CRYPT
|
||||
@ -49,7 +49,7 @@ This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875.
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -158,25 +158,25 @@ u_char *clear; /* OUT 8 octets */
|
||||
@@ -147,30 +147,30 @@ DesDecrypt(u_char *cipher, u_char *clear
|
||||
}
|
||||
|
||||
#else /* USE_CRYPT */
|
||||
@ -57,8 +57,7 @@ This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875.
|
||||
+static des_key_schedule key_schedule;
|
||||
|
||||
bool
|
||||
DesSetkey(key)
|
||||
u_char *key;
|
||||
DesSetkey(u_char *key)
|
||||
{
|
||||
- DES_cblock des_key;
|
||||
+ des_cblock des_key;
|
||||
@ -69,10 +68,7 @@ This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875.
|
||||
}
|
||||
|
||||
bool
|
||||
-DesEncrypt(clear, cipher)
|
||||
+DesEncrypt(clear, key, cipher)
|
||||
u_char *clear; /* IN 8 octets */
|
||||
u_char *cipher; /* OUT 8 octets */
|
||||
DesEncrypt(u_char *clear, u_char *cipher)
|
||||
{
|
||||
- DES_ecb_encrypt((DES_cblock *)clear, (DES_cblock *)cipher,
|
||||
- &key_schedule, 1);
|
||||
@ -81,9 +77,8 @@ This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875.
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -185,8 +185,8 @@ DesDecrypt(cipher, clear)
|
||||
u_char *cipher; /* IN 8 octets */
|
||||
u_char *clear; /* OUT 8 octets */
|
||||
bool
|
||||
DesDecrypt(u_char *cipher, u_char *clear)
|
||||
{
|
||||
- DES_ecb_encrypt((DES_cblock *)cipher, (DES_cblock *)clear,
|
||||
- &key_schedule, 0);
|
||||
|
||||
@ -50,7 +50,7 @@ endef
|
||||
define Package/wireguard
|
||||
$(call Package/wireguard/Default)
|
||||
TITLE:=WireGuard meta-package
|
||||
DEPENDS:=+wireguard-tools +kmod-wireguard
|
||||
DEPENDS:=+wireguard-tools +kmod-wireguard @LINUX_5_4
|
||||
endef
|
||||
|
||||
include $(INCLUDE_DIR)/kernel-defaults.mk
|
||||
@ -73,7 +73,7 @@ define KernelPackage/wireguard
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Support
|
||||
TITLE:=WireGuard kernel module
|
||||
DEPENDS:=+IPV6:kmod-udptunnel6 +kmod-udptunnel4
|
||||
DEPENDS:=+IPV6:kmod-udptunnel6 +kmod-udptunnel4 @LINUX_5_4
|
||||
FILES:= $(PKG_BUILD_DIR)/src/wireguard.$(LINUX_KMOD_SUFFIX)
|
||||
AUTOLOAD:=$(call AutoProbe,wireguard)
|
||||
endef
|
||||
|
||||
@ -12,9 +12,9 @@ PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git
|
||||
PKG_SOURCE_DATE:=2021-02-08
|
||||
PKG_SOURCE_VERSION:=08938fe1cbc06eeaafa39448057368391d165272
|
||||
PKG_MIRROR_HASH:=efc3deac56057e929789d44742858b2a16d976f6bfa0a2036e413d10afcaeee4
|
||||
PKG_SOURCE_DATE:=2021-02-23
|
||||
PKG_SOURCE_VERSION:=37eed131e9967a35f47bacb3437a9d3c8a57b3f4
|
||||
PKG_MIRROR_HASH:=2b0131ff9055ccf987cbeb5f36c2c2585dc780999df6be312fbbbcd61ce676d4
|
||||
CMAKE_INSTALL:=1
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
@ -23,18 +23,26 @@ usage() {
|
||||
printf "\n\t-c ==> set config name 'config'"
|
||||
printf "\n\t-a ==> set load address to 'addr' (hex)"
|
||||
printf "\n\t-e ==> set entry point to 'entry' (hex)"
|
||||
printf "\n\t-f ==> set device tree compatible string"
|
||||
printf "\n\t-i ==> include initrd Blob 'initrd'"
|
||||
printf "\n\t-v ==> set kernel version to 'version'"
|
||||
printf "\n\t-k ==> include kernel image 'kernel'"
|
||||
printf "\n\t-D ==> human friendly Device Tree Blob 'name'"
|
||||
printf "\n\t-n ==> fdt unit-address 'address'"
|
||||
printf "\n\t-d ==> include Device Tree Blob 'dtb'"
|
||||
printf "\n\t-r ==> include RootFS blob 'rootfs'"
|
||||
printf "\n\t-H ==> specify hash algo instead of SHA1"
|
||||
printf "\n\t-o ==> create output file 'its_file'\n"
|
||||
exit 1
|
||||
}
|
||||
|
||||
FDTNUM=1
|
||||
ROOTFSNUM=1
|
||||
INITRDNUM=1
|
||||
HASH=sha1
|
||||
LOADABLES=
|
||||
|
||||
while getopts ":A:a:c:C:D:d:e:k:n:o:v:" OPTION
|
||||
while getopts ":A:a:c:C:D:d:e:f:i:k:n:o:v:r:S" OPTION
|
||||
do
|
||||
case $OPTION in
|
||||
A ) ARCH=$OPTARG;;
|
||||
@ -44,9 +52,13 @@ do
|
||||
D ) DEVICE=$OPTARG;;
|
||||
d ) DTB=$OPTARG;;
|
||||
e ) ENTRY_ADDR=$OPTARG;;
|
||||
f ) COMPATIBLE=$OPTARG;;
|
||||
i ) INITRD=$OPTARG;;
|
||||
k ) KERNEL=$OPTARG;;
|
||||
n ) FDTNUM=$OPTARG;;
|
||||
o ) OUTPUT=$OPTARG;;
|
||||
r ) ROOTFS=$OPTARG;;
|
||||
S ) HASH=$OPTARG;;
|
||||
v ) VERSION=$OPTARG;;
|
||||
* ) echo "Invalid option passed to '$0' (options:$*)"
|
||||
usage;;
|
||||
@ -62,11 +74,16 @@ fi
|
||||
|
||||
ARCH_UPPER=$(echo "$ARCH" | tr '[:lower:]' '[:upper:]')
|
||||
|
||||
if [ -n "${COMPATIBLE}" ]; then
|
||||
COMPATIBLE_PROP="compatible = \"${COMPATIBLE}\";"
|
||||
fi
|
||||
|
||||
# Conditionally create fdt information
|
||||
if [ -n "${DTB}" ]; then
|
||||
FDT_NODE="
|
||||
fdt@$FDTNUM {
|
||||
description = \"${ARCH_UPPER} OpenWrt ${DEVICE} device tree blob\";
|
||||
${COMPATIBLE_PROP}
|
||||
data = /incbin/(\"${DTB}\");
|
||||
type = \"flat_dt\";
|
||||
arch = \"${ARCH}\";
|
||||
@ -75,13 +92,55 @@ if [ -n "${DTB}" ]; then
|
||||
algo = \"crc32\";
|
||||
};
|
||||
hash@2 {
|
||||
algo = \"sha1\";
|
||||
algo = \"${HASH}\";
|
||||
};
|
||||
};
|
||||
"
|
||||
FDT_PROP="fdt = \"fdt@$FDTNUM\";"
|
||||
fi
|
||||
|
||||
if [ -n "${INITRD}" ]; then
|
||||
INITRD_NODE="
|
||||
initrd@$INITRDNUM {
|
||||
description = \"${ARCH_UPPER} OpenWrt ${DEVICE} initrd\";
|
||||
${COMPATIBLE_PROP}
|
||||
data = /incbin/(\"${INITRD}\");
|
||||
type = \"ramdisk\";
|
||||
arch = \"${ARCH}\";
|
||||
os = \"linux\";
|
||||
hash@1 {
|
||||
algo = \"crc32\";
|
||||
};
|
||||
hash@2 {
|
||||
algo = \"${HASH}\";
|
||||
};
|
||||
};
|
||||
"
|
||||
INITRD_PROP="ramdisk=\"initrd@${INITRDNUM}\";"
|
||||
fi
|
||||
|
||||
|
||||
if [ -n "${ROOTFS}" ]; then
|
||||
dd if="${ROOTFS}" of="${ROOTFS}.pagesync" bs=4096 conv=sync
|
||||
ROOTFS_NODE="
|
||||
rootfs@$ROOTFSNUM {
|
||||
description = \"${ARCH_UPPER} OpenWrt ${DEVICE} rootfs\";
|
||||
${COMPATIBLE_PROP}
|
||||
data = /incbin/(\"${ROOTFS}.pagesync\");
|
||||
type = \"filesystem\";
|
||||
arch = \"${ARCH}\";
|
||||
compression = \"none\";
|
||||
hash@1 {
|
||||
algo = \"crc32\";
|
||||
};
|
||||
hash@2 {
|
||||
algo = \"${HASH}\";
|
||||
};
|
||||
};
|
||||
"
|
||||
LOADABLES="${LOADABLES:+$LOADABLES, }\"rootfs@${ROOTFSNUM}\""
|
||||
fi
|
||||
|
||||
# Create a default, fully populated DTS file
|
||||
DATA="/dts-v1/;
|
||||
|
||||
@ -103,18 +162,23 @@ DATA="/dts-v1/;
|
||||
algo = \"crc32\";
|
||||
};
|
||||
hash@2 {
|
||||
algo = \"sha1\";
|
||||
algo = \"$HASH\";
|
||||
};
|
||||
};
|
||||
${INITRD_NODE}
|
||||
${FDT_NODE}
|
||||
${ROOTFS_NODE}
|
||||
};
|
||||
|
||||
configurations {
|
||||
default = \"${CONFIG}\";
|
||||
${CONFIG} {
|
||||
description = \"OpenWrt\";
|
||||
description = \"OpenWrt ${DEVICE}\";
|
||||
kernel = \"kernel@1\";
|
||||
${FDT_PROP}
|
||||
${LOADABLES:+loadables = ${LOADABLES};}
|
||||
${COMPATIBLE_PROP}
|
||||
${INITRD_PROP}
|
||||
};
|
||||
};
|
||||
};"
|
||||
|
||||
@ -33,6 +33,7 @@ sub target_config_features(@) {
|
||||
/^fpu$/ and $ret .= "\tselect HAS_FPU\n";
|
||||
/^spe_fpu$/ and $ret .= "\tselect HAS_SPE_FPU\n";
|
||||
/^ramdisk$/ and $ret .= "\tselect USES_INITRAMFS\n";
|
||||
/^seperate_ramdisk$/ and $ret .= "\tselect USES_INITRAMFS\n\tselect USES_SEPERATE_INITRAMFS\n";
|
||||
/^powerpc64$/ and $ret .= "\tselect powerpc64\n";
|
||||
/^nommu$/ and $ret .= "\tselect NOMMU\n";
|
||||
/^mips16$/ and $ret .= "\tselect HAS_MIPS16\n";
|
||||
|
||||
@ -51,6 +51,9 @@ config USES_DEVICETREE
|
||||
config USES_INITRAMFS
|
||||
bool
|
||||
|
||||
config USES_SEPERATE_INITRAMFS
|
||||
bool
|
||||
|
||||
config USES_SQUASHFS
|
||||
bool
|
||||
|
||||
|
||||
@ -196,10 +196,6 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@ -150,10 +150,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@ -41,8 +41,6 @@
|
||||
reg-io-width = <4>;
|
||||
reg-shift = <2>;
|
||||
no-loopback-test;
|
||||
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
usb_phy: usb-phy@18030000 {
|
||||
|
||||
@ -48,10 +48,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio {
|
||||
ngpios = <31>;
|
||||
gpio-line-names =
|
||||
|
||||
@ -91,7 +91,3 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@ -120,10 +120,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&mdio0 {
|
||||
status = "okay";
|
||||
|
||||
|
||||
@ -212,10 +212,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pll {
|
||||
clocks = <&extosc>;
|
||||
};
|
||||
|
||||
@ -159,10 +159,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pll {
|
||||
clocks = <&extosc>;
|
||||
};
|
||||
|
||||
@ -117,7 +117,3 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@ -102,10 +102,6 @@
|
||||
clocks = <&extosc>;
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&mdio0 {
|
||||
status = "okay";
|
||||
|
||||
|
||||
@ -188,10 +188,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spi {
|
||||
status = "okay";
|
||||
|
||||
|
||||
@ -75,10 +75,6 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&mdio0 {
|
||||
status = "okay";
|
||||
|
||||
|
||||
@ -67,10 +67,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb_phy {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@ -181,7 +181,3 @@
|
||||
pinctrl-single,bits = <0x0 0x0 0xf8>;
|
||||
};
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@ -157,7 +157,3 @@
|
||||
pinctrl-single,bits = <0x0 0x0 0xf8>;
|
||||
};
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include "ar7240.dtsi"
|
||||
#include "ar724x_senao_loader.dtsi"
|
||||
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/mtd/partitions/uimage.h>
|
||||
|
||||
/ {
|
||||
compatible = "engenius,enh202-v1", "qca,ar7240";
|
||||
@ -69,96 +69,6 @@
|
||||
linux,default-trigger = "phy0tpt";
|
||||
};
|
||||
};
|
||||
|
||||
virtual_flash {
|
||||
compatible = "mtd-concat";
|
||||
|
||||
devices = <&fwconcat0 &fwconcat1>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
compatible = "openwrt,uimage", "denx,uimage";
|
||||
openwrt,ih-magic = <IH_MAGIC_OKLI>;
|
||||
label = "firmware";
|
||||
reg = <0x0 0x0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spi {
|
||||
status = "okay";
|
||||
|
||||
flash@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <20000000>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "u-boot";
|
||||
reg = <0x0 0x40000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@40000 {
|
||||
label = "u-boot-env";
|
||||
reg = <0x40000 0x10000>;
|
||||
};
|
||||
|
||||
partition@50000 {
|
||||
label = "custom";
|
||||
reg = <0x50000 0x50000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@a0000 {
|
||||
label = "loader";
|
||||
reg = <0xa0000 0x10000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
fwconcat1: partition@b0000 {
|
||||
label = "fwconcat1";
|
||||
reg = <0xb0000 0xf0000>;
|
||||
};
|
||||
|
||||
partition@1a0000 {
|
||||
label = "fakeroot";
|
||||
reg = <0x1a0000 0x10000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
fwconcat0: partition@1b0000 {
|
||||
label = "fwconcat0";
|
||||
reg = <0x1b0000 0x4c0000>;
|
||||
};
|
||||
|
||||
partition@670000 {
|
||||
label = "failsafe";
|
||||
reg = <0x670000 0x180000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
art: partition@7f0000 {
|
||||
label = "art";
|
||||
reg = <0x7f0000 0x10000>;
|
||||
read-only;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
ð0 {
|
||||
|
||||
@ -196,7 +196,3 @@
|
||||
gpio-controller;
|
||||
};
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@ -129,7 +129,3 @@
|
||||
gpio-controller;
|
||||
};
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@ -115,7 +115,3 @@
|
||||
pinctrl-single,bits = <0x0 0x0 0xf8>;
|
||||
};
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@ -201,7 +201,3 @@
|
||||
gpio-controller;
|
||||
};
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@ -185,10 +185,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb_phy {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@ -104,7 +104,3 @@
|
||||
mtd-mac-address = <&uboot 0x1fc00>;
|
||||
mtd-mac-address-increment = <1>;
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@ -150,7 +150,3 @@
|
||||
mtd-mac-address = <&uboot 0x1fc00>;
|
||||
mtd-mac-address-increment = <1>;
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@ -27,10 +27,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pll {
|
||||
clocks = <&extosc>;
|
||||
};
|
||||
|
||||
@ -133,10 +133,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie {
|
||||
status = "okay";
|
||||
|
||||
|
||||
@ -144,10 +144,6 @@
|
||||
clocks = <&extosc>;
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb_phy {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@ -217,10 +217,6 @@
|
||||
clocks = <&extosc>;
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb_phy {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include "ar7242.dtsi"
|
||||
#include "ar724x_senao_loader.dtsi"
|
||||
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/mtd/partitions/uimage.h>
|
||||
|
||||
/ {
|
||||
compatible = "engenius,eap350-v1", "qca,ar7242";
|
||||
@ -48,96 +48,6 @@
|
||||
linux,default-trigger = "phy0tpt";
|
||||
};
|
||||
};
|
||||
|
||||
virtual_flash {
|
||||
compatible = "mtd-concat";
|
||||
|
||||
devices = <&fwconcat0 &fwconcat1>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
compatible = "openwrt,uimage", "denx,uimage";
|
||||
openwrt,ih-magic = <IH_MAGIC_OKLI>;
|
||||
label = "firmware";
|
||||
reg = <0x0 0x0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spi {
|
||||
status = "okay";
|
||||
|
||||
flash@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <20000000>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "u-boot";
|
||||
reg = <0x0 0x40000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@40000 {
|
||||
label = "u-boot-env";
|
||||
reg = <0x40000 0x10000>;
|
||||
};
|
||||
|
||||
partition@50000 {
|
||||
label = "custom";
|
||||
reg = <0x50000 0x50000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@a0000 {
|
||||
label = "loader";
|
||||
reg = <0xa0000 0x10000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
fwconcat1: partition@b0000 {
|
||||
label = "fwconcat1";
|
||||
reg = <0xb0000 0xf0000>;
|
||||
};
|
||||
|
||||
partition@1a0000 {
|
||||
label = "fakeroot";
|
||||
reg = <0x1a0000 0x10000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
fwconcat0: partition@1b0000 {
|
||||
label = "fwconcat0";
|
||||
reg = <0x1b0000 0x4c0000>;
|
||||
};
|
||||
|
||||
partition@670000 {
|
||||
label = "failsafe";
|
||||
reg = <0x670000 0x180000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
art: partition@7f0000 {
|
||||
label = "art";
|
||||
reg = <0x7f0000 0x10000>;
|
||||
read-only;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&mdio0 {
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include "ar7242.dtsi"
|
||||
#include "ar724x_senao_loader.dtsi"
|
||||
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/mtd/partitions/uimage.h>
|
||||
|
||||
/ {
|
||||
compatible = "engenius,ecb350-v1", "qca,ar7242";
|
||||
@ -48,96 +48,6 @@
|
||||
linux,default-trigger = "phy0tpt";
|
||||
};
|
||||
};
|
||||
|
||||
virtual_flash {
|
||||
compatible = "mtd-concat";
|
||||
|
||||
devices = <&fwconcat0 &fwconcat1>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
compatible = "openwrt,uimage", "denx,uimage";
|
||||
openwrt,ih-magic = <IH_MAGIC_OKLI>;
|
||||
label = "firmware";
|
||||
reg = <0x0 0x0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spi {
|
||||
status = "okay";
|
||||
|
||||
flash@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <20000000>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "u-boot";
|
||||
reg = <0x0 0x40000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@40000 {
|
||||
label = "u-boot-env";
|
||||
reg = <0x40000 0x10000>;
|
||||
};
|
||||
|
||||
partition@50000 {
|
||||
label = "custom";
|
||||
reg = <0x50000 0x50000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@a0000 {
|
||||
label = "loader";
|
||||
reg = <0xa0000 0x10000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
fwconcat1: partition@b0000 {
|
||||
label = "fwconcat1";
|
||||
reg = <0xb0000 0xf0000>;
|
||||
};
|
||||
|
||||
partition@1a0000 {
|
||||
label = "fakeroot";
|
||||
reg = <0x1a0000 0x10000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
fwconcat0: partition@1b0000 {
|
||||
label = "fwconcat0";
|
||||
reg = <0x1b0000 0x4c0000>;
|
||||
};
|
||||
|
||||
partition@670000 {
|
||||
label = "failsafe";
|
||||
reg = <0x670000 0x180000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
art: partition@7f0000 {
|
||||
label = "art";
|
||||
reg = <0x7f0000 0x10000>;
|
||||
read-only;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&mdio0 {
|
||||
|
||||
@ -90,10 +90,6 @@
|
||||
clocks = <&extosc>;
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&mdio0 {
|
||||
status = "okay";
|
||||
|
||||
|
||||
@ -134,10 +134,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
@ -128,10 +128,6 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
ð1 {
|
||||
status = "okay";
|
||||
|
||||
|
||||
@ -45,8 +45,6 @@
|
||||
reg-io-width = <4>;
|
||||
reg-shift = <2>;
|
||||
no-loopback-test;
|
||||
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio: gpio@18040000 {
|
||||
|
||||
91
target/linux/ath79/dts/ar724x_senao_loader.dtsi
Normal file
91
target/linux/ath79/dts/ar724x_senao_loader.dtsi
Normal file
@ -0,0 +1,91 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include <dt-bindings/mtd/partitions/uimage.h>
|
||||
|
||||
/ {
|
||||
virtual_flash {
|
||||
compatible = "mtd-concat";
|
||||
|
||||
devices = <&fwconcat0 &fwconcat1>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
compatible = "openwrt,uimage", "denx,uimage";
|
||||
openwrt,ih-magic = <IH_MAGIC_OKLI>;
|
||||
label = "firmware";
|
||||
reg = <0x0 0x0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi {
|
||||
status = "okay";
|
||||
|
||||
flash@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <20000000>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "u-boot";
|
||||
reg = <0x0 0x40000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@40000 {
|
||||
label = "u-boot-env";
|
||||
reg = <0x40000 0x10000>;
|
||||
};
|
||||
|
||||
partition@50000 {
|
||||
label = "custom";
|
||||
reg = <0x50000 0x50000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@a0000 {
|
||||
label = "loader";
|
||||
reg = <0xa0000 0x10000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
fwconcat1: partition@b0000 {
|
||||
label = "fwconcat1";
|
||||
reg = <0xb0000 0xf0000>;
|
||||
};
|
||||
|
||||
partition@1a0000 {
|
||||
label = "fakeroot";
|
||||
reg = <0x1a0000 0x10000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
fwconcat0: partition@1b0000 {
|
||||
label = "fwconcat0";
|
||||
reg = <0x1b0000 0x4c0000>;
|
||||
};
|
||||
|
||||
partition@670000 {
|
||||
label = "failsafe";
|
||||
reg = <0x670000 0x180000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
art: partition@7f0000 {
|
||||
label = "art";
|
||||
reg = <0x7f0000 0x10000>;
|
||||
read-only;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -15,10 +15,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spi {
|
||||
status = "okay";
|
||||
|
||||
|
||||
@ -72,8 +72,6 @@
|
||||
reg-io-width = <4>;
|
||||
reg-shift = <2>;
|
||||
no-loopback-test;
|
||||
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio: gpio@18040000 {
|
||||
|
||||
@ -62,10 +62,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pll {
|
||||
clocks = <&extosc>;
|
||||
};
|
||||
|
||||
@ -79,10 +79,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pll {
|
||||
clocks = <&extosc>;
|
||||
};
|
||||
|
||||
@ -106,10 +106,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
&uart {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spi {
|
||||
status = "okay";
|
||||
|
||||
|
||||
@ -8,6 +8,10 @@
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
aliases {
|
||||
serial0 = &uart;
|
||||
};
|
||||
|
||||
cpus {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
@ -41,8 +45,6 @@
|
||||
|
||||
clocks = <&pll ATH79_CLK_REF>;
|
||||
clock-names = "uart";
|
||||
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio: gpio@18040000 {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user