* [gentoo-commits] proj/netifrc:master commit in: net/, doc/
@ 2013-08-28 16:02 Robin H. Johnson
0 siblings, 0 replies; 12+ messages in thread
From: Robin H. Johnson @ 2013-08-28 16:02 UTC (permalink / raw
To: gentoo-commits
commit: 732a9a4999f479ee97a404252f6a0eba4a86e338
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 28 16:00:33 2013 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Wed Aug 28 16:00:33 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/netifrc.git;a=commit;h=732a9a49
net/iproute2: increase default dad_timeout to 10s
If you have a NIC that takes a long time to come up, the previous
default of 5 seconds is too low, because the card might not be available
yet. Increase the default to 10 seconds.
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
X-Gentoo-Bug: 482300
---
doc/net.example.BSD.in | 12 +++++++-----
doc/net.example.Linux.in | 10 ++++++----
net/iproute2.sh | 2 +-
3 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/doc/net.example.BSD.in b/doc/net.example.BSD.in
index 2509c9f..d3bd15b 100644
--- a/doc/net.example.BSD.in
+++ b/doc/net.example.BSD.in
@@ -86,12 +86,14 @@
# IPv6 addresses usually must complete a duplicate address detection process
# before they can be bound to by daemons; they are held in a 'tentative' state
-# until this completes. Setting the 'nodad' flag (see config_eth0 above) is
+# until this completes. Setting the 'nodad' flag (see config_eth0 above) is
# one way to avoid this tentative state, otherwise the service will wait
-# dad_timeout seconds (defaults to 5) for tentative state to clear on all IPv6
-# addresses set on the interface. As usual, dad_timeout can be adjusted on a
-# per-interface basis. Set to 0 to disable the wait entirely.
-#dad_timeout_eth0=5
+# dad_timeout seconds (defaults to 10) for tentative state to clear on all IPv6
+# addresses set on the interface. As usual, dad_timeout can be adjusted on a
+# per-interface basis. If your interface takes a long time to establish
+# carrier, you may wish to use a higher value.
+# Set to 0 to disable the wait entirely.
+#dad_timeout_eth0=10
# You may wish to disable the interface being brought down when stopping.
# This is only of use for WakeOnLan.
diff --git a/doc/net.example.Linux.in b/doc/net.example.Linux.in
index caffed7..e838f28 100644
--- a/doc/net.example.Linux.in
+++ b/doc/net.example.Linux.in
@@ -137,10 +137,12 @@
# before they can be bound to by daemons; they are held in a 'tentative' state
# until this completes. Setting the 'nodad' flag (see config_eth0 above) is
# one way to avoid this tentative state, otherwise the service will wait
-# dad_timeout seconds (defaults to 5) for tentative state to clear on all IPv6
-# addresses set on the interface. As usual, dad_timeout can be adjusted on a
-# per-interface basis. Set to 0 to disable the wait entirely.
-#dad_timeout_eth0=5
+# dad_timeout seconds (defaults to 10) for tentative state to clear on all IPv6
+# addresses set on the interface. As usual, dad_timeout can be adjusted on a
+# per-interface basis. If your interface takes a long time to establish
+# carrier, you may wish to use a higher value.
+# Set to 0 to disable the wait entirely.
+#dad_timeout_eth0=10
# You may wish to disable the interface being brought down when stopping.
# This is only of use for WakeOnLan.
diff --git a/net/iproute2.sh b/net/iproute2.sh
index 58b7bc4..096e724 100644
--- a/net/iproute2.sh
+++ b/net/iproute2.sh
@@ -332,7 +332,7 @@ iproute2_post_start()
{
local n=
eval n=\$dad_timeout_${IFVAR}
- [ -z "$n" ] && n=${dad_timeout:-5}
+ [ -z "$n" ] && n=${dad_timeout:-10}
local policyroute_order=
eval policyroute_order=\$policy_rules_before_routes_${IFVAR}
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [gentoo-commits] proj/netifrc:master commit in: net/, doc/
@ 2015-11-08 14:30 Robin H. Johnson
0 siblings, 0 replies; 12+ messages in thread
From: Robin H. Johnson @ 2015-11-08 14:30 UTC (permalink / raw
To: gentoo-commits
commit: 193803506202d0d37996ee81388215cfe3fc8cda
Author: Alon Bar-Lev <alonbl <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 7 20:02:43 2015 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sat Nov 7 20:02:43 2015 +0000
URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=19380350
net: bridge: support iproute2
add bridge_force_IFVAR to be interface independent.
mark the brctl_IFVAR as deprecated.
enable easy removal of brctl in future in favour of the iproute2 without
leaving legacy.
Signed-off-by: Alon Bar-Lev <alonbl <AT> gentoo.org>
doc/net.example.Linux.in | 1 +
net/bridge.sh | 75 ++++++++++++++++++++++++++++++++++++------------
2 files changed, 57 insertions(+), 19 deletions(-)
diff --git a/doc/net.example.Linux.in b/doc/net.example.Linux.in
index b91bb50..bcf3311 100644
--- a/doc/net.example.Linux.in
+++ b/doc/net.example.Linux.in
@@ -893,6 +893,7 @@
# ports to it you must set at least one of the following variables based on the
# interface name, so that we can pick it up from your configuration. Even an
# empty value variable is fine, but at least one of them must be set:
+# bridge_force_IFVAR
# brctl_IFVAR
# You need to configure the ports to null values so dhcp does not get started
diff --git a/net/bridge.sh b/net/bridge.sh
index 1d01be2..82abb71 100644
--- a/net/bridge.sh
+++ b/net/bridge.sh
@@ -4,7 +4,7 @@
bridge_depend()
{
before interface macnet
- program brctl
+ program brctl ip
}
_config_vars="$_config_vars bridge bridge_add brctl"
@@ -35,17 +35,27 @@ bridge_pre_start()
# ports is for static add
local ports="$(_get_array "bridge_${IFVAR}")"
# old config options
- local opts="$(_get_array "brctl_${IFVAR}")"
+ local brctl_opts="$(_get_array "brctl_${IFVAR}")"
# brif is used for dynamic add
eval brif=\$bridge_add_${IFVAR}
+ local do_iproute2=false do_brctl=false
+ if [ -n "${brctl_opts}" ] && type brctl >/dev/null 2>&1; then
+ do_brctl=true
+ elif type ip >/dev/null 2>&1; then
+ do_iproute2=true
+ elif type brctl >/dev/null 2>&1; then
+ do_brctl=true
+ fi
+
# we need a way to if the bridge exists in a variable name, not just the
# contents of a variable. Eg if somebody has only bridge_add_eth0='br0',
# with no other lines mentioning br0.
eval bridge_unset=\${bridge_${IFVAR}-y\}
eval brctl_unset=\${brctl_${IFVAR}-y\}
+ eval bridge_force_unset=\${bridge_force_${IFVAR}-y\}
- if [ -z "${brif}" -a "${brctl_unset}" = 'y' ]; then
+ if [ -z "${brif}" -a "${brctl_unset}${bridge_force_unset}" = 'yy' ]; then
if [ -z "${ports}" -a "${bridge_unset}" = "y" ]; then
#eerror "Misconfigured static bridge detected (see net.example)"
return 0
@@ -70,7 +80,18 @@ bridge_pre_start()
if ! _is_bridge ; then
ebegin "Creating bridge ${IFACE}"
- if ! brctl addbr "${IFACE}"; then
+ if ${do_iproute2}; then
+ ip link add "${IFACE}" type bridge
+ rc=$?
+ elif ${do_brctl}; then
+ brctl addbr "${IFACE}"
+ rc=$?
+ else
+ eerror "Neither iproute2 nor brctl has been found, please install"
+ eerror "either \"iproute2\" or \"brctl\"."
+ rc=1
+ fi
+ if [ ${rc} != 0 ]; then
eend 1
return 1
fi
@@ -82,19 +103,22 @@ bridge_pre_start()
# Old configuration set mechanism
# Only a very limited subset of the options are available in the old
# configuration method. The sysfs interface is in the next block instead.
- if [ -n "${opts}" ]; then
- ewarn "brctl options are deprecated please migrate to sysfs options"
- ewarn "map of important options is available at https://wiki.gentoo.org/wiki/Netifrc/Brctl_Migration"
- local IFS="$__IFS"
- for x in ${opts}; do
+ if ${do_brctl}; then
+ if [ -n "${brctl_opts}" ]; then
+ ewarn "brctl options are deprecated please migrate to sysfs options"
+ ewarn "map of important options is available at https://wiki.gentoo.org/wiki/Netifrc/Brctl_Migration"
+
+ local IFS="$__IFS"
+ for x in ${brctl_opts}; do
+ unset IFS
+ set -- ${x}
+ x=$1
+ shift
+ set -- "${x}" "${IFACE}" "$@"
+ brctl "$@"
+ done
unset IFS
- set -- ${x}
- x=$1
- shift
- set -- "${x}" "${IFACE}" "$@"
- brctl "$@"
- done
- unset IFS
+ fi
fi
# New configuration set mechanism, matches bonding
@@ -124,7 +148,12 @@ bridge_pre_start()
fi
# The interface is known to exist now
_up
- if ! brctl addif "${BR_IFACE}" "${x}"; then
+ if ${do_iproute2}; then
+ ip link set "${x}" master "${BR_IFACE}"
+ elif ${do_brctl}; then
+ brctl addif "${BR_IFACE}" "${x}"
+ fi
+ if [ $? != 0 ]; then
eend 1
return 1
fi
@@ -180,13 +209,21 @@ bridge_post_stop()
ebegin "Removing port ${port}${extra}"
local IFACE="${port}"
_set_flag -promisc
- brctl delif "${iface}" "${port}"
+ if type ip > /dev/null 2>&1; then
+ ip link set "${port}" nomaster
+ else
+ brctl delif "${iface}" "${port}"
+ fi
eend $?
done
if ${delete}; then
eoutdent
- brctl delbr "${iface}"
+ if type ip > /dev/null 2>&1; then
+ ip link del "${iface}"
+ else
+ brctl delbr "${iface}"
+ fi
eend $?
fi
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [gentoo-commits] proj/netifrc:master commit in: net/, doc/
@ 2015-11-08 14:30 Robin H. Johnson
0 siblings, 0 replies; 12+ messages in thread
From: Robin H. Johnson @ 2015-11-08 14:30 UTC (permalink / raw
To: gentoo-commits
commit: 734e527dbe32fc3c0abdd326c485a6e69d8646f2
Author: Alon Bar-Lev <alonbl <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 7 20:02:59 2015 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sat Nov 7 20:18:02 2015 +0000
URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=734e527d
net: bridge: add bridge_ and brport_ prefixes to sysfs interface
keep the no prefix to be backward compatible.
Signed-off-by: Alon Bar-Lev <alonbl <AT> gentoo.org>
doc/net.example.Linux.in | 6 +++---
net/bridge.sh | 29 +++++++++++++++++------------
2 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/doc/net.example.Linux.in b/doc/net.example.Linux.in
index bcf3311..f71385d 100644
--- a/doc/net.example.Linux.in
+++ b/doc/net.example.Linux.in
@@ -919,9 +919,9 @@
# You can also configure the bridge or bridge members via sysfs on 2.6 kernels
# or newer. See the kernel bridge documentation for a description of these
# options.
-#stp_state_br0="0"
-#forward_delay_br0="10"
-#hairpin_mode_eth0="1"
+#bridge_stp_state_br0="0"
+#bridge_forward_delay_br0="10"
+#brport_hairpin_mode_eth0="1"
#-----------------------------------------------------------------------------
# RFC 2684 Bridge Support
diff --git a/net/bridge.sh b/net/bridge.sh
index 82abb71..407b578 100644
--- a/net/bridge.sh
+++ b/net/bridge.sh
@@ -125,12 +125,15 @@ bridge_pre_start()
for x in /sys/class/net/"${IFACE}"/bridge/*; do
[ -f "${x}" ] || continue
n=${x##*/}
- eval s=\$${n}_${IFVAR}
- if [ -n "${s}" ]; then
- einfo "Setting ${n}: ${s}"
- echo "${s}" >"${x}" || \
- eerror "Failed to configure $n (${n}_${IFVAR})"
- fi
+ # keep no prefix for backward compatibility
+ for prefix in "" bridge_; do
+ eval s=\$${prefix}${n}_${IFVAR}
+ if [ -n "${s}" ]; then
+ einfo "Setting ${n}: ${s}"
+ echo "${s}" >"${x}" || \
+ eerror "Failed to configure $n (${n}_${IFVAR})"
+ fi
+ done
done
if [ -n "${ports}" ]; then
@@ -161,12 +164,14 @@ bridge_pre_start()
for x in /sys/class/net/"${IFACE}"/brport/*; do
[ -f "${x}" ] || continue
n=${x##*/}
- eval s=\$${n}_${IFVAR}
- if [ -n "${s}" ]; then
- einfo "Setting ${n}@${IFACE}: ${s}"
- echo "${s}" >"${x}" || \
- eerror "Failed to configure $n (${n}_${IFVAR})"
- fi
+ for prefix in "" brport_; do
+ eval s=\$${prefix}${n}_${IFVAR}
+ if [ -n "${s}" ]; then
+ einfo "Setting ${n}@${IFACE}: ${s}"
+ echo "${s}" >"${x}" || \
+ eerror "Failed to configure $n (${n}_${IFVAR})"
+ fi
+ done
done
eend 0
done
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [gentoo-commits] proj/netifrc:master commit in: net/, doc/
@ 2019-04-21 4:11 Robin H. Johnson
0 siblings, 0 replies; 12+ messages in thread
From: Robin H. Johnson @ 2019-04-21 4:11 UTC (permalink / raw
To: gentoo-commits
commit: b5bb3cdf925730a693eed9e2528b92c04975c7d0
Author: Kirill Semenkov <semenkovk <AT> gmail <DOT> com>
AuthorDate: Mon Dec 17 09:10:50 2018 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sun Apr 21 04:10:41 2019 +0000
URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=b5bb3cdf
Veth support added
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
doc/net.example.Linux.in | 24 ++++++++++++++++++++++++
net/Makefile | 2 +-
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/doc/net.example.Linux.in b/doc/net.example.Linux.in
index 3b414ba..6fc6094 100644
--- a/doc/net.example.Linux.in
+++ b/doc/net.example.Linux.in
@@ -914,6 +914,30 @@
# of the node as well
#openvpn_tun1="--user foo --group bar"
+#-----------------------------------------------------------------------------
+# Virtual interface device (veth)
+# For veth support install iproute2 and awk
+#
+# The script uses "standard" ways of IP-address assignement in net.lo script. Network namespaces are not implemented here
+# because net.lo currently knows nothing about network namespaces.
+#
+# You must specify veth interface type to avoid interference with "normal" interfaces startup
+# The interface type must be set for both peers
+#type_veth0="veth"
+# Here we declare peers for "ip link add" command
+#veth_veth0="veth0 veth1"
+#config_veth0="192.168.0.1/24"
+#
+# Avoids race
+#rc_net_veth1_need="net.veth0"
+#type_veth1="veth"
+# Both peers are created when the first one starts, we don't need to create the second peer
+# explicitly, we just configure it
+#veth_veth1_create="no"
+#config_veth1="192.168.2.1/24"
+#
+
+
#-----------------------------------------------------------------------------
# Bridging (802.1d)
# Preferred: iproute2, emerge sys-apps/iproute2
diff --git a/net/Makefile b/net/Makefile
index 390f8d8..dab94f9 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -14,7 +14,7 @@ INC-Linux= adsl.sh apipa.sh arping.sh bonding.sh br2684ctl.sh bridge.sh \
ccwgroup.sh clip.sh ethtool.sh iproute2.sh ifplugd.sh ip6to4.sh \
ipppd.sh iwconfig.sh netplugd.sh pppd.sh pump.sh tuntap.sh udhcpc.sh \
vlan.sh macvlan.sh ip6rd.sh firewalld.sh dummy.sh hsr.sh l2tp.sh \
- iw.sh wireguard.sh
+ iw.sh wireguard.sh veth.sh
SRCS-NetBSD= ifwatchd.sh.in
INC-NetBSD= ifwatchd.sh
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [gentoo-commits] proj/netifrc:master commit in: net/, doc/
@ 2020-05-31 23:21 Robin H. Johnson
0 siblings, 0 replies; 12+ messages in thread
From: Robin H. Johnson @ 2020-05-31 23:21 UTC (permalink / raw
To: gentoo-commits
commit: ffa5a9e830c609fec987efac5723781e889ae67c
Author: Arseni Nimera <shorrer <AT> yandex <DOT> by>
AuthorDate: Sat May 30 22:20:25 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sun May 31 23:15:20 2020 +0000
URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=ffa5a9e8
Added macvtap support
Bug: https://bugs.gentoo.org/691372
Signed-off-by: Arseni Nimera <shorrer <AT> yandex.by>
(cherry picked from commit 0dc79645173fad82e0d437a6569b7ea7fa356197)
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
doc/net.example.Linux.in | 3 +++
net/macvlan.sh | 8 ++++++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/doc/net.example.Linux.in b/doc/net.example.Linux.in
index c211ca7..a2993c0 100644
--- a/doc/net.example.Linux.in
+++ b/doc/net.example.Linux.in
@@ -664,6 +664,9 @@
# MAC-VLAN mode (private, vepa, bridge, passtru)
#mode_macvlan0="private"
+# MAC-VLAN type (macvlan, macvtap)
+#type_macvlan0="macvtap"
+
# IP address, MAC address, ... are configured as a normal interface
#config_macvlan0="192.168.20.20/24"
#mac_macvlan0="00:50:06:20:20:20"
diff --git a/net/macvlan.sh b/net/macvlan.sh
index 8d55717..6243858 100644
--- a/net/macvlan.sh
+++ b/net/macvlan.sh
@@ -34,8 +34,12 @@ macvlan_pre_start()
eval mode=\$mode_${IFVAR}
[ -z "${mode}" ] && mode="private"
+ local type=
+ eval type=\$type_${IFVAR}
+ [ -z "${type}" ] && type="macvlan"
+
ebegin "Creating MAC-VLAN ${IFACE} to ${macvlan}"
- e="$(ip link add link "${macvlan}" name "${IFACE}" type macvlan mode "${mode}" 2>&1 1>/dev/null)"
+ e="$(ip link add link "${macvlan}" name "${IFACE}" type "${type}" mode "${mode}" 2>&1 1>/dev/null)"
if [ -n "${e}" ]; then
eend 1 "${e}"
else
@@ -49,6 +53,6 @@ macvlan_post_stop()
_is_macvlan || return 0
ebegin "Removing MAC-VLAN ${IFACE}"
- ip link delete "${IFACE}" type macvlan >/dev/null
+ ip link delete "${IFACE}" >/dev/null
eend $?
}
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [gentoo-commits] proj/netifrc:master commit in: net/, doc/
@ 2020-06-02 21:54 Robin H. Johnson
0 siblings, 0 replies; 12+ messages in thread
From: Robin H. Johnson @ 2020-06-02 21:54 UTC (permalink / raw
To: gentoo-commits
commit: 589d7374dc5c023304f6226cb458d5346bdd3a0b
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 2 21:51:00 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Tue Jun 2 21:53:50 2020 +0000
URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=589d7374
net/iw: implement 802.11s mesh
Closes: https://bugs.gentoo.org/469296
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
doc/net.example.Linux.in | 7 ++++++-
net/iw.sh | 25 +++++++++++++++++++++++++
2 files changed, 31 insertions(+), 1 deletion(-)
diff --git a/doc/net.example.Linux.in b/doc/net.example.Linux.in
index 4fc603b..d88302b 100644
--- a/doc/net.example.Linux.in
+++ b/doc/net.example.Linux.in
@@ -231,7 +231,7 @@
# do require the SSID to be set - do this here
#essid_eth0="any"
-# Set the mode of the interface (managed, ad-hoc, master or auto)
+# Set the mode of the interface (managed, ad-hoc, master, mesh or auto)
# The default is auto
# If it's ad-hoc or master you also may need to specify the channel below
#mode_eth0="auto"
@@ -409,6 +409,11 @@
# NOTE: preferred_aps list ignores blacklisted_aps - so if you have
# the same SSID in both, well, you're a bit silly :p
+# 802.11s mesh support
+# Requires CONFIG_MAC80211_MESH in kernel and hardware support
+#mode_wlan0="mesh"
+#mesh_wlan0="MyMeshNetworkID"
+
############################################################
# wpa_supplicant
diff --git a/net/iw.sh b/net/iw.sh
index dcdbb79..029b9d6 100644
--- a/net/iw.sh
+++ b/net/iw.sh
@@ -5,6 +5,7 @@
_config_vars="$_config_vars ssid mode associate_timeout sleep_scan"
_config_vars="$_config_vars preferred_aps blacklist_aps"
+_config_vars="$_config_vars mesh"
iw_depend()
{
@@ -170,6 +171,26 @@ iw_setup_adhoc()
return 0
}
+iw_setup_mesh()
+{
+ if [ -z "${MESH}" ]; then
+ eerror "${IFACE} requires a MESH to be set to operate in mesh mode"
+ eerror "adjust the mesh_${IFVAR} setting in /etc/conf.d/net"
+ return 1
+ fi
+
+ iw_set_mode 'mesh'
+
+ veinfo "Joining mesh '$MESH' with $IFACE"
+ iw ${IFACE} mesh join "${MESH}" || return 1
+
+ # Finally apply the user Config
+ iw_user_config
+
+ iw_report
+ return 0
+}
+
iw_wait_for_association()
{
local timeout= i=0
@@ -600,6 +621,10 @@ iw_configure()
managed)
# Fall through
;;
+ mesh)
+ iw_setup_mesh
+ return $?
+ ;;
*)
eerror "Only managed and ad-hoc are supported"
return 1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [gentoo-commits] proj/netifrc:master commit in: net/, doc/
@ 2021-01-05 14:27 Lars Wendler
0 siblings, 0 replies; 12+ messages in thread
From: Lars Wendler @ 2021-01-05 14:27 UTC (permalink / raw
To: gentoo-commits
commit: 750d89eaf772551588c460a0c8425579e7d49677
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 5 12:51:41 2021 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Tue Jan 5 14:26:56 2021 +0000
URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=750d89ea
net/pppd.sh: ppp-2.4.9 has renamed rp-pppoe.so to pppoe.so
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
doc/net.example.Linux.in | 5 +++--
net/pppd.sh | 7 +++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/doc/net.example.Linux.in b/doc/net.example.Linux.in
index d88302b..b404329 100644
--- a/doc/net.example.Linux.in
+++ b/doc/net.example.Linux.in
@@ -805,9 +805,10 @@
#link_ppp0="pty 'your_link_command'" # PPP links over ssh, rsh, etc
#
# Here you should specify what pppd plugins you want to use
-# Available plugins are: pppoe, pppoa, capi, dhcpc, minconn, radius,
+# Available plugins are: pppoe, rp-pppoe, pppoa, capi, dhcpc, minconn, radius,
# radattr, radrealms and winbind
-#plugins_ppp0="pppoe" # Required plugin for PPPoE
+#plugins_ppp0="pppoe" # Required plugin for PPPoE with >=ppp-2.4.9
+#plugins_ppp0="rp-pppoe" # Required plugin for PPPoE with <ppp-2.4.9
#plugins_ppp0="pppoa vc-encaps" # Required plugin for PPPoA with an option
#plugins_ppp0="capi" # Required plugin for ISDN
#
diff --git a/net/pppd.sh b/net/pppd.sh
index e3c4d43..c6a6a8a 100644
--- a/net/pppd.sh
+++ b/net/pppd.sh
@@ -175,14 +175,13 @@ pppd_pre_start()
case "$1" in
passwordfd) continue;;
pppoa) shift; set -- "pppoatm" "$@";;
- pppoe) shift; set -- "rp-pppoe" "$@";;
capi) shift; set -- "capiplugin" "$@";;
esac
case "$1" in
- rp-pppoe) haspppoe=true;;
- pppoatm) haspppoa=true;;
+ pppoatm) haspppoa=true;;
+ pppoe|rp-pppoe) haspppoe=true;;
esac
- if [ "$1" = "rp-pppoe" ] || [ "$1" = "pppoatm" -a "${link}" != "/dev/null" ]; then
+ if [ "$1" = "pppoe" ] || [ "$1" = "rp-pppoe" ] || [ "$1" = "pppoatm" -a "${link}" != "/dev/null" ]; then
opts="${opts} connect true"
set -- "$@" "${link}"
fi
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [gentoo-commits] proj/netifrc:master commit in: net/, doc/
@ 2021-01-18 12:33 Lars Wendler
0 siblings, 0 replies; 12+ messages in thread
From: Lars Wendler @ 2021-01-18 12:33 UTC (permalink / raw
To: gentoo-commits
commit: f9951f7d42f1f5ad57e14a29a0be85a80d9a863a
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 18 10:45:36 2021 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Mon Jan 18 12:32:31 2021 +0000
URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=f9951f7d
Convert many "grep" calls to "grep -F"
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
doc/net.example.Linux.in | 6 +++---
net/ifconfig.sh.Linux.in | 2 +-
net/iproute2.sh | 6 +++---
net/iw.sh | 4 ++--
net/iwconfig.sh.Linux.in | 5 ++---
net/wpa_supplicant.sh | 3 +--
6 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/doc/net.example.Linux.in b/doc/net.example.Linux.in
index b404329..bafde42 100644
--- a/doc/net.example.Linux.in
+++ b/doc/net.example.Linux.in
@@ -1365,7 +1365,7 @@
# # Test for link on the interface prior to bringing it up. This
# # only works on some network adapters and requires the
# # sys-apps/net-tools package to be installed.
-# if mii-tool "${IFACE}" 2> /dev/null | grep -q 'no link'; then
+# if mii-tool "${IFACE}" 2> /dev/null | grep -Fq 'no link'; then
# ewarn "No link on ${IFACE}, aborting configuration"
# return 1
# fi
@@ -1373,14 +1373,14 @@
# # Test for link on the interface prior to bringing it up. This
# # only works on some network adapters and requires the ethtool
# # package to be installed.
-# if ethtool "${IFACE}" | grep -q 'Link detected: no'; then
+# if ethtool "${IFACE}" | grep -Fq 'Link detected: no'; then
# ewarn "No link on ${IFACE}, aborting configuration"
# return 1
# fi
#
# # Test to see if we're docked or not and configure like so
# # config_docked="dhcp"
-# if grep -q "1" /sys/devices/platform/dock.0/docked; then
+# if grep -Fq "1" /sys/devices/platform/dock.0/docked; then
# einfo "${IFACE} is docked - configuring"
# _configure_variables "docked"
# fi
diff --git a/net/ifconfig.sh.Linux.in b/net/ifconfig.sh.Linux.in
index 960b239..b0a4551 100644
--- a/net/ifconfig.sh.Linux.in
+++ b/net/ifconfig.sh.Linux.in
@@ -47,7 +47,7 @@ _is_wireless()
-d /sys/class/net/"${IFACE}"/phy80211 ] && return 0
[ ! -e /proc/net/wireless ] && return 1
- grep -Eq "^[[:space:]]*${IFACE}:" /proc/net/wireless
+ grep -q "^[[:space:]]*${IFACE}:" /proc/net/wireless
}
_set_flag()
diff --git a/net/iproute2.sh b/net/iproute2.sh
index d19f79d..4c32acc 100644
--- a/net/iproute2.sh
+++ b/net/iproute2.sh
@@ -192,7 +192,7 @@ _add_address()
# Check for address already existing:
ip addr show to "${address}/${family_maxnetmask}" dev "${IFACE}" 2>/dev/null | \
- fgrep -sq "${address}"
+ grep -Fsq "${address}"
address_already_exists=$?
# This must appear on a single line, continuations cannot be used
@@ -265,7 +265,7 @@ _add_route()
# Check for route already existing:
ip ${family} route show ${cmd_nometric} dev "${IFACE}" 2>/dev/null | \
- fgrep -sq "${cmd%% *}"
+ grep -Fsq "${cmd%% *}"
route_already_exists=$?
_cmd ip ${family} route append ${cmd} dev "${IFACE}"
@@ -304,7 +304,7 @@ _delete_addresses()
_has_carrier()
{
- LC_ALL=C ip link show dev "${IFACE}" | grep -q "LOWER_UP"
+ LC_ALL=C ip link show dev "${IFACE}" | grep -Fq "LOWER_UP"
}
# Used by iproute2, ip6rd & ip6to4
diff --git a/net/iw.sh b/net/iw.sh
index 029b9d6..1f8b068 100644
--- a/net/iw.sh
+++ b/net/iw.sh
@@ -212,7 +212,7 @@ iw_wait_for_association()
# carrier on or buggy madwifi drivers that
# sometimes have carrier on and ssid set
# without being associated. :/
- [ -n "$(iw dev "${IFACE}" info |grep ssid)" ] && [ "${station_mac}" != "00:00:00:00:00:00" ] && return 0
+ [ -n "$(iw dev "${IFACE}" info | grep -F ssid)" ] && [ "${station_mac}" != "00:00:00:00:00:00" ] && return 0
fi
else
local atest=
@@ -704,7 +704,7 @@ iw_pre_start()
# Store the fact that tx-power was off so we default to a longer
# wait if our scan returns nothing
- LC_ALL=C iw dev "${IFACE}" info | sed -e '1d' | grep -q "txpower 0.00"
+ LC_ALL=C iw dev "${IFACE}" info | sed -e '1d' | grep -Fq "txpower 0.00"
local txpowerwasoff=$?
iw_defaults
diff --git a/net/iwconfig.sh.Linux.in b/net/iwconfig.sh.Linux.in
index 02f748d..98044a9 100644
--- a/net/iwconfig.sh.Linux.in
+++ b/net/iwconfig.sh.Linux.in
@@ -17,9 +17,8 @@ iwconfig_get_wep_status()
{
local mode= status="disabled"
- # No easy way of doing this grep in bash regex :/
if LC_ALL=C iwconfig "${IFACE}" | \
- grep -qE "^ +Encryption key:[*0-9,A-F]"; then
+ grep -Eq "^ +Encryption key:[*0-9,A-F]"; then
status="enabled"
mode=$(LC_ALL=C iwconfig "${IFACE}" | \
sed -n -e 's/^.*Security mode:\(.*[^ ]\).*/\1/p')
@@ -710,7 +709,7 @@ iwconfig_pre_start()
# Store the fact that tx-power was off so we default to a longer
# wait if our scan returns nothing
- LC_ALL=C iwconfig "${IFACE}" | sed -e '1d' | grep -q "Tx-Power=off"
+ LC_ALL=C iwconfig "${IFACE}" | sed -e '1d' | grep -Fq "Tx-Power=off"
local txpowerwasoff=$?
iwconfig_defaults
diff --git a/net/wpa_supplicant.sh b/net/wpa_supplicant.sh
index 607d4e1..d5e2013 100644
--- a/net/wpa_supplicant.sh
+++ b/net/wpa_supplicant.sh
@@ -10,8 +10,7 @@ wpa_supplicant_depend()
program start ${wpas}
# bug 345281: if wpa_supplicant is built w/ USE=dbus, we need to start
# dbus before we can start wpa_supplicant.
- ${wpas} -h |grep DBus -sq
- [ $? -eq 0 ] && need dbus
+ ${wpas} -h | grep -Fsq DBus && need dbus
fi
after macnet plug
before interface
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [gentoo-commits] proj/netifrc:master commit in: net/, doc/
@ 2021-04-05 20:00 Robin H. Johnson
0 siblings, 0 replies; 12+ messages in thread
From: Robin H. Johnson @ 2021-04-05 20:00 UTC (permalink / raw
To: gentoo-commits
commit: 4bd8be5f43d07a9e92b73174c7fbef8b989aaa55
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 5 19:54:47 2021 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Mon Apr 5 20:00:28 2021 +0000
URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=4bd8be5f
net/ethtool: support more ethtool config knobs
Additional options now supported:
--set-channels
--set-dump
--set-fec
--set-phy-tunable
--set-priv-flags
--set-rxfh-indir
--per-queue
--features
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
doc/net.example.Linux.in | 6 +++---
net/ethtool.sh | 15 +++++++++++++--
2 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/doc/net.example.Linux.in b/doc/net.example.Linux.in
index b2c0f82..e59ce52 100644
--- a/doc/net.example.Linux.in
+++ b/doc/net.example.Linux.in
@@ -1318,10 +1318,10 @@
# flash change-eeprom change pause eee coalesce ring offload tunable identify nfc rxfh-indir ntuple
# Set global order to default
-#ethtool_order="flash change-eeprom change pause eee coalesce ring offload tunable identify nfc rxfh-indir ntuple"
+#ethtool_order="flash change-eeprom change priv-flags channels dump pause eee fec coalesce per-queue ring offload features phy-tunable tunable identify nfc rxfh-indir ntuple"
-# Hypothetical network card that requires a change-eeprom toggle to enable flashing
-#ethtool_order_eth0="change-eeprom flash change pause eee coalesce ring offload tunable nfc rxfh-indir ntuple"
+# Hypothetical network card that requires a change-eeprom or priv-flags toggle to enable flashing
+#ethtool_order_eth0="priv-flags change-eeprom flash channels dump pause eee fec coalesce per-queue ring offload features phy-tunable tunable identify nfc rxfh-indir ntuple"
#-----------------------------------------------------------------------------
# Firewalld support
diff --git a/net/ethtool.sh b/net/ethtool.sh
index 0bcceff..ee595a2 100644
--- a/net/ethtool.sh
+++ b/net/ethtool.sh
@@ -17,7 +17,7 @@ ethtool_pre_start() {
local order opt OFS="${OIFS}"
eval order=\$ethtool_order_${IFVAR}
[ -z "${order}" ] && eval order=\$ethtool_order
- [ -z "${order}" ] && order="flash change-eeprom change pause eee coalesce ring offload tunable identify nfc rxfh-indir ntuple"
+ [ -z "${order}" ] && order="flash change-eeprom change priv-flags channels dump pause eee fec coalesce per-queue ring offload features phy-tunable tunable identify nfc rxfh-indir ntuple"
# ethtool options not used: --driver, --register-dump, --eeprom-dump, --negotiate, --test, --statistics
eindent
for opt in ${order} ; do
@@ -36,7 +36,18 @@ ethtool_pre_start() {
local args_pretty="$(_trim "${p}")"
# Do nothing if empty
[ -z "${args_pretty}" ] && continue
- [ "${opt}" = "eee" -o "${opt}" = "ring" -o "${opt}" = "tunable" ] && opt="set-${opt}"
+ case "$opt" in
+ # Cleaner to patch in future for new options
+ channels) opt="set-${opt}" ;;
+ dump) opt="set-${opt}" ;;
+ eee) opt="set-${opt}" ;;
+ fec) opt="set-${opt}" ;;
+ phy-tunable) opt="set-${opt}" ;;
+ priv-flags) opt="set-${opt}" ;;
+ ring) opt="set-${opt}" ;;
+ rxfh-indir) opt="set-${opt}" ;;
+ tunable) opt="set-${opt}" ;;
+ esac
args_pretty="--${opt} $IFACE ${args_pretty}"
args="--${opt} $IFACE ${args}"
ebegin "ethtool ${args_pretty}"
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [gentoo-commits] proj/netifrc:master commit in: net/, doc/
@ 2021-04-05 20:00 Robin H. Johnson
0 siblings, 0 replies; 12+ messages in thread
From: Robin H. Johnson @ 2021-04-05 20:00 UTC (permalink / raw
To: gentoo-commits
commit: b8373edc844297fb54333ffab69d0cd0a7b5e0b8
Author: Maciej S. Szmigiero <mail <AT> maciej <DOT> szmigiero <DOT> name>
AuthorDate: Sat Mar 27 22:32:35 2021 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sat Mar 27 22:34:02 2021 +0000
URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=b8373edc
net/ethtool.sh: add "eee" and "tunable" setting operations
This adds an ability to set "eee" and "tunable" ethtool parameters of a
network interface.
Signed-off-by: Maciej S. Szmigiero <mail <AT> maciej.szmigiero.name>
doc/net.example.Linux.in | 12 +++++++++---
net/ethtool.sh | 4 ++--
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/doc/net.example.Linux.in b/doc/net.example.Linux.in
index 3bd2ee1..b2c0f82 100644
--- a/doc/net.example.Linux.in
+++ b/doc/net.example.Linux.in
@@ -1275,12 +1275,18 @@
#ethtool_pause_eth0="autoneg off
#rx on tx on"
+# Enable Energy-Efficient Ethernet
+#ethtool_eee_eth0="eee on"
+
# Enable adaptive RX and TX coalescing
#ethtool_coalesce_eth0="adaptive-rx on adaptive-tx on"
# Change ring buffer settings
#ethtool_ring_eth0=""
+# Set RX copy-break at 1500 bytes
+#ethtool_tunable_eth0="rx-copybreak 1500"
+
# Enable all offload settings
#ethtool_offload_eth0="rx on tx on sg on tso on ufo on gso on gro on lro on"
@@ -1309,13 +1315,13 @@
# Additionally, there is a special control variable, if you need to change the
# order of option processing. The default order is:
-# flash change-eeprom change pause coalesce ring offload identify nfc rxfh-indir ntuple
+# flash change-eeprom change pause eee coalesce ring offload tunable identify nfc rxfh-indir ntuple
# Set global order to default
-#ethtool_order="flash change-eeprom change pause coalesce ring offload identify nfc rxfh-indir ntuple"
+#ethtool_order="flash change-eeprom change pause eee coalesce ring offload tunable identify nfc rxfh-indir ntuple"
# Hypothetical network card that requires a change-eeprom toggle to enable flashing
-#ethtool_order_eth0="change-eeprom flash change pause coalesce ring offload nfc rxfh-indir ntuple"
+#ethtool_order_eth0="change-eeprom flash change pause eee coalesce ring offload tunable nfc rxfh-indir ntuple"
#-----------------------------------------------------------------------------
# Firewalld support
diff --git a/net/ethtool.sh b/net/ethtool.sh
index 57c98f7..0bcceff 100644
--- a/net/ethtool.sh
+++ b/net/ethtool.sh
@@ -17,7 +17,7 @@ ethtool_pre_start() {
local order opt OFS="${OIFS}"
eval order=\$ethtool_order_${IFVAR}
[ -z "${order}" ] && eval order=\$ethtool_order
- [ -z "${order}" ] && order="flash change-eeprom change pause coalesce ring offload identify nfc rxfh-indir ntuple"
+ [ -z "${order}" ] && order="flash change-eeprom change pause eee coalesce ring offload tunable identify nfc rxfh-indir ntuple"
# ethtool options not used: --driver, --register-dump, --eeprom-dump, --negotiate, --test, --statistics
eindent
for opt in ${order} ; do
@@ -36,7 +36,7 @@ ethtool_pre_start() {
local args_pretty="$(_trim "${p}")"
# Do nothing if empty
[ -z "${args_pretty}" ] && continue
- [ "${opt}" = "ring" ] && opt="set-ring"
+ [ "${opt}" = "eee" -o "${opt}" = "ring" -o "${opt}" = "tunable" ] && opt="set-${opt}"
args_pretty="--${opt} $IFACE ${args_pretty}"
args="--${opt} $IFACE ${args}"
ebegin "ethtool ${args_pretty}"
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [gentoo-commits] proj/netifrc:master commit in: net/, doc/
@ 2023-11-25 4:54 Robin H. Johnson
0 siblings, 0 replies; 12+ messages in thread
From: Robin H. Johnson @ 2023-11-25 4:54 UTC (permalink / raw
To: gentoo-commits
commit: a0b69349707b4aaaefc01fd37f1b386935d75c90
Author: Alon Bar-Lev <alon.barlev <AT> gmail <DOT> com>
AuthorDate: Sun May 14 21:38:28 2023 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sat Nov 25 04:54:01 2023 +0000
URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=a0b69349
net: add qmi interface support
qmi is useful for cellular modem connection, the management interface is
implemented using libqmi's qmicli utility.
Signed-off-by: Alon Bar-Lev <alon.barlev <AT> gmail.com>
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
Closes: https://github.com/gentoo/netifrc/pull/44
doc/net.example.Linux.in | 13 +++++
net/Makefile | 2 +-
net/qmi.sh | 133 +++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 147 insertions(+), 1 deletion(-)
diff --git a/doc/net.example.Linux.in b/doc/net.example.Linux.in
index 42b8071..cbd81e7 100644
--- a/doc/net.example.Linux.in
+++ b/doc/net.example.Linux.in
@@ -1132,6 +1132,19 @@
#l2tpsession_l2tpeth2="tunnel_id 2 session_id 1 peer_session_id 1"
#config_l2tpeth2="10.100.2.1/24"
+#-----------------------------------------------------------------------------
+# QMI
+# For QMI support, emerge net-libs/libqmi
+# QMI is used for some cellular modems.
+#
+# Each QMI interface may have the following configuration:
+#qmi_apn_wwan0= # The name of the APN
+#qmi_auth_wwan0= # none, pop, chap, both, Default: none
+#qmi_username_wwan0= # Default: dummy
+#qmi_password_wwan0= # Default dummy
+#qmi_cdc_wwan0= # Default: /dev/cdc-wmiX where X is taken from IFACE
+#-----------------------------------------------------------------------------
+
#-----------------------------------------------------------------------------
# Advanced Routing
# WARNING: For advanced routing you MUST be using sys-apps/iproute2
diff --git a/net/Makefile b/net/Makefile
index 58483cd..f562d15 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -14,7 +14,7 @@ INC-Linux= adsl.sh apipa.sh arping.sh bonding.sh br2684ctl.sh bridge.sh \
ccwgroup.sh clip.sh ethtool.sh iproute2.sh ifplugd.sh ip6to4.sh \
ipppd.sh iwconfig.sh netplugd.sh pppd.sh pump.sh tuntap.sh udhcpc.sh \
vlan.sh macvlan.sh ip6rd.sh firewalld.sh dummy.sh hsr.sh l2tp.sh \
- iw.sh iwd.sh wireguard.sh veth.sh dhclientv6.sh
+ iw.sh iwd.sh wireguard.sh veth.sh dhclientv6.sh qmi.sh
SRCS-NetBSD= ifwatchd.sh.in
INC-NetBSD= ifwatchd.sh
diff --git a/net/qmi.sh b/net/qmi.sh
new file mode 100644
index 0000000..ac1b2dd
--- /dev/null
+++ b/net/qmi.sh
@@ -0,0 +1,133 @@
+# Copyright (c) 2011 by Gentoo Foundation
+# Released under the 2-clause BSD license.
+# shellcheck shell=sh disable=SC1008
+
+_is_qmi() {
+ [ -d "/sys/class/net/${IFACE}/qmi" ]
+}
+
+_get_state() {
+ echo "/run/net.${IFACE}.qmi.state"
+}
+
+_get_device() {
+ echo "/dev/cdc-$(echo "${IFACE}" | sed 's/wwan/wdm/')"
+}
+
+qmi_depend()
+{
+ program qmicli
+ program ip
+ before interface
+}
+
+qmi_pre_start() {
+
+ _is_qmi || return 0
+
+ local device
+ local apn
+ local auth
+ local username
+ local password
+ local out
+ local rc
+
+ eval device=\$qmi_cdc_${IFVAR}
+ eval apn=\$qmi_apn_${IFVAR}
+ eval auth=\$qmi_auth_${IFVAR}
+ eval username=\$qmi_username_${IFVAR}
+ eval password=\$qmi_password_${IFVAR}
+
+ [ -n "${apn}" ] || return 0
+
+ [ -n "${device}" ] || device="$(_get_device)"
+ [ -n "${auth}" ] || auth="none"
+ [ -n "${username}" ] || username="dummy"
+ [ -n "${password}" ] || password="dummy"
+
+ if ! [ -c "${device}" ]; then
+ ewarn "Cannot open device ${device} for ${IFACE}, aborting configuration"
+ return 1
+ fi
+
+ if ! cat "/sys/class/net/${IFACE}/qmi/raw_ip" | grep -q Y; then
+ ebegin "Configuring QMI raw IP"
+
+ ip link set "${IFACE}" down
+ if ! echo Y > "/sys/class/net/${IFACE}/qmi/raw_ip"; then
+ eend 1 "Cannot set raw IP mode for ${IFACE}, aborting configuration"
+ return 1
+ else
+ eend 0
+ fi
+ fi
+
+ local wwan_connection="apn='${apn}',auth='${auth}',username='${username}',password='${password}',autoconnect=yes,ip-type=4"
+ local n
+ for n in 1 2 3; do
+ ebegin "Connecting QMI APN '${apn}' using '${username}'"
+
+ if out="$( \
+ qmicli \
+ --device="${device}" \
+ --wds-start-network="${wwan_connection}" \
+ --device-open-proxy \
+ --client-no-release-cid \
+ )"; then
+ eend 0
+ break
+ elif echo "${out}" | grep -qi "timed out"; then
+ eend 1 "QMI start network timeout"
+ else
+ eend 1 "QMI start network failed for ${IFACE}, aborting"
+ return 1
+ fi
+ done
+
+ local handle="$(echo "${out}" | grep "Packet data handle:" | sed "s/.*'\(.*\)'.*/\1/")"
+ local cid="$(echo "${out}" | grep "CID:" | sed "s/.*'\(.*\)'.*/\1/")"
+
+ if [ -z "${handle}" ]; then
+ ewarn 1 "No QMI connection handle ${IFACE}, aborting configuration"
+ return 1
+ fi
+
+ if [ -z "${cid}" ]; then
+ ewarn "No QMI connection id ${IFACE}, aborting configuration"
+ return 1
+ fi
+
+ cat > "$(_get_state)" << __EOF__
+device="${device}"
+handle="${handle}"
+cid="${cid}"
+__EOF__
+}
+
+qmi_post_stop() {
+
+ _is_qmi || return 0
+
+ local state="$(_get_state)"
+
+ [ -f "${state}" ] || return 0
+
+ ebegin "Disconnecting QMI ${IFACE}"
+
+ local device
+ local handle
+ local cid
+
+ . "${state}"
+
+ qmicli \
+ --device="${device}" \
+ --client-cid="${cid}" \
+ --wds-stop-network="${handle}"
+ rc="$?"
+
+ rm -f "${state}"
+
+ eend "${rc}"
+}
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [gentoo-commits] proj/netifrc:master commit in: net/, doc/
@ 2024-01-07 9:42 Sam James
0 siblings, 0 replies; 12+ messages in thread
From: Sam James @ 2024-01-07 9:42 UTC (permalink / raw
To: gentoo-commits
commit: 7b1c09f80b94f01f670c8d487df361b3ddfebe0c
Author: Matoro Mahri <matoro_gentoo <AT> matoro <DOT> tk>
AuthorDate: Sun Jan 7 07:16:30 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jan 7 09:42:35 2024 +0000
URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=7b1c09f8
Remove support for treecleaned net-misc/pump
Bug: https://bugs.gentoo.org/694314
Closes: https://bugs.gentoo.org/921538
Signed-off-by: Matoro Mahri <matoro_gentoo <AT> matoro.tk>
Closes: https://github.com/gentoo/netifrc/pull/51
Signed-off-by: Sam James <sam <AT> gentoo.org>
doc/net.example.Linux.in | 7 ++----
net/Makefile | 2 +-
net/dhclient.sh | 2 +-
net/dhcpcd.sh | 2 +-
net/pump.sh | 63 ------------------------------------------------
5 files changed, 5 insertions(+), 71 deletions(-)
diff --git a/doc/net.example.Linux.in b/doc/net.example.Linux.in
index cbd81e7..84e4b1c 100644
--- a/doc/net.example.Linux.in
+++ b/doc/net.example.Linux.in
@@ -493,11 +493,10 @@
#-----------------------------------------------------------------------------
# DHCP
-# DHCP can be provided by dhclient, dhcpcd, pump or udhcpc.
+# DHCP can be provided by dhclient, dhcpcd, or udhcpc.
#
# dhclient: emerge net-misc/dhcp
# dhcpcd: emerge net-misc/dhcpcd
-# pump: emerge net-misc/pump
# udhcpc: emerge sys-apps/busybox
# If you have more than one DHCP client installed, you need to specify which
@@ -508,7 +507,6 @@
# - All clients send the current hostname to the DHCP server by default
# - dhcpcd does not daemonize when the lease time is infinite
# - udhcp-0.9.3-r3 and earlier do not support getting NTP servers
-# - pump does not support getting NIS servers
# - DHCP tends to erase any existing device information - so add
# static addresses after dhcp if you need them
# - dhclient and udhcpc can set other resolv.conf options such as "option"
@@ -524,11 +522,10 @@
# default) to 10 seconds.
#dhcpcd_eth0="-t 10"
-# dhclient, udhcpc and pump don't have many runtime options
+# dhclient and udhcpc don't have many runtime options
# You can pass options to them in a similar manner to dhcpcd though
#dhclient_eth0="..."
#udhcpc_eth0="..."
-#pump_eth0="..."
# GENERIC DHCP OPTIONS
# Set generic DHCP options like so
diff --git a/net/Makefile b/net/Makefile
index f562d15..22bd8d1 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -12,7 +12,7 @@ INC-FreeBSD= iwconfig.sh
SRCS-Linux= iwconfig.sh.in udhcpc.sh.in
INC-Linux= adsl.sh apipa.sh arping.sh bonding.sh br2684ctl.sh bridge.sh \
ccwgroup.sh clip.sh ethtool.sh iproute2.sh ifplugd.sh ip6to4.sh \
- ipppd.sh iwconfig.sh netplugd.sh pppd.sh pump.sh tuntap.sh udhcpc.sh \
+ ipppd.sh iwconfig.sh netplugd.sh pppd.sh tuntap.sh udhcpc.sh \
vlan.sh macvlan.sh ip6rd.sh firewalld.sh dummy.sh hsr.sh l2tp.sh \
iw.sh iwd.sh wireguard.sh veth.sh dhclientv6.sh qmi.sh
diff --git a/net/dhclient.sh b/net/dhclient.sh
index 6fa4a92..ce964b0 100644
--- a/net/dhclient.sh
+++ b/net/dhclient.sh
@@ -9,7 +9,7 @@ dhclient_depend()
provide dhcp
# We prefer dhclient over these
- after udhcpc pump
+ after udhcpc
}
_config_vars="$_config_vars dhcp dhcpcd"
diff --git a/net/dhcpcd.sh b/net/dhcpcd.sh
index 2493f27..e159f0a 100644
--- a/net/dhcpcd.sh
+++ b/net/dhcpcd.sh
@@ -10,7 +10,7 @@ dhcpcd_depend()
provide dhcp
# We prefer dhcpcd over these
- after udhcpc pump dhclient
+ after udhcpc dhclient
}
_config_vars="$_config_vars dhcp dhcpcd"
diff --git a/net/pump.sh b/net/pump.sh
deleted file mode 100644
index 144316f..0000000
--- a/net/pump.sh
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
-# Released under the 2-clause BSD license.
-# shellcheck shell=sh disable=SC1008
-
-pump_depend()
-{
- program pump
- after interface
- provide dhcp
-
- # We prefer pump over udhcpc
- after udhcpc
-}
-
-_config_vars="$_config_vars dhcp pump"
-
-pump_start()
-{
- local args= opt= opts=
-
- # Get our options
- eval opts=\$dhcp_${IFVAR}
- [ -z "${opts}" ] && opts=${dhcp}
-
- # Map some generic options to dhcpcd
- for opt in ${opts}; do
- case "${opt}" in
- nodns) args="${args} --no-dns";;
- nontp) args="${args} --no-ntp";;
- nogateway) args="${args} --no-gateway";;
- esac
- done
-
- # Add our route metric
- [ "${metric:-0}" != "0" ] && args="${args} --route-metric ${metric}"
-
- args="${args} --win-client-ident"
- args="${args} --keep-up --interface ${IFACE}"
-
- ebegin "Running pump"
- eval pump "${args}"
- eend $? || return 1
-
- _show_address
- return 0
-}
-
-pump_stop()
-{
- # We check for a pump process first as querying for status
- # causes pump to spawn a process
- start-stop-daemon --quiet --test --stop --exec pump || return 0
-
- # Check that pump is running on the interface
- if ! pump --status --interface "${IFACE}" >/dev/null 2>&1; then
- return 0
- fi
-
- # Pump always releases the lease
- ebegin "Stopping pump on ${IFACE}"
- pump --release --interface "${IFACE}"
- eend $? "Failed to stop pump"
-}
^ permalink raw reply related [flat|nested] 12+ messages in thread
end of thread, other threads:[~2024-01-07 9:42 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-18 12:33 [gentoo-commits] proj/netifrc:master commit in: net/, doc/ Lars Wendler
-- strict thread matches above, loose matches on Subject: below --
2024-01-07 9:42 Sam James
2023-11-25 4:54 Robin H. Johnson
2021-04-05 20:00 Robin H. Johnson
2021-04-05 20:00 Robin H. Johnson
2021-01-05 14:27 Lars Wendler
2020-06-02 21:54 Robin H. Johnson
2020-05-31 23:21 Robin H. Johnson
2019-04-21 4:11 Robin H. Johnson
2015-11-08 14:30 Robin H. Johnson
2015-11-08 14:30 Robin H. Johnson
2013-08-28 16:02 Robin H. Johnson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox