Fix OpenFlow compilation with modern GCC/glibc and improve install.sh -fw support
code-check / Mininet Code Check (push) Waiting to run
mininet-tests / Mininet Tests (ubuntu-20.04, python2) (push) Waiting to run
mininet-tests / Mininet Tests (ubuntu-20.04, python3) (push) Waiting to run
mininet-tests / Mininet Tests (ubuntu-22.04, python2) (push) Waiting to run
mininet-tests / Mininet Tests (ubuntu-22.04, python3) (push) Waiting to run

This commit is contained in:
2026-08-27 14:09:11 +00:00
parent 6eb8973c0b
commit d9c8f86889
2 changed files with 117 additions and 14 deletions
+29 -14
View File
@@ -242,15 +242,22 @@ function of {
fi
# was: git clone git://openflowswitch.org/openflow.git
# Use our own fork on github for now:
git clone https://github.com/mininet/openflow
if [ ! -d "openflow" ]; then
git clone https://github.com/mininet/openflow
fi
cd $BUILD_DIR/openflow
# Patch controller to handle more than 16 switches
patch -p1 < $MININET_DIR/mininet/util/openflow-patches/controller.patch
# Patch controller to handle more than 16 switches and fix modern gcc/glibc issues
if [ -f "$MININET_DIR/mininet/util/openflow-patches/controller.patch" ]; then
patch -p1 -N -r - < "$MININET_DIR/mininet/util/openflow-patches/controller.patch" || true
fi
if [ -f "$MININET_DIR/mininet/util/openflow-patches/gcc-glibc.patch" ]; then
patch -p1 -N -r - < "$MININET_DIR/mininet/util/openflow-patches/gcc-glibc.patch" || true
fi
# Resume the install:
./boot.sh
./configure
CFLAGS="-g -O2 -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -Wno-error=format -Wno-error=implicit-function-declaration -Wno-error=address-of-packed-member -Wno-error=discarded-qualifiers" ./configure
make
sudo make install
cd $BUILD_DIR
@@ -300,7 +307,7 @@ function of13 {
function install_wireshark {
if ! which wireshark; then
if ! which wireshark &>/dev/null && ! which tshark &>/dev/null; then
echo "Installing Wireshark"
if [ "$DIST" = "Fedora" -o "$DIST" = "RedHatEnterpriseServer" ]; then
$install wireshark wireshark-gnome
@@ -313,29 +320,37 @@ function install_wireshark {
# Copy coloring rules: OF is white-on-blue:
echo "Optionally installing wireshark color filters"
mkdir -p $HOME/.wireshark
cp -n $MININET_DIR/mininet/util/colorfilters $HOME/.wireshark
mkdir -p $HOME/.wireshark $HOME/.config/wireshark
[ -f $MININET_DIR/mininet/util/colorfilters ] && cp -n $MININET_DIR/mininet/util/colorfilters $HOME/.wireshark/ || true
[ -f $MININET_DIR/mininet/util/colorfilters ] && cp -n $MININET_DIR/mininet/util/colorfilters $HOME/.config/wireshark/ || true
echo "Checking Wireshark version"
WSVER=`wireshark -v | egrep -o '[0-9\.]+' | head -1`
if version_ge $WSVER 1.12; then
WSVER=`(wireshark -v 2>/dev/null || tshark -v 2>/dev/null || true) | grep -i -E 'wireshark|tshark' | egrep -o '[0-9\.]+' | head -1`
if [ -n "$WSVER" ] && version_ge "$WSVER" 1.12; then
echo "Wireshark version $WSVER >= 1.12 - returning"
return
elif which wireshark &>/dev/null || which tshark &>/dev/null; then
echo "Wireshark/TShark is already installed and modern versions include OpenFlow dissectors natively - returning"
return
fi
echo "Cloning LoxiGen and building openflow.lua dissector"
cd $BUILD_DIR
git clone https://github.com/floodlight/loxigen.git
if [ ! -d "loxigen" ]; then
git clone https://github.com/floodlight/loxigen.git
fi
cd loxigen
make wireshark
# Copy into plugin directory
# libwireshark0/ on 11.04; libwireshark1/ on later
WSDIR=`find /usr/lib -type d -name 'libwireshark*' | head -1`
WSPLUGDIR=$WSDIR/plugins/
PLUGIN=loxi_output/wireshark/openflow.lua
sudo cp $PLUGIN $WSPLUGDIR
echo "Copied openflow plugin $PLUGIN to $WSPLUGDIR"
if [ -n "$WSDIR" ]; then
WSPLUGDIR=$WSDIR/plugins/
PLUGIN=loxi_output/wireshark/openflow.lua
sudo cp $PLUGIN $WSPLUGDIR
echo "Copied openflow plugin $PLUGIN to $WSPLUGDIR"
fi
cd $BUILD_DIR
}