Bug 173477

Summary: [kernel] [patch] mpath bugfixes
Product: Base System Reporter: Ingo Flaschberger <if>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Only Me CC: gondim
Priority: Normal Keywords: patch
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff
none
patch_pf_table.txt none

Description Ingo Flaschberger freebsd_committer freebsd_triage 2012-11-08 16:50:01 UTC
Severall mpath bugfixes:
*) if mpath is enabled, the interface loopbackroute could not be deleted
   (introduced SVN rev 226241)
*) route selection crashes when 3 mpath routes are installed and deleted:
   1: route to gw1 weight 3
   2: roote to gw2 weight 2
   3: interface route metric 1
   and deleted in 2-1 order (already freed rm_leaf returned)
*) added correct mpath selection on interface-routes (in_lltable_rtcheck)
*) added mpath to fastforward
*) do correct equal cost mpath route selection based on weight (rtalloc_mpath_fib_flags)

Fix: Patch attached with submission follows:
How-To-Repeat: Mpath test-script:
em0: interface must be up
em3: up and there must be a pingable host with 10.11.11.1/24

Routingtable have to be the same before and after running the script.
#!/bin/sh

ifconfig em0 192.168.2.100/24

read "Press [Enter] key"

ifconfig em3 alias 10.11.11.175/24 > /dev/null
ping -t1 -c 1 10.11.11.1 > /dev/null
if [ "$?" -ne "0" ]; then
	echo test1 failed
else
	echo test1 ok
fi

read "Press [Enter] key"

route add 10.11.11.0/24 192.168.2.1 -weight 2 > /dev/null
ping -t 1 -c 1 10.11.11.1 > /dev/null
if [ "$?" -ne "0" ]; then
        echo test2 failed
else
        echo test2 ok
fi

read "Press [Enter] key"

route add 10.11.11.0/24 192.168.2.3 -weight 3 > /dev/null
ping -c 1 10.11.11.1 > /dev/null
if [ "$?" -ne "0" ]; then
        echo test3 failed
else
        echo test3 ok
fi

read "Press [Enter] key"

route delete 10.11.11.0/24 192.168.2.1 > /dev/null
ping -t 1 -c 1 10.11.11.1 > /dev/null
if [ "$?" -ne "0" ]; then
        echo test4 failed
else
        echo test4 ok
fi

read "Press [Enter] key"

route delete 10.11.11.0/24 192.168.2.3 > /dev/null
ping -t 1 -c 1 10.11.11.1 > /dev/null
if [ "$?" -ne "0" ]; then
        echo test5 failed
else
        echo test5 ok
fi

read "Press [Enter] key"

ifconfig em3 -alias 10.11.11.175 > /dev/null
ping -t 1 -c 1 10.11.11.1 > /dev/null
if [ "$?" -ne "0" ]; then
        echo test6 ok
else
        echo test6 failed
fi

read "Press [Enter] key"

route add 10.11.11.0/24 192.168.2.1 -weight 2 > /dev/null
ping -t 1 -c 1 10.11.11.1 > /dev/null
if [ "$?" -ne "0" ]; then
        echo test7 ok    
else
        echo test7 failed
fi

read "Press [Enter] key"

ifconfig em3 alias 10.11.11.175/24 > /dev/null
ping -t 1 -c 1 10.11.11.1 > /dev/null
if [ "$?" -ne "0" ]; then
        echo test8 failed
else
        echo test8 ok
fi

read "Press [Enter] key"

route add 10.11.11.0/24 192.168.2.3 -weight 3 > /dev/null
ping -t 1 -c 1 10.11.11.1 > /dev/null
if [ "$?" -ne "0" ]; then
        echo test9 failed
else
        echo test9 ok
fi

read "Press [Enter] key"

ifconfig em3 -alias 10.11.11.175 > /dev/null
ping -t 1 -c 1 10.11.11.1 > /dev/null
if [ "$?" -ne "0" ]; then
        echo test10 ok    
else
        echo test10 failed
fi

read "Press [Enter] key"

route delete 10.11.11.0/24 192.168.2.1 > /dev/null
ping -t 1 -c 1 10.11.11.1 > /dev/null
if [ "$?" -ne "0" ]; then
        echo test11 ok    
else
        echo test11 failed
fi

read "Press [Enter] key"

route delete 10.11.11.0/24 192.168.2.3 > /dev/null
ping -t 1 -c 1 10.11.11.1 > /dev/null
if [ "$?" -ne "0" ]; then
        echo test12 ok   
else
        echo test12 failed
fi

read "Press [Enter] key"

route add 10.11.11.0/24 192.168.2.1 -weight 2 > /dev/null
ping -t 1 -c 1 10.11.11.1 > /dev/null
if [ "$?" -ne "0" ]; then
        echo test13 ok   
else
        echo test13 failed
fi

read "Press [Enter] key"

route add 10.11.11.0/24 192.168.2.3 -weight 3 > /dev/null
ping -t 1 -c 1 10.11.11.1 > /dev/null
if [ "$?" -ne "0" ]; then
        echo test14 ok   
else
        echo test14 failed
fi

read "Press [Enter] key"

ifconfig em3 alias 10.11.11.175/24 > /dev/null
ping -t 1 -c 1 10.11.11.1 > /dev/null
if [ "$?" -ne "0" ]; then
        echo test15 failed
else
        echo test15 ok
fi

read "Press [Enter] key"

route delete 10.11.11.0/24 192.168.2.3 > /dev/null
ping -t 1 -c 1 10.11.11.1 > /dev/null
if [ "$?" -ne "0" ]; then
        echo test16 failed
else
        echo test16 ok    
fi

read "Press [Enter] key"

route delete 10.11.11.0/24 192.168.2.1 > /dev/null
ping -t 1 -c 1 10.11.11.1 > /dev/null
if [ "$?" -ne "0" ]; then
        echo test17 failed
else
        echo test17 ok    
fi

read "Press [Enter] key"

ifconfig em3 -alias 10.11.11.175 > /dev/null
ping -t 1 -c 1 10.11.11.1 > /dev/null
if [ "$?" -ne "0" ]; then
        echo test18 ok
else
        echo test18 failed
fi
Comment 1 Ingo Flaschberger 2012-11-09 01:57:18 UTC
this part is also needed:
Comment 2 gondim 2014-08-24 12:45:25 UTC
Hi all,

Is there any reason for this patch is not included in FreeBSD 10?

Thanks and best regards,

Gondim
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2018-05-21 00:00:11 UTC
For bugs matching the following conditions:
- Status == In Progress
- Assignee == "bugs@FreeBSD.org"
- Last Modified Year <= 2017

Do
- Set Status to "Open"
Comment 4 Eitan Adler freebsd_committer freebsd_triage 2018-05-21 00:00:33 UTC
For bugs matching the following conditions:
- Status == In Progress
- Assignee == "bugs@FreeBSD.org"
- Last Modified Year <= 2017

Do
- Set Status to "Open"