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:
Alexander V. Chernikov 2020-03-03 15:33:43 +00:00
parent 0e6627350e
commit ea2773323c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=358585
3 changed files with 5 additions and 6 deletions

View File

@ -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));

View File

@ -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() {

View File

@ -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() {