Fix dynamic redrects by adding forgotten RTF_HOST flag.
Improve tests to verify the generated route flags. Reported by: jtl MFC after: 2 weeks
This commit is contained in:
parent
0e6627350e
commit
ea2773323c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=358585
@ -632,7 +632,7 @@ rib_add_redirect(u_int fibnum, struct sockaddr *dst, struct sockaddr *gateway,
|
||||
info.rti_info[RTAX_GATEWAY] = gateway;
|
||||
info.rti_ifa = ifa;
|
||||
info.rti_ifp = ifp;
|
||||
info.rti_flags = flags | RTF_DYNAMIC;
|
||||
info.rti_flags = flags | RTF_HOST | RTF_DYNAMIC;
|
||||
|
||||
/* Setup route metrics to define expire time. */
|
||||
bzero(&rti_rmx, sizeof(rti_rmx));
|
||||
|
@ -92,9 +92,8 @@ valid_redirect_body() {
|
||||
--route ${dst_addr4} --gw ${new_rtr_ip} \
|
||||
--iface ${epair}a
|
||||
|
||||
count=`jexec ${jname} route -n get -4 ${dst_addr4} | grep destination | grep -c ${dst_addr4}`
|
||||
# Verify redirect got installed
|
||||
atf_check_equal "1" "${count}"
|
||||
atf_check -o match:"destination: ${dst_addr4}\$" jexec ${jname} route -n get -4 ${dst_addr4}
|
||||
atf_check -o match:'flags: <UP,GATEWAY,HOST,DYNAMIC,DONE>' jexec ${jname} route -n get -4 ${dst_addr4}
|
||||
}
|
||||
|
||||
valid_redirect_cleanup() {
|
||||
|
@ -94,9 +94,9 @@ valid_redirect_body() {
|
||||
--route ${dst_addr6} --gw ${new_rtr_ll_ip} \
|
||||
--iface ${epair}a
|
||||
|
||||
count=`jexec ${jname} route -n get -6 ${dst_addr6} | grep destination | grep -c ${dst_addr6}`
|
||||
# Verify redirect got installed
|
||||
atf_check_equal "1" "${count}"
|
||||
atf_check -o match:"destination: ${dst_addr6}\$" jexec ${jname} route -n get -6 ${dst_addr6}
|
||||
atf_check -o match:'flags: <UP,GATEWAY,HOST,DYNAMIC,DONE>' jexec ${jname} route -n get -6 ${dst_addr6}
|
||||
}
|
||||
|
||||
valid_redirect_cleanup() {
|
||||
|
Loading…
Reference in New Issue
Block a user