All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: add ETH_P_802_3_MIN
@ 2013-03-21  8:29 Simon Horman
  2013-03-21 13:24   ` Stefan Richter
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Simon Horman @ 2013-03-21  8:29 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Simon Horman, Jesse Gross, Stefan Richter,
	Karsten Keil, Mauro Carvalho Chehab, linux1394-devel,
	linux-media, dev

Add a new constant ETH_P_802_3_MIN, the minimum ethernet type for
an 802.3 frame. Frames with a lower value in the ethernet type field
are Ethernet II.

Also update all the users of this value that I could find to use the
new constant.

I anticipate adding some more users of this constant when
adding MPLS support to Open vSwtich.

As suggested by Jesse Gross.

Compile tested only.

Cc: Jesse Gross <jesse@nicira.com>
Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: linux1394-devel@lists.sourceforge.net
Cc: linux-media@vger.kernel.org
Cc: dev@openvswitch.org
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 drivers/firewire/net.c           |    2 +-
 drivers/isdn/i4l/isdn_net.c      |    2 +-
 drivers/media/dvb-core/dvb_net.c |    6 +++---
 drivers/net/ethernet/sun/niu.c   |    2 +-
 drivers/net/plip/plip.c          |    2 +-
 include/uapi/linux/if_ether.h    |    3 +++
 net/ethernet/eth.c               |    2 +-
 net/openvswitch/datapath.c       |    2 +-
 8 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c
index 2b27bff..bd34ca1 100644
--- a/drivers/firewire/net.c
+++ b/drivers/firewire/net.c
@@ -630,7 +630,7 @@ static int fwnet_finish_incoming_packet(struct net_device *net,
 			if (memcmp(eth->h_dest, net->dev_addr, net->addr_len))
 				skb->pkt_type = PACKET_OTHERHOST;
 		}
-		if (ntohs(eth->h_proto) >= 1536) {
+		if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN) {
 			protocol = eth->h_proto;
 		} else {
 			rawp = (u16 *)skb->data;
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c
index babc621..88d657d 100644
--- a/drivers/isdn/i4l/isdn_net.c
+++ b/drivers/isdn/i4l/isdn_net.c
@@ -1385,7 +1385,7 @@ isdn_net_type_trans(struct sk_buff *skb, struct net_device *dev)
 		if (memcmp(eth->h_dest, dev->dev_addr, ETH_ALEN))
 			skb->pkt_type = PACKET_OTHERHOST;
 	}
-	if (ntohs(eth->h_proto) >= 1536)
+	if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN)
 		return eth->h_proto;
 
 	rawp = skb->data;
diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c
index 44225b1..9fc82a1 100644
--- a/drivers/media/dvb-core/dvb_net.c
+++ b/drivers/media/dvb-core/dvb_net.c
@@ -185,7 +185,7 @@ static __be16 dvb_net_eth_type_trans(struct sk_buff *skb,
 			skb->pkt_type=PACKET_MULTICAST;
 	}
 
-	if (ntohs(eth->h_proto) >= 1536)
+	if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN)
 		return eth->h_proto;
 
 	rawp = skb->data;
@@ -228,9 +228,9 @@ static int ule_test_sndu( struct dvb_net_priv *p )
 static int ule_bridged_sndu( struct dvb_net_priv *p )
 {
 	struct ethhdr *hdr = (struct ethhdr*) p->ule_next_hdr;
-	if(ntohs(hdr->h_proto) < 1536) {
+	if(ntohs(hdr->h_proto) < ETH_P_802_3_MIN) {
 		int framelen = p->ule_sndu_len - ((p->ule_next_hdr+sizeof(struct ethhdr)) - p->ule_skb->data);
-		/* A frame Type < 1536 for a bridged frame, introduces a LLC Length field. */
+		/* A frame Type < ETH_P_802_3_MIN for a bridged frame, introduces a LLC Length field. */
 		if(framelen != ntohs(hdr->h_proto)) {
 			return -1;
 		}
diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c
index e4c1c88..95cff98 100644
--- a/drivers/net/ethernet/sun/niu.c
+++ b/drivers/net/ethernet/sun/niu.c
@@ -6618,7 +6618,7 @@ static u64 niu_compute_tx_flags(struct sk_buff *skb, struct ethhdr *ehdr,
 	       (len << TXHDR_LEN_SHIFT) |
 	       ((l3off / 2) << TXHDR_L3START_SHIFT) |
 	       (ihl << TXHDR_IHL_SHIFT) |
-	       ((eth_proto_inner < 1536) ? TXHDR_LLC : 0) |
+	       ((eth_proto_inner < ETH_P_802_3_MIN) ? TXHDR_LLC : 0) |
 	       ((eth_proto == ETH_P_8021Q) ? TXHDR_VLAN : 0) |
 	       (ipv6 ? TXHDR_IP_VER : 0) |
 	       csum_bits);
diff --git a/drivers/net/plip/plip.c b/drivers/net/plip/plip.c
index bed62d9..1f7bef9 100644
--- a/drivers/net/plip/plip.c
+++ b/drivers/net/plip/plip.c
@@ -560,7 +560,7 @@ static __be16 plip_type_trans(struct sk_buff *skb, struct net_device *dev)
 	 *	so don't forget to remove it.
 	 */
 
-	if (ntohs(eth->h_proto) >= 1536)
+	if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN)
 		return eth->h_proto;
 
 	rawp = skb->data;
diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h
index 798032d..ade07f1 100644
--- a/include/uapi/linux/if_ether.h
+++ b/include/uapi/linux/if_ether.h
@@ -94,6 +94,9 @@
 #define ETH_P_EDSA	0xDADA		/* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
 #define ETH_P_AF_IUCV   0xFBFB		/* IBM af_iucv [ NOT AN OFFICIALLY REGISTERED ID ] */
 
+#define ETH_P_802_3_MIN	0x0600		/* If the value in the ethernet type is less than this value
+					 * then the frame is Ethernet II. Else it is 802.3 */
+
 /*
  *	Non DIX types. Won't clash for 1500 types.
  */
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index a36c85ea..5359560 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -195,7 +195,7 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
 	if (netdev_uses_trailer_tags(dev))
 		return htons(ETH_P_TRAILER);
 
-	if (ntohs(eth->h_proto) >= 1536)
+	if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN)
 		return eth->h_proto;
 
 	/*
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index d61cd99..8759265 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -681,7 +681,7 @@ static int ovs_packet_cmd_execute(struct sk_buff *skb, struct genl_info *info)
 	/* Normally, setting the skb 'protocol' field would be handled by a
 	 * call to eth_type_trans(), but it assumes there's a sending
 	 * device, which we may not have. */
-	if (ntohs(eth->h_proto) >= 1536)
+	if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN)
 		packet->protocol = eth->h_proto;
 	else
 		packet->protocol = htons(ETH_P_802_2);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] net: add ETH_P_802_3_MIN
  2013-03-21  8:29 [PATCH] net: add ETH_P_802_3_MIN Simon Horman
@ 2013-03-21 13:24   ` Stefan Richter
  2013-03-21 14:02   ` Mauro Carvalho Chehab
  2013-03-21 15:56 ` David Miller
  2 siblings, 0 replies; 8+ messages in thread
From: Stefan Richter @ 2013-03-21 13:24 UTC (permalink / raw)
  To: Simon Horman
  Cc: dev, Karsten Keil, linux1394-devel, Carvalho Chehab, netdev,
	Gross, linux-media, Jesse, David S. Miller, Mauro

On Mar 21 Simon Horman wrote:
> Add a new constant ETH_P_802_3_MIN, the minimum ethernet type for
> an 802.3 frame. Frames with a lower value in the ethernet type field
> are Ethernet II.
> 
> Also update all the users of this value that I could find to use the
> new constant.
> 
> I anticipate adding some more users of this constant when
> adding MPLS support to Open vSwtich.
> 
> As suggested by Jesse Gross.
> 
> Compile tested only.
> 
> Cc: Jesse Gross <jesse@nicira.com>
> Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
> Cc: Karsten Keil <isdn@linux-pingi.de>
> Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
> Cc: linux1394-devel@lists.sourceforge.net
> Cc: linux-media@vger.kernel.org
> Cc: dev@openvswitch.org
> Signed-off-by: Simon Horman <horms@verge.net.au>
> ---
>  drivers/firewire/net.c           |    2 +-

Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de>

>  drivers/isdn/i4l/isdn_net.c      |    2 +-
>  drivers/media/dvb-core/dvb_net.c |    6 +++---
>  drivers/net/ethernet/sun/niu.c   |    2 +-
>  drivers/net/plip/plip.c          |    2 +-
>  include/uapi/linux/if_ether.h    |    3 +++
>  net/ethernet/eth.c               |    2 +-
>  net/openvswitch/datapath.c       |    2 +-
>  8 files changed, 12 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c
> index 2b27bff..bd34ca1 100644
> --- a/drivers/firewire/net.c
> +++ b/drivers/firewire/net.c
> @@ -630,7 +630,7 @@ static int fwnet_finish_incoming_packet(struct net_device *net,
>  			if (memcmp(eth->h_dest, net->dev_addr, net->addr_len))
>  				skb->pkt_type = PACKET_OTHERHOST;
>  		}
> -		if (ntohs(eth->h_proto) >= 1536) {
> +		if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN) {
>  			protocol = eth->h_proto;
>  		} else {
>  			rawp = (u16 *)skb->data;
[...]

-- 
Stefan Richter
-=====-===-= --== =-=-=
http://arcgraph.de/sr/

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] net: add ETH_P_802_3_MIN
@ 2013-03-21 13:24   ` Stefan Richter
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Richter @ 2013-03-21 13:24 UTC (permalink / raw)
  To: Simon Horman
  Cc: netdev, David S. Miller, Jesse Gross, Karsten Keil,
	Mauro Carvalho Chehab, linux1394-devel, linux-media, dev

On Mar 21 Simon Horman wrote:
> Add a new constant ETH_P_802_3_MIN, the minimum ethernet type for
> an 802.3 frame. Frames with a lower value in the ethernet type field
> are Ethernet II.
> 
> Also update all the users of this value that I could find to use the
> new constant.
> 
> I anticipate adding some more users of this constant when
> adding MPLS support to Open vSwtich.
> 
> As suggested by Jesse Gross.
> 
> Compile tested only.
> 
> Cc: Jesse Gross <jesse@nicira.com>
> Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
> Cc: Karsten Keil <isdn@linux-pingi.de>
> Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
> Cc: linux1394-devel@lists.sourceforge.net
> Cc: linux-media@vger.kernel.org
> Cc: dev@openvswitch.org
> Signed-off-by: Simon Horman <horms@verge.net.au>
> ---
>  drivers/firewire/net.c           |    2 +-

Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de>

>  drivers/isdn/i4l/isdn_net.c      |    2 +-
>  drivers/media/dvb-core/dvb_net.c |    6 +++---
>  drivers/net/ethernet/sun/niu.c   |    2 +-
>  drivers/net/plip/plip.c          |    2 +-
>  include/uapi/linux/if_ether.h    |    3 +++
>  net/ethernet/eth.c               |    2 +-
>  net/openvswitch/datapath.c       |    2 +-
>  8 files changed, 12 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c
> index 2b27bff..bd34ca1 100644
> --- a/drivers/firewire/net.c
> +++ b/drivers/firewire/net.c
> @@ -630,7 +630,7 @@ static int fwnet_finish_incoming_packet(struct net_device *net,
>  			if (memcmp(eth->h_dest, net->dev_addr, net->addr_len))
>  				skb->pkt_type = PACKET_OTHERHOST;
>  		}
> -		if (ntohs(eth->h_proto) >= 1536) {
> +		if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN) {
>  			protocol = eth->h_proto;
>  		} else {
>  			rawp = (u16 *)skb->data;
[...]

-- 
Stefan Richter
-=====-===-= --== =-=-=
http://arcgraph.de/sr/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] net: add ETH_P_802_3_MIN
  2013-03-21  8:29 [PATCH] net: add ETH_P_802_3_MIN Simon Horman
@ 2013-03-21 14:02   ` Mauro Carvalho Chehab
  2013-03-21 14:02   ` Mauro Carvalho Chehab
  2013-03-21 15:56 ` David Miller
  2 siblings, 0 replies; 8+ messages in thread
From: Mauro Carvalho Chehab @ 2013-03-21 14:02 UTC (permalink / raw)
  To: Simon Horman
  Cc: dev, Karsten Keil, netdev, Gross, linux-media, Stefan Richter,
	linux1394-devel, David S. Miller, Jesse

Em Thu, 21 Mar 2013 17:29:28 +0900
Simon Horman <horms@verge.net.au> escreveu:

> Add a new constant ETH_P_802_3_MIN, the minimum ethernet type for
> an 802.3 frame. Frames with a lower value in the ethernet type field
> are Ethernet II.
> 
> Also update all the users of this value that I could find to use the
> new constant.
> 
> I anticipate adding some more users of this constant when
> adding MPLS support to Open vSwtich.
> 
> As suggested by Jesse Gross.
> 
> Compile tested only.
> 
> Cc: Jesse Gross <jesse@nicira.com>
> Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
> Cc: Karsten Keil <isdn@linux-pingi.de>
> Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
> Cc: linux1394-devel@lists.sourceforge.net
> Cc: linux-media@vger.kernel.org
> Cc: dev@openvswitch.org
> Signed-off-by: Simon Horman <horms@verge.net.au>

...

> diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c
> index 44225b1..9fc82a1 100644
> --- a/drivers/media/dvb-core/dvb_net.c
> +++ b/drivers/media/dvb-core/dvb_net.c
> @@ -185,7 +185,7 @@ static __be16 dvb_net_eth_type_trans(struct sk_buff *skb,
>  			skb->pkt_type=PACKET_MULTICAST;
>  	}
>  
> -	if (ntohs(eth->h_proto) >= 1536)
> +	if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN)
>  		return eth->h_proto;

...

Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>

Cheers,
Mauro

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] net: add ETH_P_802_3_MIN
@ 2013-03-21 14:02   ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 8+ messages in thread
From: Mauro Carvalho Chehab @ 2013-03-21 14:02 UTC (permalink / raw)
  To: Simon Horman
  Cc: netdev, David S. Miller, Jesse Gross, Stefan Richter,
	Karsten Keil, linux1394-devel, linux-media, dev

Em Thu, 21 Mar 2013 17:29:28 +0900
Simon Horman <horms@verge.net.au> escreveu:

> Add a new constant ETH_P_802_3_MIN, the minimum ethernet type for
> an 802.3 frame. Frames with a lower value in the ethernet type field
> are Ethernet II.
> 
> Also update all the users of this value that I could find to use the
> new constant.
> 
> I anticipate adding some more users of this constant when
> adding MPLS support to Open vSwtich.
> 
> As suggested by Jesse Gross.
> 
> Compile tested only.
> 
> Cc: Jesse Gross <jesse@nicira.com>
> Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
> Cc: Karsten Keil <isdn@linux-pingi.de>
> Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
> Cc: linux1394-devel@lists.sourceforge.net
> Cc: linux-media@vger.kernel.org
> Cc: dev@openvswitch.org
> Signed-off-by: Simon Horman <horms@verge.net.au>

...

> diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c
> index 44225b1..9fc82a1 100644
> --- a/drivers/media/dvb-core/dvb_net.c
> +++ b/drivers/media/dvb-core/dvb_net.c
> @@ -185,7 +185,7 @@ static __be16 dvb_net_eth_type_trans(struct sk_buff *skb,
>  			skb->pkt_type=PACKET_MULTICAST;
>  	}
>  
> -	if (ntohs(eth->h_proto) >= 1536)
> +	if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN)
>  		return eth->h_proto;

...

Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>

Cheers,
Mauro

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] net: add ETH_P_802_3_MIN
  2013-03-21  8:29 [PATCH] net: add ETH_P_802_3_MIN Simon Horman
  2013-03-21 13:24   ` Stefan Richter
  2013-03-21 14:02   ` Mauro Carvalho Chehab
@ 2013-03-21 15:56 ` David Miller
       [not found]   ` <20130321.115608.570355867509300023.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
  2 siblings, 1 reply; 8+ messages in thread
From: David Miller @ 2013-03-21 15:56 UTC (permalink / raw)
  To: horms
  Cc: netdev, jesse, stefanr, isdn, mchehab, linux1394-devel, linux-media, dev

From: Simon Horman <horms@verge.net.au>
Date: Thu, 21 Mar 2013 17:29:28 +0900

> Add a new constant ETH_P_802_3_MIN, the minimum ethernet type for
> an 802.3 frame. Frames with a lower value in the ethernet type field
> are Ethernet II.
> 
> Also update all the users of this value that I could find to use the
> new constant.
> 
> I anticipate adding some more users of this constant when
> adding MPLS support to Open vSwtich.
> 
> As suggested by Jesse Gross.
> 
> Compile tested only.
> 
> Signed-off-by: Simon Horman <horms@verge.net.au>

You missed a few cases:

drivers/media/dvb-core/dvb_net.c:       } while (p->ule_sndu_type < 1536);
drivers/media/dvb-core/dvb_net.c:                               if (priv->ule_sndu_type < 1536) {
net/atm/lec.h: *    is less than 1536(0x0600) MUST be encoded by placing that length
drivers/net/wireless/ray_cs.c:  if (ntohs(proto) >= 1536) { /* DIX II ethernet frame */
net/bridge/netfilter/ebtables.c:                if (FWINV2(ntohs(ethproto) >= 1536, EBT_IPROTO))
include/linux/if_vlan.h:        if (ntohs(proto) >= 1536) {
net/bluetooth/bnep/netdev.c:    if (proto >= 1536)
net/openvswitch/flow.c: if (ntohs(proto) >= 1536)
net/mac80211/tx.c:      } else if (ethertype >= 0x600) {
net/wireless/util.c:    } else if (ethertype > 0x600) {

In fact, the last line looks like a bug, it should be >= not >.

Could you take care of these bits and respin your patch?

Thanks!

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] net: add ETH_P_802_3_MIN
  2013-03-21 15:56 ` David Miller
@ 2013-03-22 13:49       ` Simon Horman
  0 siblings, 0 replies; 8+ messages in thread
From: Simon Horman @ 2013-03-22 13:49 UTC (permalink / raw)
  To: David Miller
  Cc: dev-yBygre7rU0TnMu66kgdUjQ, isdn-iHCpqvpFUx0uJkBD2foKsQ,
	mchehab-H+wXaHxf7aLQT0dZR+AlfA, netdev-u79uwXL29TY76Z2rM5mHXA,
	stefanr-MtYdepGKPcBMYopoZt5u/LNAH6kLmebB,
	linux1394-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	linux-media-u79uwXL29TY76Z2rM5mHXA

On Thu, Mar 21, 2013 at 11:56:08AM -0400, David Miller wrote:
> From: Simon Horman <horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
> Date: Thu, 21 Mar 2013 17:29:28 +0900
> 
> > Add a new constant ETH_P_802_3_MIN, the minimum ethernet type for
> > an 802.3 frame. Frames with a lower value in the ethernet type field
> > are Ethernet II.
> > 
> > Also update all the users of this value that I could find to use the
> > new constant.
> > 
> > I anticipate adding some more users of this constant when
> > adding MPLS support to Open vSwtich.
> > 
> > As suggested by Jesse Gross.
> > 
> > Compile tested only.
> > 
> > Signed-off-by: Simon Horman <horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
> 
> You missed a few cases:
> 
> drivers/media/dvb-core/dvb_net.c:       } while (p->ule_sndu_type < 1536);
> drivers/media/dvb-core/dvb_net.c:                               if (priv->ule_sndu_type < 1536) {
> net/atm/lec.h: *    is less than 1536(0x0600) MUST be encoded by placing that length
> drivers/net/wireless/ray_cs.c:  if (ntohs(proto) >= 1536) { /* DIX II ethernet frame */
> net/bridge/netfilter/ebtables.c:                if (FWINV2(ntohs(ethproto) >= 1536, EBT_IPROTO))
> include/linux/if_vlan.h:        if (ntohs(proto) >= 1536) {
> net/bluetooth/bnep/netdev.c:    if (proto >= 1536)
> net/openvswitch/flow.c: if (ntohs(proto) >= 1536)
> net/mac80211/tx.c:      } else if (ethertype >= 0x600) {
> net/wireless/util.c:    } else if (ethertype > 0x600) {
> 
> In fact, the last line looks like a bug, it should be >= not >.

Thanks for finding those.

> Could you take care of these bits and respin your patch?

Sure.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] net: add ETH_P_802_3_MIN
@ 2013-03-22 13:49       ` Simon Horman
  0 siblings, 0 replies; 8+ messages in thread
From: Simon Horman @ 2013-03-22 13:49 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, jesse, stefanr, isdn, mchehab, linux1394-devel, linux-media, dev

On Thu, Mar 21, 2013 at 11:56:08AM -0400, David Miller wrote:
> From: Simon Horman <horms@verge.net.au>
> Date: Thu, 21 Mar 2013 17:29:28 +0900
> 
> > Add a new constant ETH_P_802_3_MIN, the minimum ethernet type for
> > an 802.3 frame. Frames with a lower value in the ethernet type field
> > are Ethernet II.
> > 
> > Also update all the users of this value that I could find to use the
> > new constant.
> > 
> > I anticipate adding some more users of this constant when
> > adding MPLS support to Open vSwtich.
> > 
> > As suggested by Jesse Gross.
> > 
> > Compile tested only.
> > 
> > Signed-off-by: Simon Horman <horms@verge.net.au>
> 
> You missed a few cases:
> 
> drivers/media/dvb-core/dvb_net.c:       } while (p->ule_sndu_type < 1536);
> drivers/media/dvb-core/dvb_net.c:                               if (priv->ule_sndu_type < 1536) {
> net/atm/lec.h: *    is less than 1536(0x0600) MUST be encoded by placing that length
> drivers/net/wireless/ray_cs.c:  if (ntohs(proto) >= 1536) { /* DIX II ethernet frame */
> net/bridge/netfilter/ebtables.c:                if (FWINV2(ntohs(ethproto) >= 1536, EBT_IPROTO))
> include/linux/if_vlan.h:        if (ntohs(proto) >= 1536) {
> net/bluetooth/bnep/netdev.c:    if (proto >= 1536)
> net/openvswitch/flow.c: if (ntohs(proto) >= 1536)
> net/mac80211/tx.c:      } else if (ethertype >= 0x600) {
> net/wireless/util.c:    } else if (ethertype > 0x600) {
> 
> In fact, the last line looks like a bug, it should be >= not >.

Thanks for finding those.

> Could you take care of these bits and respin your patch?

Sure.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-03-22 13:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-21  8:29 [PATCH] net: add ETH_P_802_3_MIN Simon Horman
2013-03-21 13:24 ` Stefan Richter
2013-03-21 13:24   ` Stefan Richter
2013-03-21 14:02 ` Mauro Carvalho Chehab
2013-03-21 14:02   ` Mauro Carvalho Chehab
2013-03-21 15:56 ` David Miller
     [not found]   ` <20130321.115608.570355867509300023.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2013-03-22 13:49     ` Simon Horman
2013-03-22 13:49       ` Simon Horman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.