lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 23 Jan 2015 11:54:59 +0100
From:	Hannes Frederic Sowa <hannes@...essinduktion.org>
To:	Julian Anastasov <ja@....bg>
Cc:	netdev@...r.kernel.org, Marcelo Leitner <mleitner@...hat.com>,
	Florian Westphal <fw@...len.de>
Subject: Re: [PATCH net v2] ipv4: try to cache dst_entries which would cause a
 redirect



On Thu, Jan 22, 2015, at 20:57, Julian Anastasov wrote:
> 
> 	Hello,
> 
> On Thu, 22 Jan 2015, Hannes Frederic Sowa wrote:
> 
> > I would try to not introduce this complexity. I am currently researching
> > if this change does improve things:
> > 
> >         do_cache = res->fi && !itag;
> > -       if (out_dev == in_dev && err && IN_DEV_TX_REDIRECTS(out_dev) &&
> > -           (IN_DEV_SHARED_MEDIA(out_dev) ||
> > -            inet_addr_onlink(out_dev, saddr, FIB_RES_GW(*res)))) {
> > -               flags |= RTCF_DOREDIRECT;
> > -               do_cache = false;
> > +       if (skb->protocol == htons(ETH_P_IP)) {
> > +               if (out_dev == in_dev && err && IN_DEV_TX_REDIRECTS(out_dev) &&
> > +                   skb->protocol == htons(ETH_P_IP) &&
> 
> 	Above is duplicate. Or better to remove first
> and to keep this second check if flag is not cleared below...

Yes, noticed it too late.

> 
> > +                   (IN_DEV_SHARED_MEDIA(out_dev) ||
> > +                    inet_addr_onlink(out_dev, saddr, FIB_RES_GW(*res))))
> > +                       IPCB(skb)->flags |= IPSKB_DOREDIRECT;
> > +               else if (IPCB(skb)->flags & IPSKB_DOREDIRECT)
> > +                       IPCB(skb)->flags &= ~IPSKB_DOREDIRECT;
> 
> 	It seems we do not need to clear the flag for
> ip_options_rcv_srr purposes because ip_route_input is called
> only if initial rt_type is RTN_LOCAL, so the flag should be
> unset. ip_mkroute_input/__mkroute_input is called only for
> forwarding.

Yes, that aligns pretty much with how source routing should work. :)

> 	In ip_options_rcv_srr we have RTN_LOCAL ... [RTN_LOCAL]
> and may be final RTN_UNICAST. The flag can be set and used
> only for RTN_UNICAST and that is the final ip_route_input
> called there. Lets keep it just with the 2nd ETH_P_IP check?

I agree, I don't see any other complications any more. Will send patch
soon. Thanks a lot! Also please feel free to add you SOB.

Bye,
Hannes
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ