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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130820115020.GB3938@order.stressinduktion.org>
Date:	Tue, 20 Aug 2013 13:50:20 +0200
From:	Hannes Frederic Sowa <hannes@...essinduktion.org>
To:	Duan Jiong <duanj.fnst@...fujitsu.com>
Cc:	davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH V2] ipv6: handle Redirect ICMP Message with no Redirected Header option

On Tue, Aug 20, 2013 at 03:13:41PM +0800, Duan Jiong wrote:
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -1178,6 +1178,28 @@ void ip6_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark)
>  }
>  EXPORT_SYMBOL_GPL(ip6_redirect);
>  
> +void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif,
> +			    u32 mark)
> +{
> +	const struct ipv6hdr *iph = (struct ipv6hdr *)skb_network_header(skb);

Was there a problem with ipv6_hdr?

> +	const struct rd_msg *msg = (struct rd_msg *)skb_transport_header(skb);
> +	struct dst_entry *dst;
> +	struct flowi6 fl6;
> +
> +	memset(&fl6, 0, sizeof(fl6));
> +	fl6.flowi6_oif = oif;
> +	fl6.flowi6_mark = mark;
> +	fl6.flowi6_flags = 0;
> +	fl6.daddr = msg->dest;
> +	fl6.saddr = iph->daddr;
> +
> +	dst = ip6_route_output(net, NULL, &fl6);
> +	if (!dst->error)
> +		rt6_do_redirect(dst, NULL, skb);
> +	dst_release(dst);
> +}
> +EXPORT_SYMBOL_GPL(ip6_redirect_no_header);
> +
>  void ip6_sk_redirect(struct sk_buff *skb, struct sock *sk)
>  {
>  	ip6_redirect(skb, sock_net(sk), sk->sk_bound_dev_if, sk->sk_mark);

Introducing a new function here is the right thing. Maybe you could have
a look how these redirects could be fed to raw sockets, too?

Thanks,

  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