Skip to content

Commit 1475d1e

Browse files
Merge pull request #16 from Takalele/dataplane_type_pcapInt_or_p4emu
interface ordering fix
2 parents e792cd2 + 27e0ad8 commit 1475d1e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

functions.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ remove_p4_telnet() {
193193
perl -0777 -i -pe 's/\!\nserver telnet p4\n.*?exit\n\!//s' $SW_FILE
194194
}
195195

196+
fix_interfaces() {
197+
perl -i.bak -pe 's/^(proc ifc(\d+)\.sh .+?) eth\d+/\1 eth$2/g unless /^proc ifc255\.sh/' $HW_FILE
198+
}
199+
196200
check_dataplane_type() {
197201
local boot_config="$CONF_DIR/.DATAPLANE_TYPE"
198202
local current_type="${DATAPLANE_TYPE}"

hwdet-init.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ if [ "$FIRST_BOOT" = "true" ]; then
5959
if [ ! -f "$HW_FILE" ]; then
6060
cp $TRG/rtr-hw.txt $HW_FILE
6161
fi
62+
fix_interfaces
6263
chmod u+x $CONF_DIR/hwdet-*.sh
6364
else
6465
if [ $DATAPLANE_STATUS_CODE -eq 0 ]; then
@@ -68,9 +69,11 @@ else
6869
configure_interfaces_mac_sw_file
6970
delete_p4_server_sw_file
7071
delete_vrf_p4_sw_file
72+
fix_interfaces
7173
elif [ $DATAPLANE_STATUS_CODE -eq 1 ]; then
7274
echo "changed DATAPLANE_TYPE from pcapInt to p4"
7375
java -jar $TRG/rtr.jar test hwdet path $CONF_DIR/ iface pcap inline exclifc lo/tap20001/sit0/tunl0/eth0/gre0/erspan0/gretap0/ip6tnl0/veth0a/veth0b mem 1024m tcpvrf 2323 OOB 23
76+
fix_interfaces
7477
else
7578
echo "DATAPLANE_TYPE unchanged"
7679
if [ $NODE_INTFS_STATUS_CODE -eq 1 ] || [ $NODE_INTFS_STATUS_CODE -eq 0 ]; then
@@ -79,6 +82,7 @@ else
7982
configure_interfaces_mac_sw_file
8083
delete_p4_server_sw_file
8184
delete_vrf_p4_sw_file
85+
fix_interfaces
8286
fi
8387
fi
8488
fi

0 commit comments

Comments
 (0)