Skip to content

Commit

Permalink
trunk/package/network sync
Browse files Browse the repository at this point in the history
  • Loading branch information
zyxmon committed Sep 2, 2018
1 parent 472cedb commit 9aaea05
Show file tree
Hide file tree
Showing 125 changed files with 1,913 additions and 2,477 deletions.
12 changes: 6 additions & 6 deletions package/network/config/firewall/Makefile
Expand Up @@ -9,13 +9,13 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=firewall
PKG_RELEASE:=2
PKG_RELEASE:=1

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firewall3.git
PKG_SOURCE_DATE:=2018-04-05
PKG_SOURCE_VERSION:=35b3e74a184b709b8ddfaaa094919a656a6ec059
PKG_MIRROR_HASH:=b45da27ef219d0ec17ad3426b99e83781d079996fef553e5c47b98473f33b3cc
PKG_SOURCE_DATE:=2018-08-13
PKG_SOURCE_VERSION:=1c4d5bcd1137e61e91dca858fe33d76d7a1dc821
PKG_MIRROR_HASH:=49f939877a734056455556c90b959c407fd2c4988dc5d86f62a8122ebd7b8899
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_LICENSE:=ISC

Expand All @@ -40,8 +40,8 @@ define Package/firewall/conffiles
/etc/firewall.user
endef

TARGET_CFLAGS += -ffunction-sections -fdata-sections
TARGET_LDFLAGS += -Wl,--gc-sections
TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
TARGET_LDFLAGS += -Wl,--gc-sections -flto
CMAKE_OPTIONS += $(if $(CONFIG_IPV6),,-DDISABLE_IPV6=1)

define Package/firewall/install
Expand Down
2 changes: 1 addition & 1 deletion package/network/config/ltq-adsl-app/files/dsl_control
@@ -1,7 +1,7 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2012 OpenWrt.org

START=49
START=97
USE_PROCD=1

EXTRA_COMMANDS="status lucistat"
Expand Down
7 changes: 4 additions & 3 deletions package/network/config/ltq-vdsl-app/files/dsl_control
@@ -1,8 +1,7 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2012 OpenWrt.org

# needs to start before the atm layer which starts at 50
START=48
START=97
USE_PROCD=1

EXTRA_COMMANDS="status lucistat"
Expand Down Expand Up @@ -253,7 +252,9 @@ start_service() {
fi
;;
b*|j*)
if [ -f "/lib/firmware/lantiq-vrx200-b.bin" ]; then
if [ -f "/lib/firmware/vr9_dsl_fw_annex_b.bin" ]; then
firmware="/lib/firmware/vr9_dsl_fw_annex_b.bin"
elif [ -f "/lib/firmware/lantiq-vrx200-b.bin" ]; then
firmware="/lib/firmware/lantiq-vrx200-b.bin"
elif [ -f "/tmp/lantiq-vrx200-b.bin" ]; then
firmware="/tmp/lantiq-vrx200-b.bin"
Expand Down
11 changes: 7 additions & 4 deletions package/network/config/netifd/Makefile
Expand Up @@ -5,9 +5,9 @@ PKG_RELEASE:=1

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git
PKG_SOURCE_DATE:=2018-04-26
PKG_SOURCE_VERSION:=56cecedb261808f5ea700b92b97590f7fa16de9c
PKG_MIRROR_HASH:=65c3950122778489a5825bcf384251f7271fd6537a7245ae6909bb8347a32b9e
PKG_SOURCE_DATE:=2018-08-20
PKG_SOURCE_VERSION:=7454d121090f60428777c01f431031059acc96eb
PKG_MIRROR_HASH:=434f39ebc328bd172307e84dd532a8239f48fcae7e32ea4d456b4e24ddd739f3
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>

PKG_LICENSE:=GPL-2.0
Expand All @@ -27,7 +27,10 @@ endef

TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include/libnl-tiny \
-I$(STAGING_DIR)/usr/include
-I$(STAGING_DIR)/usr/include \
-flto

TARGET_LDFLAGS += -flto -fuse-linker-plugin

CMAKE_OPTIONS += \
-DLIBNL_LIBS=-lnl-tiny \
Expand Down
@@ -1,7 +1,6 @@
[ ifup = "$ACTION" ] && {
uci_toggle_state network "$INTERFACE" up 1
[ -n "$DEVICE" ] && {
uci_toggle_state network "$INTERFACE" device "$(uci -q get network.$INTERFACE.ifname)"
uci_toggle_state network "$INTERFACE" ifname "$DEVICE"
}
}
3 changes: 0 additions & 3 deletions package/network/config/netifd/files/lib/network/config.sh
Expand Up @@ -41,15 +41,12 @@ fixup_interface() {

config_get type "$config" type
config_get ifname "$config" ifname
config_get device "$config" device "$ifname"
[ "bridge" = "$type" ] && ifname="br-$config"
config_set "$config" device "$ifname"
ubus_call "network.interface.$config" status || return 0
json_get_var l3dev l3_device
[ -n "$l3dev" ] && ifname="$l3dev"
json_init
config_set "$config" ifname "$ifname"
config_set "$config" device "$device"
}

scan_interfaces() {
Expand Down
2 changes: 1 addition & 1 deletion package/network/config/qos-scripts/Makefile
Expand Up @@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=qos-scripts
PKG_VERSION:=1.3.0
PKG_VERSION:=1.3.1
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0

Expand Down
2 changes: 1 addition & 1 deletion package/network/config/qos-scripts/files/usr/bin/qos-start
@@ -1,4 +1,4 @@
#!/bin/sh

qos-stop
/usr/lib/qos/generate.sh all | sh

11 changes: 6 additions & 5 deletions package/network/config/qos-scripts/files/usr/bin/qos-stat
Expand Up @@ -14,16 +14,17 @@ get_ifname() {
[ "$cfgt" = "interface" ] && config_get "$interface" ifname
}

config_cb() {
config_get TYPE "$CONFIG_SECTION" TYPE
qos_set_device() {
config_get TYPE "$1" TYPE
[ "interface" = "$TYPE" ] && {
config_get device "$CONFIG_SECTION" ifname
[ -z "$device" ] && device="$(get_ifname ${CONFIG_SECTION})"
config_set "$CONFIG_SECTION" device "$device"
config_get device "$1" ifname
[ -z "$device" ] && device="$(get_ifname $1)"
config_set "$1" device "$device"
}
}

config_load qos
config_foreach qos_set_device

print_comments() {
echo ''
Expand Down
1 change: 1 addition & 0 deletions package/network/config/qos-scripts/files/usr/bin/qos-stop
@@ -1,4 +1,5 @@
#!/bin/sh

for iface in $(tc qdisc show | grep -E '(hfsc|ingress)' | awk '{print $5}'); do
tc qdisc del dev "$iface" ingress 2>&- >&-
tc qdisc del dev "$iface" root 2>&- >&-
Expand Down
73 changes: 36 additions & 37 deletions package/network/config/qos-scripts/files/usr/lib/qos/generate.sh
Expand Up @@ -118,21 +118,21 @@ parse_matching_rule() {
append "$var" "-m comment --comment '$value'"
;;
*:tos)
add_insmod xt_dscp
case "$value" in
!*) append "$var" "-m tos ! --tos $value";;
*) append "$var" "-m tos --tos $value"
esac
;;
add_insmod xt_dscp
case "$value" in
!*) append "$var" "-m tos ! --tos $value";;
*) append "$var" "-m tos --tos $value"
esac
;;
*:dscp)
add_insmod xt_dscp
add_insmod xt_dscp
dscp_option="--dscp"
[ -z "${value%%[EBCA]*}" ] && dscp_option="--dscp-class"
[ -z "${value%%[EBCA]*}" ] && dscp_option="--dscp-class"
case "$value" in
!*) append "$var" "-m dscp ! $dscp_option $value";;
*) append "$var" "-m dscp $dscp_option $value"
esac
;;
!*) append "$var" "-m dscp ! $dscp_option $value";;
*) append "$var" "-m dscp $dscp_option $value"
esac
;;
*:direction)
value="$(echo "$value" | sed -e 's,-,:,g')"
if [ "$value" = "out" ]; then
Expand Down Expand Up @@ -191,52 +191,48 @@ config_cb() {
option_cb() {
return 0
}

# Section start
case "$1" in
interface)
config_set "$2" "classgroup" "Default"
config_set "$2" "upload" "128"
;;
classify|default|reclassify)
option_cb() {
append options "$1"
append "CONFIG_${CONFIG_SECTION}_options" "$1"
}
;;
esac
}

# Section end
config_get TYPE "$CONFIG_SECTION" TYPE
qos_parse_config() {
config_get TYPE "$1" TYPE
case "$TYPE" in
interface)
config_get_bool enabled "$CONFIG_SECTION" enabled 1
[ 1 -eq "$enabled" ] || return 0
config_get classgroup "$CONFIG_SECTION" classgroup
config_set "$CONFIG_SECTION" ifbdev "$C"
C=$(($C+1))
append INTERFACES "$CONFIG_SECTION"
config_set "$classgroup" enabled 1
config_get device "$CONFIG_SECTION" device
[ -z "$device" ] && {
device="$(find_ifname ${CONFIG_SECTION})"
config_set "$CONFIG_SECTION" device "$device"
config_get_bool enabled "$1" enabled 1
[ 1 -eq "$enabled" ] && {
config_get classgroup "$1" classgroup
config_set "$1" ifbdev "$C"
C=$(($C+1))
append INTERFACES "$1"
config_set "$classgroup" enabled 1
config_get device "$1" device
[ -z "$device" ] && {
device="$(find_ifname $1)"
config_set "$1" device "$device"
}
}
;;
classgroup) append CG "$CONFIG_SECTION";;
classgroup) append CG "$1";;
classify|default|reclassify)
case "$TYPE" in
classify) var="ctrules";;
*) var="rules";;
esac
config_get target "$CONFIG_SECTION" target
config_set "$CONFIG_SECTION" options "$options"
append "$var" "$CONFIG_SECTION"
unset options
append "$var" "$1"
;;
esac
}


enum_classes() {
local c="0"
config_get classes "$1" classes
Expand Down Expand Up @@ -432,7 +428,7 @@ start_cg() {
cat <<EOF
$INSMOD
EOF

for command in $iptables; do
cat <<EOF
$command -w -t mangle -N qos_${cg}
Expand Down Expand Up @@ -490,7 +486,7 @@ stop_firewall() {
-e 's/^-A/-D/' \
-e '${p;g}' |
# Make into proper iptables calls
# Note: awkward in previous call due to hold space usage
# Note: awkward in previous call due to hold space usage
sed -n -e "s/^./${command} -w -t mangle &/p"
done
}
Expand All @@ -500,7 +496,10 @@ INTERFACES=""
[ -e ./qos.conf ] && {
. ./qos.conf
config_cb
} || config_load qos
} || {
config_load qos
config_foreach qos_parse_config
}

C="0"
for iface in $INTERFACES; do
Expand Down
5 changes: 3 additions & 2 deletions package/network/config/swconfig/src/swlib.c
Expand Up @@ -92,7 +92,7 @@ swlib_call(int cmd, int (*call)(struct nl_msg *, void *),
struct nl_cb *cb = NULL;
int finished;
int flags = 0;
int err;
int err = 0;

msg = nlmsg_alloc();
if (!msg) {
Expand All @@ -105,7 +105,8 @@ swlib_call(int cmd, int (*call)(struct nl_msg *, void *),

genlmsg_put(msg, NL_AUTO_PID, NL_AUTO_SEQ, genl_family_get_id(family), 0, flags, cmd, 0);
if (data) {
if (data(msg, arg) < 0)
err = data(msg, arg);
if (err < 0)
goto nla_put_failure;
}

Expand Down
2 changes: 1 addition & 1 deletion package/network/config/swconfig/src/uci.c
Expand Up @@ -59,7 +59,7 @@ static bool swlib_match_name(struct switch_dev *dev, const char *name)
strcmp(name, dev->alias) == 0);
}

static int
static void
swlib_map_settings(struct switch_dev *dev, int type, int port_vlan, struct uci_section *s)
{
struct swlib_setting *setting;
Expand Down
2 changes: 1 addition & 1 deletion package/network/ipv6/ds-lite/Makefile
Expand Up @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=ds-lite
PKG_VERSION:=7
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_LICENSE:=GPL-2.0

include $(INCLUDE_DIR)/package.mk
Expand Down
8 changes: 6 additions & 2 deletions package/network/ipv6/ds-lite/files/dslite.sh 100755 → 100644
Expand Up @@ -15,8 +15,8 @@ proto_dslite_setup() {
local link="ds-$cfg"
local remoteip6

local mtu ttl peeraddr ip6addr tunlink zone weakif
json_get_vars mtu ttl peeraddr ip6addr tunlink zone weakif
local mtu ttl peeraddr ip6addr tunlink zone weakif encaplimit
json_get_vars mtu ttl peeraddr ip6addr tunlink zone weakif encaplimit

[ -z "$peeraddr" ] && {
proto_notify_error "$cfg" "MISSING_ADDRESS"
Expand Down Expand Up @@ -68,6 +68,9 @@ proto_dslite_setup() {
json_add_string local "$ip6addr"
json_add_string remote "$peeraddr"
[ -n "$tunlink" ] && json_add_string link "$tunlink"
json_add_object "data"
json_add_string encaplimit "${encaplimit:-4}"
json_close_object
proto_close_tunnel

proto_add_data
Expand Down Expand Up @@ -97,6 +100,7 @@ proto_dslite_init_config() {
proto_config_add_string "tunlink"
proto_config_add_int "mtu"
proto_config_add_int "ttl"
proto_config_add_string "encaplimit"
proto_config_add_string "zone"
proto_config_add_string "weakif"
}
Expand Down
2 changes: 1 addition & 1 deletion package/network/ipv6/map/Makefile
Expand Up @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=map
PKG_VERSION:=4
PKG_RELEASE:=10
PKG_RELEASE:=11
PKG_LICENSE:=GPL-2.0

include $(INCLUDE_DIR)/package.mk
Expand Down

0 comments on commit 9aaea05

Please sign in to comment.