On 04/12/14(Thu) 00:26, Alexander Bluhm wrote: > On Wed, Nov 26, 2014 at 12:58:35PM +0100, Martin Pieuchot wrote: > > @@ -761,7 +754,17 @@ report: > > error = EDQUOT; > > goto flush; > > } > > - ifa = info.rti_ifa; > > + /* > > + * new gateway could require new ifaddr, ifp; > > + * flags may also be different; ifp may be specified > > + * by ll sockaddr when protocol address is ambiguous > > + */ > > + if (newgate || info.rti_info[RTAX_IFP] != NULL || > > + info.rti_info[RTAX_IFA] != NULL) { > > rt_getifa() may also use RTAX_DST to set rti_ifa. So I think there > should be a "|| info.rti_info[RTAX_DST] != NULL" in the condition.
Except that here we are dealing with RTM_CHANGE and RTAX_DST is used to find the route entry we're about to modify. So if you pass a different destination, the kernel won't find any route and the code will fail earlier. So ok?