summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authoryar <yar@FreeBSD.org>2001-12-19 14:54:13 +0000
committeryar <yar@FreeBSD.org>2001-12-19 14:54:13 +0000
commit25850c205df15c03b41cb0166806b261bbc11533 (patch)
tree641687efea93bbefad531bb2e2e8ee5d851ce65d /sys
parent484d36220a20194ac49c5f9166612b48b3a9a0e5 (diff)
downloadFreeBSD-src-25850c205df15c03b41cb0166806b261bbc11533.zip
FreeBSD-src-25850c205df15c03b41cb0166806b261bbc11533.tar.gz
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 <ivt@gamma.ru>
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/ip_output.c3
1 files changed, 2 insertions, 1 deletions
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;
OpenPOWER on IntegriCloud