From 25850c205df15c03b41cb0166806b261bbc11533 Mon Sep 17 00:00:00 2001 From: yar Date: Wed, 19 Dec 2001 14:54:13 +0000 Subject: 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(-) (limited to 'sys') diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 58ffb5e..d14edbe 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -766,7 +766,8 @@ skip_ipsec: (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; -- cgit v1.1