Avoid dereferencing a null pointer in ro_rt.

This was always broken in HEAD (the offending statement was introduced
in rev. 1.123 for HEAD, while RELENG_4 included this fix (in rev.
1.99.2.12 for RELENG_4) and I inadvertently deleted it in 1.99.2.30.

So I am also restoring these two lines in RELENG_4 now.
We might need another few things from 1.99.2.30.
This commit is contained in:
luigi 2002-07-12 22:08:47 +00:00
parent dc5d856e71
commit 7cb243d2f4

View File

@ -123,7 +123,7 @@ ip_output(m0, opt, ro, flags, imo)
int hlen = sizeof (struct ip);
int len, off, error = 0;
struct sockaddr_in *dst = NULL; /* keep compiler happy */
struct in_ifaddr *ia;
struct in_ifaddr *ia = NULL;
int isbroadcast, sw_csum;
struct in_addr pkt_dst;
#ifdef IPSEC
@ -190,7 +190,8 @@ ip_output(m0, opt, ro, flags, imo)
if (args.rule != NULL) { /* dummynet already saw us */
ip = mtod(m, struct ip *);
hlen = IP_VHL_HL(ip->ip_vhl) << 2 ;
ia = ifatoia(ro->ro_rt->rt_ifa);
if (ro->ro_rt)
ia = ifatoia(ro->ro_rt->rt_ifa);
goto sendit;
}