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>
This commit is contained in:
yar 2001-12-19 14:54:13 +00:00
parent 484d36220a
commit 25850c205d

View File

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