ser2net: support 'host' option in ser2net_proxy() to allow binding to a specific IP (e.g. 127.0.0.1)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
Research direction
Read net/ser2net/files/ser2net.init, especially ser2net_proxy() and ser2net_controlport(). Compare how the proxy validates its port and how the control port handles the optional host, then inspect the generated /tmp/ser2net.yaml. Done means a proxy can bind to a configured host while an unset host keeps the existing behavior.
Written by the indexing model from the issue text.
Description
Package Name
ser2net
Maintainer
@dangowrt
OpenWrt Version
25.12.6
OpenWrt Target/Subtarget
ipq40xx/generic
Steps to Reproduce
- Configure a
proxysection in/etc/config/ser2netto expose a local USB serial device (e.g./dev/ttyUSB0) only on the loopback interface (127.0.0.1) so that an encrypted wrapper (stunnelor SSH port forwarding) can front it securely:
uci set ser2net.zigbee='proxy'
uci set ser2net.zigbee.enabled='1'
uci set ser2net.zigbee.port='127.0.0.1,16638'
uci set ser2net.zigbee.protocol='raw'
uci set ser2net.zigbee.device='/dev/ttyUSB0'
uci set ser2net.zigbee.baudrate='115200'
uci commit ser2net
- Restart the service using
service ser2net restart. - Inspect the standard error output and
/tmp/ser2net.yaml.
Actual Behaviour
In /etc/init.d/ser2net (net/ser2net/files/ser2net.init), ser2net_proxy() strictly validates $port as an integer and does not read a host option:
config_get port "$cfg" port
[ "$port" -ge 1 ] && [ "$port" -le 65535 ] || return 1
Passing 127.0.0.1,16638 (or 127.0.0.1:16638) in option port fails with sh: 127.0.0.1,16638: bad number and ser2net_proxy() exits early (return 1), omitting the connection: block from /tmp/ser2net.yaml.
By contrast, ser2net_controlport() in the same init script already supports an optional host parameter:
config_get host "$cfg" host
...
echo "admin:"
echo " accepter: tcp,${host:+$host,}$port"
Expected Behaviour
`ser2net_proxy()` should support an optional `host` UCI option (matching `ser2net_controlport()`) to generate `accepter: $protocol,${host:+$host,}$port` in `/tmp/ser2net.yaml`, allowing administrators to bind serial proxies to `127.0.0.1` or a specific management IP via UCI while maintaining full backward compatibility when `host` is unset.
Thank you for maintaining LuCI and luci-app-ser2net!!
Confirmation Checklist
- The package is maintained in this repository.
- I understand that issues related to the base OpenWrt repository or LuCI repository will be closed.
- I am reporting an issue for OpenWrt, not an unsupported fork.
- Dominant language
- Makefile
- Stars
- 4.7k
- Forks
- 4k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 249
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openwrt/packages
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
openwrt/packages#31307 · 1 comment ·
Maintainers usually reply within 1 day
All issues in openwrt/packages
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
15-minutes algorithm all-levels any-language beginner-friendly codewars good first issue hackerrank help wanted interview-prep leetcode open-source students
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Huerte/algo-solutions-python#279 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
apache/flink-agents#1395 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day