Print the errors and return an error exit code if errors are encountered while setting up the network. This doesn't interrupt the execution, and it probably should; however, the patch is minimally invasive. It changes stdout by printing the error, and it changes the exit code; otherwise, the logic is unchanged.
The way I tested this was on a machine where IPv6 has been disabled. It could be similarly tested in a container or VM where ip6 has been disabled. Here's an example run:
phaethusa ~ % sudo ./dsnet up
error bringing up the network: could not add ipv6 addr 2607:f7a0:16:5::c05e to interface permission denied
phaethusa ~ % echo $?
1
Print the errors and return an error exit code if errors are encountered while setting up the network. This doesn't interrupt the execution, and it probably should; however, the patch is minimally invasive. It changes stdout by printing the error, and it changes the exit code; otherwise, the logic is unchanged.
The way I tested this was on a machine where IPv6 has been disabled. It could be similarly tested in a container or VM where ip6 has been disabled. Here's an example run: