Skip to content

Instantly share code, notes, and snippets.

@kevinbenton
kevinbenton / check_for_broken_ovs
Created July 21, 2016 10:43
looking for ofport re-use while port still exists
#!/bin/bash
FNAME=$1
file $1 | grep gzip >/dev/null
if [ $? -eq 1 ]; then extract_com=cat; else extract_com=gzcat; fi
interfaces=$($extract_com $FNAME | grep " added interface " | grep "on port" | awk -F 'added interface ' '{ print $2 }' | awk -F ' on port ' '{ print $2 "!!" $1 }' | sort | uniq )
for i in $interfaces; do
ofport=$(echo $i | awk -F '!!' '{ print $1 }')
intf=$(echo $i | awk -F '!!' '{ print $2 }')
@kevinbenton
kevinbenton / repro_ovs.sh
Created July 20, 2016 09:16
repro_ovs_bug_attempt
#!/bin/bash
_add_dhcp_port() {
# simulate dhcp port creation
port_id=$1
port_mac=$2
port_name="tap${port_id:0:11}"
ns_name="ns-$port_id"
sudo ip netns add $ns_name
sudo ovs-vsctl --timeout=120 -- --if-exists del-port $port_name -- add-port br-int $port_name -- set Interface $port_name external-ids:iface-id=$port_id external-ids:iface-status=active external-ids:attached-mac=$port_mac type=internal

Keybase proof

I hereby claim:

  • I am kevinbenton on github.
  • I am kevinbenton (https://keybase.io/kevinbenton) on keybase.
  • I have a public key whose fingerprint is 2C31 816D 0EB7 23CF FD22 13A3 5A93 A996 D4A8 0EDE

To claim this, I am signing this object: