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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140521153153.GB10390@verge.net.au>
Date:	Thu, 22 May 2014 00:31:54 +0900
From:	Simon Horman <horms@...ge.net.au>
To:	Jesse Gross <jesse@...ira.com>
Cc:	"dev@...nvswitch.org" <dev@...nvswitch.org>,
	netdev <netdev@...r.kernel.org>,
	Pravin B Shelar <pshelar@...ira.com>,
	Ben Pfaff <blp@...ira.com>, Ravi K <rkerur@...il.com>,
	Joe Stringer <joe@...d.net.nz>
Subject: Re: [PATCH v2.57] datapath: Add basic MPLS support to kernel

On Tue, May 20, 2014 at 07:30:38PM -0700, Jesse Gross wrote:
> On Thu, May 15, 2014 at 4:07 PM, Simon Horman <horms@...ge.net.au> wrote:
> > diff --git a/datapath/linux/compat/gso.c b/datapath/linux/compat/gso.c
> > index 9ded17c..d9b4485 100644
> > --- a/datapath/linux/compat/gso.c
> > +++ b/datapath/linux/compat/gso.c
> > -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
> > +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)
> >  static bool dev_supports_vlan_tx(struct net_device *dev)
> >  {
> > -#if defined(HAVE_VLAN_BUG_WORKAROUND)
> > +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
> > +       return true;
> 
> Should this be greater than 2.6.37 instead of less than?

Yes, thanks.

> > diff --git a/datapath/linux/compat/include/linux/netdevice.h b/datapath/linux/compat/include/linux/netdevice.h
> > index d726390..0381002 100644
> > --- a/datapath/linux/compat/include/linux/netdevice.h
> > +++ b/datapath/linux/compat/include/linux/netdevice.h
> > +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
> >  #define netif_skb_features rpl_netif_skb_features
> >  netdev_features_t rpl_netif_skb_features(struct sk_buff *skb);
> 
> Currently this function doesn't look at mpls_features. Should it for
> things other than TSO?

It seems to me that rpl_netif_skb_features is only used by
rpl_dev_queue_xmit().

If that is the case then I don't think it is necessary to examine
mpls_features, which was introduced in v3.11, as rpl_dev_queue_xmit()
only exists for older kernel versions.

> > diff --git a/datapath/linux/compat/netdevice.c b/datapath/linux/compat/netdevice.c
> > index 1dc5abf..d22fced 100644
> > --- a/datapath/linux/compat/netdevice.c
> > +++ b/datapath/linux/compat/netdevice.c
> > @@ -78,6 +83,9 @@ struct sk_buff *rpl_skb_gso_segment(struct sk_buff *skb,
> >         __be16 skb_proto;
> >         struct sk_buff *skb_gso;
> >
> > +       if (eth_p_mpls(skb->protocol))
> > +               type = ovs_skb_get_inner_protocol(skb);
> > +
> >         while (type == htons(ETH_P_8021Q)) {
> >                 struct vlan_hdr *vh;
> 
> Is the ordering on this backwards given that we expect that VLANs can
> be on the outside but not the other way around?

Yes, I think so.

I will change this around as follows:

diff --git a/datapath/linux/compat/netdevice.c b/datapath/linux/compat/netdevice.c
index d22fced..d63f1f5 100644
--- a/datapath/linux/compat/netdevice.c
+++ b/datapath/linux/compat/netdevice.c
@@ -83,9 +83,6 @@ struct sk_buff *rpl_skb_gso_segment(struct sk_buff *skb,
 	__be16 skb_proto;
 	struct sk_buff *skb_gso;
 
-	if (eth_p_mpls(skb->protocol))
-		type = ovs_skb_get_inner_protocol(skb);
-
 	while (type == htons(ETH_P_8021Q)) {
 		struct vlan_hdr *vh;
 
@@ -97,6 +94,9 @@ struct sk_buff *rpl_skb_gso_segment(struct sk_buff *skb,
 		vlan_depth += VLAN_HLEN;
 	}
 
+	if (eth_p_mpls(type))
+		type = ovs_skb_get_inner_protocol(skb);
+
 	/* this hack needed to get regular skb_gso_segment() */
 #undef skb_gso_segment
 	skb_proto = skb->protocol;
--
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