Skip to content

Commit 6b4ea40

Browse files
author
olevole
committed
fix epair
1 parent 70ebe4f commit 6b4ea40

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

sudoexec/jstart

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -559,15 +559,16 @@ if [ "${vnet}" = "1" ]; then
559559
esac
560560

561561
case "${tmp_iface}" in
562-
epair*)
563-
nic_type="epair"
562+
ppt_*)
563+
nic_type="ppt"
564564
;;
565565
*)
566-
nic_type="ppt"
566+
nic_type="epair"
567567
;;
568568
esac
569569

570570
unset tmp_type tmp_type
571+
#echo "NIC TYPE [$i]: ${nic_type}"
571572

572573
nic_hwaddr=
573574
nic_parent=
@@ -651,7 +652,7 @@ if [ "${vnet}" = "1" ]; then
651652
${distdir}/tools/vale-ctl -h vale${valeid}:${myepair}a
652653
esac
653654

654-
printf "${H3_COLOR}${myepair}:${N2_COLOR}${nic_parent} "
655+
printf "${H3_COLOR}${myepair}(type:${nic_type}):${N2_COLOR}${nic_parent} "
655656

656657
case "${nic_type}" in
657658
ppt)
@@ -683,13 +684,16 @@ if [ "${vnet}" = "1" ]; then
683684
cbsdsqlrw ${jailsysdir}/${jname}/local.sqlite "UPDATE jailnic SET nic_hwaddr='${nic_hwaddr}' WHERE name='${i}'"
684685
fi
685686

687+
_iface_rename=0
688+
686689
case "${nic_type}" in
687690
ppt)
688691
cbsdlogger NOTICE ${CBSD_APP}: jail ${jname}: set hwaddr for vnet interface ${myepair}: ${nic_hwaddr}
689692
${IFCONFIG_CMD} ${myepair} ether ${nic_hwaddr}
690693
;;
691694
*)
692695
cbsdlogger NOTICE ${CBSD_APP}: jail ${jname}: set hwaddr for vnet interface ${myepair}b: ${nic_hwaddr}
696+
_iface_rename=1
693697
${IFCONFIG_CMD} ${myepair}b ether ${nic_hwaddr}
694698
if [ "${nic_address}" != "0" ]; then
695699
${IFCONFIG_CMD} ${myepair}a inet ${nic_address} up
@@ -928,7 +932,7 @@ if [ ${vnet} -eq 1 ]; then
928932
${IFCONFIG_CMD} ${i} up
929933
# we need setup lock here due to ethX name possible conflict with other jail
930934
_wait_count=0
931-
_iface_rename=0
935+
[ -z "${_iface_rename}" ] && _iface_rename=0
932936

933937
if [ ${_iface_rename} -eq 1 ]; then
934938
while [ -r ${tmpdir}/eth${eth_seq}.locked ]; do

0 commit comments

Comments
 (0)