Skip to contentSkip to conversation

containers: fix dev name in create_veth()

PATCH In review Hangbin Liu 3 participants 3 messages Aug 12, 2015 – Aug 20, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 containers: fix dev name in create_veth()

The new version of iproute2 will show veth device like veth0@veth1, but we won't get a dev proc entry like this. Fix the dev name to avoid error like /proc/sys/net/ipv4/conf/veth0@veth1/proxy_arp: No such file or directory

---
 testcases/kernel/containers/netns/netns_initialize.sh | 2 ++
 1 file changed, 2 insertions(+)
testcases/kernel/containers/netns/netns_initialize.sh +2 -0
index d44a02b..71d935a 100755
@@ -113,6 +113,8 @@ create_veth()
     sleep 1
     ip link show > /tmp/net2
     eval `diff /tmp/net1 /tmp/net2 | awk -F": "  '/^> [0-9]*:/ { print "dev" i+0 "=" $2; i++  }'`
+    dev0=$(echo $dev0 | cut -f1 -d'@')
+    dev1=$(echo $dev1 | cut -f1 -d'@')
 }
 
 # return 1 if disabled originally, 0 for enabled originally.
Signature · 8 lines
1.9.3


------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#1 lore raw

It looks fine to me.

Quoted 14 lines · Hangbin Liu

The new version of iproute2 will show veth device like veth0@veth1, but we won't get a dev proc entry like this. Fix the dev name to avoid error like /proc/sys/net/ipv4/conf/veth0@veth1/proxy_arp: No such file or directory

---
  testcases/kernel/containers/netns/netns_initialize.sh | 2 ++
  1 file changed, 2 insertions(+)
testcases/kernel/containers/netns/netns_initialize.sh +0 -0
index d44a02b..71d935a 100755

testcases/kernel/containers/netns/netns_initialize.sh create_veth() · line 120

Quoted 8 lines
testcases/kernel/containers/netns/netns_initialize.sh +2 -0
@@ -113,6 +113,8 @@ create_veth()
      sleep 1
      ip link show > /tmp/net2
      eval `diff /tmp/net1 /tmp/net2 | awk -F": "  '/^> [0-9]*:/ { print "dev" i+0 "=" $2; i++  }'`
+    dev0=$(echo $dev0 | cut -f1 -d'@')
+    dev1=$(echo $dev1 | cut -f1 -d'@')
  }
 
  # return 1 if disabled originally, 0 for enabled originally.

------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#2 lore raw
In reply to Hangbin Liu

Hi!
I've just pushed complete rewrite of the testcases, please make sure that netns testcases from latest git works for you.

Signature · 8 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list