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]
Date:	Fri, 14 Jun 2013 17:31:23 -0700
From:	Jesse Gross <jesse@...ira.com>
To:	Pravin B Shelar <pshelar@...ira.com>
Cc:	netdev <netdev@...r.kernel.org>,
	"dev@...nvswitch.org" <dev@...nvswitch.org>
Subject: Re: [ovs-dev] [PATCH net-next 12/12] openvswitch: Add gre tunnel support.

On Thu, Jun 13, 2013 at 11:25 AM, Pravin B Shelar <pshelar@...ira.com> wrote:
> diff --git a/net/openvswitch/vport-gre.c b/net/openvswitch/vport-gre.c
> new file mode 100644
> index 0000000..0420237
> --- /dev/null
> +++ b/net/openvswitch/vport-gre.c
> +/* Called with rcu_read_lock and BH disabled. */
> +static int gre_rcv(struct sk_buff *skb,
> +                  const struct tnl_ptk_info *tpi)
> +{
> +       struct ovs_key_ipv4_tunnel tun_key;
> +       struct ovs_net *ovs_net;
> +       struct vport *vport;
> +       __be64 key;
> +
> +       ovs_net = net_generic(dev_net(skb->dev), ovs_net_id);
> +       vport = rcu_dereference(ovs_net->vport_net.gre_vport);
> +       if (unlikely(!vport))
> +               return PACKET_REJECT;
> +
> +       key = key_to_tunnel_id(tpi->key, tpi->seq);
> +       ovs_flow_tun_key_init(&tun_key, ip_hdr(skb), key, tpi->flags);

I would probably filter the flags coming in, just in case another
module adds a new flag that we're not expecting.

> +static int gre_tnl_send(struct vport *vport, struct sk_buff *skb)
> +{
[...]
> +       /* Allow our local IP stack to fragment the outer packet even
> +        * if the DF bit is set as a last resort.  We also need to
> +        * force selection of an IP ID here because Linux will
> +        * otherwise leave it at 0 if the packet originally had DF set.
> +        */
> +
> +       skb->local_df = 1;

Are we actually doing the IP ID selection here that the comment is referring to?

> diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c
> index ef0bb5f..286c12a 100644
> --- a/net/openvswitch/vport.c
> +++ b/net/openvswitch/vport.c
> @@ -38,6 +38,7 @@
>  static const struct vport_ops *vport_ops_list[] = {
>         &ovs_netdev_vport_ops,
>         &ovs_internal_vport_ops,
> +       &ovs_gre_vport_ops,
>  };

I think we need some config guards to check that the GRE and IP tunnel
modules are available in the current kernel.
--
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