File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -201,7 +201,7 @@ pf_del()
201
201
202
202
fw_expose_add()
203
203
{
204
- local _ret _inaddr
204
+ local _ret= _inaddr= _res= _test=
205
205
206
206
[ "${inaddr}" = "nodeip" ] && inaddr="0"
207
207
@@ -242,16 +242,27 @@ fw_expose_add()
242
242
243
243
case "${proto}" in
244
244
tcp)
245
- res=$( $ {NC_CMD} -w1 -z ${_inaddr} ${in} 2>/dev/null )
245
+ _test="$ {NC_CMD} -w1 -z ${_inaddr} ${in}"
246
246
;;
247
247
udp)
248
- res=$( $ {NC_CMD} -u -w1 -z ${_inaddr} ${in} 2>/dev/null )
248
+ _test="$ {NC_CMD} -u -w1 -z ${_inaddr} ${in}"
249
249
;;
250
250
esac
251
251
252
- if [ $? -eq 0 ]; then
253
- ${ECHO} "${W1_COLOR}${CBSD_APP} warning: ${N1_COLOR}port already in use on ${_inaddr}: ${N2_COLOR}${proto}/${in}${N0_COLOR}"
254
- return 1
252
+ ${_test} 2>/dev/null
253
+ _ret=$?
254
+
255
+ if [ ${_ret} -eq 0 ]; then
256
+ ${ECHO} "${W1_COLOR}${CBSD_APP} warning: ${N1_COLOR}port already in use on ${_inaddr}?: ${N2_COLOR}${proto}/${in}${N0_COLOR}"
257
+ case "${proto}" in
258
+ tcp)
259
+ ${ECHO} "${N1_COLOR}Test string: '${N2_COLOR}${_test}${N1_COLOR}' (check errcode)${N0_COLOR}"
260
+ return 1
261
+ ;;
262
+ udp)
263
+ ${ECHO} "${N1_COLOR}Test string: '${N2_COLOR}${_test}${N1_COLOR}' (check errcode). Possible false positive for UDP, let's try to continue${N0_COLOR}"
264
+ ;;
265
+ esac
255
266
fi
256
267
257
268
if [ -z "${fromips}" ]; then
You can’t perform that action at this time.
0 commit comments