aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorAlexander V. Chernikov <melifaro@FreeBSD.org>2021-08-07 11:18:02 +0000
committerAlexander V. Chernikov <melifaro@FreeBSD.org>2021-08-08 09:19:27 +0000
commit9748eb742791dcfbb6496dc5c7c72c9283759baf (patch)
treef5a4cf7a64c3f291bb35bf93861b118d6bfb48b3 /sys/netinet
parent04389c855e56d1715637fa43575ec13455a68b2e (diff)
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_output.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index f913a2591fcc..3041232b7223 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -293,9 +293,9 @@ done:
/* rte<>ro_flags translation */
static inline void
-rt_update_ro_flags(struct route *ro)
+rt_update_ro_flags(struct route *ro, const struct nhop_object *nh)
{
- int nh_flags = ro->ro_nh->nh_flags;
+ int nh_flags = nh->nh_flags;
ro->ro_flags &= ~ (RT_REJECT|RT_BLACKHOLE|RT_HAS_GW);
@@ -495,22 +495,21 @@ again:
goto bad;
}
}
- ia = ifatoia(ro->ro_nh->nh_ifa);
- ifp = ro->ro_nh->nh_ifp;
- counter_u64_add(ro->ro_nh->nh_pksent, 1);
- rt_update_ro_flags(ro);
- if (ro->ro_nh->nh_flags & NHF_GATEWAY)
- gw = &ro->ro_nh->gw4_sa;
- if (ro->ro_nh->nh_flags & NHF_HOST)
- isbroadcast = (ro->ro_nh->nh_flags & NHF_BROADCAST);
+ struct nhop_object *nh = ro->ro_nh;
+
+ ia = ifatoia(nh->nh_ifa);
+ ifp = nh->nh_ifp;
+ counter_u64_add(nh->nh_pksent, 1);
+ rt_update_ro_flags(ro, nh);
+ if (nh->nh_flags & NHF_GATEWAY)
+ gw = &nh->gw4_sa;
+ if (nh->nh_flags & NHF_HOST)
+ isbroadcast = (nh->nh_flags & NHF_BROADCAST);
else if (ifp->if_flags & IFF_BROADCAST)
isbroadcast = in_ifaddr_broadcast(gw->sin_addr, ia);
else
isbroadcast = 0;
- if (ro->ro_nh->nh_flags & NHF_HOST)
- mtu = ro->ro_nh->nh_mtu;
- else
- mtu = ifp->if_mtu;
+ mtu = nh->nh_mtu;
src = IA_SIN(ia)->sin_addr;
} else {
struct nhop_object *nh;