From 3f9e31220b6ebe58dec2781f026cc5556a555806 Mon Sep 17 00:00:00 2001 From: Yaroslav Tykhiy Date: Wed, 19 Dec 2001 14:54:13 +0000 Subject: [PATCH] Don't try to free a NULL route when doing IPFIREWALL_FORWARD. An old route will be NULL at that point if a packet were initially routed to an interface (using the IP_ROUTETOIF flag.) Submitted by: Igor Timkin --- sys/netinet/ip_output.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 58ffb5e00c32..d14edbe9f5ba 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -766,7 +766,8 @@ ip_output(m0, opt, ro, flags, imo) (ro_fwd->ro_rt->rt_flags & RTF_BROADCAST); else isbroadcast = in_broadcast(dst->sin_addr, ifp); - RTFREE(ro->ro_rt); + if (ro->ro_rt) + RTFREE(ro->ro_rt); ro->ro_rt = ro_fwd->ro_rt; dst = (struct sockaddr_in *)&ro_fwd->ro_dst;