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:
Yaroslav Tykhiy 2001-12-19 14:54:13 +00:00
parent 604fb1c032
commit 3f9e31220b

View File

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