connman: implement network interface management techniques
PATCH 1/1 connman: implement network interface management techniques
This is required to obtain a managed network interface before connman tries to call cleanup_devices function, this will let connman create new routing table without bringing down the ethernet interface.
Signed-off-by Srikanth Krishnakar <[email protected]
Signed-off-by Muhammad Hamza <[email protected]>
--- src/connman.service.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
src/connman.service.in +4 -1
@@ -12,7 +12,10 @@ Conflicts=systemd-resolved.service Type=dbus BusName=net.connman Restart=on-failure -ExecStart=@sbindir@/connmand -n +EnvironmentFile=-/tmp/connman.env +ExecStartPre=/bin/sh -c "if grep 'nfsroot\|ip=' /proc/cmdline; then ETH_IFACE=$(ip addr | grep 'eth[0-9]:' | grep 'UP' | sed -e 's,\(eth[0-9]\)\(.*\),\1,' -e 's,^.*: ,,' ); NET_ADDR=$(cat /proc/cmdline | sed -ne 's/^.*ip=\([^ :]*\).*$/\1/p'); echo -e 'OPT=-I '$ETH_IFACE'\nOPT2='$ETH_IFACE'\nNET_ADDR='$NET_ADDR' ' > /tmp/connman.env; fi " +ExecStart=/bin/sh -c "if [ \"$NET_ADDR\" = \"off\" ] || [ \"$NET_ADDR\" = \"none\" ]; then /usr/sbin/connmand -n; else /usr/sbin/connmand -n $OPT; fi" +ExecStartPost=/bin/sh -c "if [ ! -z \"$OPT\" ] && [ \"$NET_ADDR\" = \"dhcp\" ]; then /sbin/udhcpc -i $OPT2; fi" StandardOutput=null CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_RAW CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_ADMIN ProtectHome=true
Signature · 1 line
2.25.1
Quoted 3 lines · Muhammad Hamza
This is required to obtain a managed network interface before connman tries to call
cleanup_devicesfunction, this will let connman create new routing table without bringing down the ethernet interface.
There is code in connman which should detect this scenario. If it doesn't work you should look at it and figure out why it doesn't work.