Skip to contentSkip to conversation

6lowpan: reimplementation of fragmentation handling

PATCH Superseded Alexander Aring 4 participants 13 messages Feb 21, 2014 – Feb 22, 2014 3 messages not in the archive

Subsystems (3)

v1 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Alexander Aring

author maintainer
#0 lore raw

cover 6lowpan: reimplementation of fragmentation handling

Hi,

this patch series reimplementation the fragmentation handling of 6lowpan accroding to rfc4944 [1].

The first big note is, that the current fragmentation behaviour isn't rfc complaint. The main issue is a wrong datagram_size value which needs to be:
datagram_size = ipv6_payload + ipv6 header + (maybe compressed transport header,
currently only udp is supported)

but the current datagram_size value is calculated as:
datagram_size = ipv6_payload

Fragmentation work in a linux<->linux communication only.

Why reimplementation?

I reimplemted the reassembly side only. The current behaviour is to allocate a skb with the reassembled size and hold all fragments in a list, protected by a spinlock. After we received all fragments (detected by the sum of all fragments, it begins to place all fragments into the allocated skb).

This reassembly implementation has some race condition. Additional I make it more rfc complaint. The current implementation match on the tag value inside the frag header only, but rfc4944 says we need to match on dst addr(mac), src addr(mac), tag value, datagram_size value. [2]

The new reassembly handling use the inet_frag api (I mean the callback interface of ipv6 and ipv4 reassembly). I looked into ipv6 and wanted to see how ipv6 is dealing with reassembly, so I based my code on this implementation.

On the sending side to generate the fragments I improved the current code to use the nearest 8 divided payload. (We can do that, because the mac layer has a dynamic size, so it depends on mac_header how big we can do the payload).

Of course I fix also the reassembly/sending side to be rfc complaint now.

Regards
Alexander Aring

[1] http://tools.ietf.org/html/rfc4944
[2] http://tools.ietf.org/html/rfc4944#section-5.3

Alexander Aring (6):
6lowpan: add frag information struct
6lowpan: fix fragmentation on sending side 6lowpan: move 6lowpan.c to 6lowpan_rtnl.c 6lowpan: fix some checkpatch issues
net: ns: add ieee802154_6lowpan namespace 6lowpan: handling 6lowpan fragmentation via inet_frag api

 include/net/ieee802154_netdev.h              |   7 +
 include/net/net_namespace.h                  |   4 +
 include/net/netns/ieee802154_6lowpan.h       |  22 ++
 net/ieee802154/6lowpan.h                     | 112 ++++++
 net/ieee802154/{6lowpan.c => 6lowpan_rtnl.c} | 327 +++++-----------
 net/ieee802154/Makefile                      |   1 +
 net/ieee802154/reassembly.c                  | 565 +++++++++++++++++++++++++++
 net/ieee802154/reassembly.h                  |  66 ++++
 8 files changed, 869 insertions(+), 235 deletions(-)
 create mode 100644 include/net/netns/ieee802154_6lowpan.h
 rename net/ieee802154/{6lowpan.c => 6lowpan_rtnl.c} (70%)
 create mode 100644 net/ieee802154/reassembly.c
 create mode 100644 net/ieee802154/reassembly.h
Signature · 1 line
1.9.0

A message that is not in the archive (sent off-list or not yet received): 1392995711-19563-1-git-send-email-alex.aring-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#2 lore raw

PATCH 2/6 6lowpan: fix fragmentation on sending side

This patch fix the fragmentation on sending side according to rfc4944.

Also add improvement to use the full payload of a PDU which calculate the nearest divided to 8 payload length for the fragmentation datagram size attribute.

The main issue is that the datagram size of fragmentation header use the ipv6 payload length, but rfc4944 says it's the ipv6 payload length inclusive network header size (and transport header size if compressed).

---
 net/ieee802154/6lowpan.c | 44 ++++++++++++++++++++++++++++++++++----------
 1 file changed, 34 insertions(+), 10 deletions(-)
net/ieee802154/6lowpan.c +34 -10
index 8edfea5..0fe0173 100644
@@ -106,6 +106,7 @@ static int lowpan_header_create(struct sk_buff *skb,
 			   unsigned short type, const void *_daddr,
 			   const void *_saddr, unsigned int len)
 {
+	struct ipv6hdr *hdr;
 	const u8 *saddr = _saddr;
 	const u8 *daddr = _daddr;
 	struct ieee802154_addr sa, da;
@@ -116,12 +117,20 @@ static int lowpan_header_create(struct sk_buff *skb,
 	if (type != ETH_P_IPV6)
 		return 0;
 
+	hdr = ipv6_hdr(skb);
+
 	if (!saddr)
 		saddr = dev->dev_addr;
 
 	raw_dump_inline(__func__, "saddr", (unsigned char *)saddr, 8);
 	raw_dump_inline(__func__, "daddr", (unsigned char *)daddr, 8);
 
+	/* Before replace ipv6hdr to 6lowpan header we save the dgram_size */
+	mac_cb(skb)->frag_info.d_size = len;
+	mac_cb(skb)->frag_info.d_offset = sizeof(struct ipv6hdr);
+	if (hdr->nexthdr == UIP_PROTO_UDP)
+		mac_cb(skb)->frag_info.d_offset += sizeof(struct udphdr);
+
 	lowpan_header_compress(skb, dev, type, daddr, saddr, len);
 
 	/*
@@ -422,44 +431,58 @@ lowpan_fragment_xmit(struct sk_buff *skb, u8 *head,
 static int
 lowpan_skb_fragmentation(struct sk_buff *skb, struct net_device *dev)
 {
-	int  err, header_length, payload_length, tag, offset = 0;
+	int err, header_length, payload_length, tag, dgram_size,
+	    dgram_offset, lowpan_size, frag_plen, offset = 0;
 	u8 head[5];
 
 	header_length = skb->mac_len;
 	payload_length = skb->len - header_length;
 	tag = lowpan_dev_info(dev)->fragment_tag++;
+	lowpan_size = skb_network_header_len(skb);
+	dgram_size = mac_cb(skb)->frag_info.d_size;
 
 	/* first fragment header */
-	head[0] = LOWPAN_DISPATCH_FRAG1 | ((payload_length >> 8) & 0x7);
-	head[1] = payload_length & 0xff;
+	head[0] = LOWPAN_DISPATCH_FRAG1 | ((dgram_size >> 8) & 0x7);
+	head[1] = dgram_size & 0xff;
 	head[2] = tag >> 8;
 	head[3] = tag & 0xff;
 
-	err = lowpan_fragment_xmit(skb, head, header_length, LOWPAN_FRAG_SIZE,
-				   0, LOWPAN_DISPATCH_FRAG1);
+	/* calc the nearest payload length(divided to 8) for first fragment
+	 * which fits into a IEEE802154_MTU
+	 */
+	frag_plen = round_down(IEEE802154_MTU - header_length -
+			       LOWPAN_FRAG1_HEAD_SIZE - lowpan_size -
+			       IEEE802154_MFR_SIZE, 8);
 
+	err = lowpan_fragment_xmit(skb, head, header_length,
+				   frag_plen + lowpan_size, 0,
+				   LOWPAN_DISPATCH_FRAG1);
 	if (err) {
 		pr_debug("%s unable to send FRAG1 packet (tag: %d)",
 			 __func__, tag);
 		goto exit;
 	}
 
-	offset = LOWPAN_FRAG_SIZE;
+	offset = lowpan_size + frag_plen;
+	dgram_offset = mac_cb(skb)->frag_info.d_offset + frag_plen;
 
 	/* next fragment header */
 	head[0] &= ~LOWPAN_DISPATCH_FRAG1;
 	head[0] |= LOWPAN_DISPATCH_FRAGN;
 
+	frag_plen = round_down(IEEE802154_MTU - header_length -
+			       LOWPAN_FRAGN_HEAD_SIZE - IEEE802154_MFR_SIZE, 8);
+
 	while (payload_length - offset > 0) {
-		int len = LOWPAN_FRAG_SIZE;
+		int len = frag_plen;
 
-		head[4] = offset / 8;
+		head[4] = dgram_offset >> 3;
 
 		if (payload_length - offset < len)
 			len = payload_length - offset;
 
-		err = lowpan_fragment_xmit(skb, head, header_length,
-					   len, offset, LOWPAN_DISPATCH_FRAGN);
+		err = lowpan_fragment_xmit(skb, head, header_length, len,
+					   offset, LOWPAN_DISPATCH_FRAGN);
 		if (err) {
 			pr_debug("%s unable to send a subsequent FRAGN packet "
 				 "(tag: %d, offset: %d", __func__, tag, offset);
@@ -467,6 +490,7 @@ lowpan_skb_fragmentation(struct sk_buff *skb, struct net_device *dev)
 		}
 
 		offset += len;
+		dgram_offset += len;
 	}
 
 exit:
Signature · 8 lines
1.9.0


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
#3 lore raw

PATCH 4/6 6lowpan: fix some checkpatch issues

In reply to a message not in the archive

Detected with:

./scripts/checkpatch.pl --strict -f net/ieee802154/6lowpan_rtnl.c

---
 net/ieee802154/6lowpan_rtnl.c | 27 +++++++++------------------
 1 file changed, 9 insertions(+), 18 deletions(-)
net/ieee802154/6lowpan_rtnl.c +9 -18
index 0fe0173..b543488 100644
@@ -1,10 +1,8 @@
-/*
- * Copyright 2011, Siemens AG
+/* Copyright 2011, Siemens AG
  * written by Alexander Smirnov <[email protected]>
  */
 
-/*
- * Based on patches from Jon Smirl <[email protected]>
+/* Based on patches from Jon Smirl <[email protected]>
  * Copyright (c) 2011 Jon Smirl <[email protected]>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -15,10 +13,6 @@
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 /* Jon's code is based on 6lowpan implementation for Contiki which is:
@@ -133,13 +127,11 @@ static int lowpan_header_create(struct sk_buff *skb,
 
 	lowpan_header_compress(skb, dev, type, daddr, saddr, len);
 
-	/*
-	 * NOTE1: I'm still unsure about the fact that compression and WPAN
+	/* NOTE1: I'm still unsure about the fact that compression and WPAN
 	 * header are created here and not later in the xmit. So wait for
 	 * an opinion of net maintainers.
 	 */
-	/*
-	 * NOTE2: to be absolutely correct, we must derive PANid information
+	/* NOTE2: to be absolutely correct, we must derive PANid information
 	 * from MAC subif of the 'dev' and 'real_dev' network devices, but
 	 * this isn't implemented in mainline yet, so currently we assign 0xff
 	 */
@@ -154,8 +146,7 @@ static int lowpan_header_create(struct sk_buff *skb,
 	/* intra-PAN communications */
 	da.pan_id = ieee802154_mlme_ops(dev)->get_pan_id(dev);
 
-	/*
-	 * if the destination address is the broadcast address, use the
+	/* if the destination address is the broadcast address, use the
 	 * corresponding short address
 	 */
 	if (lowpan_is_addr_broadcast(daddr)) {
@@ -395,7 +386,7 @@ static int lowpan_set_address(struct net_device *dev, void *p)
 
 static int
 lowpan_fragment_xmit(struct sk_buff *skb, u8 *head,
-			int mlen, int plen, int offset, int type)
+		     int mlen, int plen, int offset, int type)
 {
 	struct sk_buff *frag;
 	int hlen;
@@ -484,8 +475,8 @@ lowpan_skb_fragmentation(struct sk_buff *skb, struct net_device *dev)
 		err = lowpan_fragment_xmit(skb, head, header_length, len,
 					   offset, LOWPAN_DISPATCH_FRAGN);
 		if (err) {
-			pr_debug("%s unable to send a subsequent FRAGN packet "
-				 "(tag: %d, offset: %d", __func__, tag, offset);
+			pr_debug("%s unable to send a FRAGN packet.", __func__);
+			pr_debug("tag: %d, offset: %d", tag, offset);
 			goto exit;
 		}
 
@@ -692,7 +683,7 @@ static int lowpan_newlink(struct net *src_net, struct net_device *dev,
 	lowpan_dev_info(dev)->fragment_tag = 0;
 	mutex_init(&lowpan_dev_info(dev)->dev_list_mtx);
 
-	entry = kzalloc(sizeof(struct lowpan_dev_record), GFP_KERNEL);
+	entry = kzalloc(sizeof(*entry), GFP_KERNEL);
 	if (!entry) {
 		dev_put(real_dev);
 		lowpan_dev_info(dev)->real_dev = NULL;
Signature · 8 lines
1.9.0


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
#4 lore raw

Re: [PATCH net-next 4/6] 6lowpan: fix some checkpatch issues

net/ieee802154/6lowpan_rtnl.c

Quoted 1 line · Alexander Aring
net/ieee802154/6lowpan_rtnl.c +0 -0

[]

net/ieee802154/6lowpan_rtnl.c lowpan_skb_fragmentation(struct sk_buff *skb, struct net_device *dev) · line 479

Quoted 8 lines
net/ieee802154/6lowpan_rtnl.c +2 -2
@@ -484,8 +475,8 @@ lowpan_skb_fragmentation(struct sk_buff *skb, struct net_device *dev)
 		err = lowpan_fragment_xmit(skb, head, header_length, len,
 					   offset, LOWPAN_DISPATCH_FRAGN);
 		if (err) {
-			pr_debug("%s unable to send a subsequent FRAGN packet "
-				 "(tag: %d, offset: %d", __func__, tag, offset);
+			pr_debug("%s unable to send a FRAGN packet.", __func__);
+			pr_debug("tag: %d, offset: %d", tag, offset);

No need for 2 pr_debug statements.

Better to coalesce the format pieces into a single string adding the close parenthesis and a terminating newline.

			pr_debug("%s: unable to send a subsequent FRAGN packet "(tag: %d, offset: %d)\n",
				 __func__, tag, offset);
author maintainer
#5 lore raw

Re: [PATCH net-next 4/6] 6lowpan: fix some checkpatch issues

Hi,

Quoted 14 lines · Joe Perches

net/ieee802154/6lowpan_rtnl.c

Quoted 1 line · Alexander Aring
net/ieee802154/6lowpan_rtnl.c +0 -0

[]

net/ieee802154/6lowpan_rtnl.c lowpan_skb_fragmentation(struct sk_buff *skb, struct net_device *dev) · line 479

Quoted 8 lines
net/ieee802154/6lowpan_rtnl.c +2 -2
@@ -484,8 +475,8 @@ lowpan_skb_fragmentation(struct sk_buff *skb, struct net_device *dev)
 		err = lowpan_fragment_xmit(skb, head, header_length, len,
 					   offset, LOWPAN_DISPATCH_FRAGN);
 		if (err) {
-			pr_debug("%s unable to send a subsequent FRAGN packet "
-				 "(tag: %d, offset: %d", __func__, tag, offset);
+			pr_debug("%s unable to send a FRAGN packet.", __func__);
+			pr_debug("tag: %d, offset: %d", tag, offset);

No need for 2 pr_debug statements.

Quoted 5 lines

Better to coalesce the format pieces into a single string adding the close parenthesis and a terminating newline.

			pr_debug("%s: unable to send a subsequent FRAGN packet "(tag: %d, offset: %d)\n",
				 __func__, tag, offset);

ah ok, thanks I will fix it.

- Alex

#6 lore raw

PATCH 5/6 net: ns: add ieee802154_6lowpan namespace

In reply to a message not in the archive

This patch adds necessary ieee802154 6lowpan namespace to provide the inet_frag information. This is a initial support for handling 6lowpan fragmentation with the inet_frag api.

---
 include/net/net_namespace.h            |  4 ++++
 include/net/netns/ieee802154_6lowpan.h | 13 +++++++++++++
 2 files changed, 17 insertions(+)
 create mode 100644 include/net/netns/ieee802154_6lowpan.h
include/net/net_namespace.h +4 -0
index 991dcd9..79387f7 100644
@@ -15,6 +15,7 @@
 #include <net/netns/packet.h>
 #include <net/netns/ipv4.h>
 #include <net/netns/ipv6.h>
+#include <net/netns/ieee802154_6lowpan.h>
 #include <net/netns/sctp.h>
 #include <net/netns/dccp.h>
 #include <net/netns/netfilter.h>
@@ -90,6 +91,9 @@ struct net {
 #if IS_ENABLED(CONFIG_IPV6)
 	struct netns_ipv6	ipv6;
 #endif
+#if IS_ENABLED(CONFIG_IEEE802154_6LOWPAN)
+	struct netns_ieee802154_lowpan	ieee802154_lowpan;
+#endif
 #if defined(CONFIG_IP_SCTP) || defined(CONFIG_IP_SCTP_MODULE)
 	struct netns_sctp	sctp;
 #endif
include/net/netns/ieee802154_6lowpan.h new file +13 -0
new file mode 100644
index 0000000..88110b7
@@ -0,0 +1,13 @@
+/*
+ * ieee802154 6lowpan in net namespaces
+ */
+
+#include <net/inet_frag.h>
+
+#ifndef __NETNS_IEEE802154_6LOWPAN_H__
+#define __NETNS_IEEE802154_6LOWPAN_H__
+
+struct netns_ieee802154_lowpan {
+};
+
+#endif
Signature · 8 lines
1.9.0


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
#7 lore raw

PATCH 6/6 6lowpan: handling 6lowpan fragmentation via inet_frag api

In reply to a message not in the archive

This patch drops the current way of 6lowpan fragmentation on receiving side and replace it with a implementation which use the inet_frag api. The old fragmentation handling has some race conditions and isn't rfc4944 compatible. Also adding support to match fragments on destination and source address which is missing in the current implementation.

This patch add also a lookup function for uncompressed 6LoWPAN header size. This is needed to estimate the real size of fragmented packet.

---
 include/net/netns/ieee802154_6lowpan.h |   9 +
 net/ieee802154/6lowpan.h               | 112 +++++++
 net/ieee802154/6lowpan_rtnl.c          | 256 +++------------
 net/ieee802154/Makefile                |   2 +-
 net/ieee802154/reassembly.c            | 565 +++++++++++++++++++++++++++++++++
 net/ieee802154/reassembly.h            |  66 ++++
 6 files changed, 802 insertions(+), 208 deletions(-)
 create mode 100644 net/ieee802154/reassembly.c
 create mode 100644 net/ieee802154/reassembly.h
include/net/netns/ieee802154_6lowpan.h +9 -0
index 88110b7..079030c 100644
@@ -7,7 +7,16 @@
 #ifndef __NETNS_IEEE802154_6LOWPAN_H__
 #define __NETNS_IEEE802154_6LOWPAN_H__
 
+struct netns_sysctl_lowpan {
+#ifdef CONFIG_SYSCTL
+	struct ctl_table_header *frags_hdr;
+#endif
+};
+
 struct netns_ieee802154_lowpan {
+	struct netns_sysctl_lowpan sysctl;
+	struct netns_frags	frags;
+	u16			max_dsize;
 };
 
 #endif
net/ieee802154/6lowpan.h +112 -0

118 lines not on this page · raw message

net/ieee802154/6lowpan_rtnl.c +49 -207

340 lines not on this page · raw message

net/ieee802154/Makefile +1 -1
index 3d08adf..b113fc4 100644
@@ -2,6 +2,6 @@ obj-$(CONFIG_IEEE802154) += ieee802154.o af_802154.o
 obj-$(CONFIG_IEEE802154_6LOWPAN) += 6lowpan.o
 obj-$(CONFIG_6LOWPAN_IPHC) += 6lowpan_iphc.o
 
-6lowpan-y := 6lowpan_rtnl.o
+6lowpan-y := 6lowpan_rtnl.o reassembly.o
 ieee802154-y := netlink.o nl-mac.o nl-phy.o nl_policy.o wpan-class.o
 af_802154-y := af_ieee802154.o raw.o dgram.o
net/ieee802154/reassembly.c new file +565 -0

565 lines not on this page · raw message

net/ieee802154/reassembly.h new file +66 -0

66 lines not on this page · raw message

Signature · 8 lines
1.9.0


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
author maintainer
#8 lore raw

PATCH 1/6 6lowpan: add frag information struct

In reply to Alexander Aring

This patch adds a 6lowpan fragmentation struct into cb of skb which is necessary to hold fragmentation information.

---
 include/net/ieee802154_netdev.h | 7 +++++++
 1 file changed, 7 insertions(+)
include/net/ieee802154_netdev.h +7 -0
index 8196d5d..97b2e34 100644
@@ -29,6 +29,12 @@
 
 #include <net/af_ieee802154.h>
 
+struct ieee802154_frag_info {
+	__be16 d_tag;
+	u16 d_size;
+	u8 d_offset;
+};
+
 /*
  * A control block of skb passed between the ARPHRD_IEEE802154 device
  * and other stack parts.
@@ -39,6 +45,7 @@ struct ieee802154_mac_cb {
 	struct ieee802154_addr da;
 	u8 flags;
 	u8 seq;
+	struct ieee802154_frag_info frag_info;
 };
 
 static inline struct ieee802154_mac_cb *mac_cb(struct sk_buff *skb)
Signature · 1 line
1.9.0
author maintainer
#9 lore raw

PATCH 3/6 6lowpan: move 6lowpan.c to 6lowpan_rtnl.c

In reply to Alexander Aring

We have a 6lowpan.c file and 6lowpan.ko file. To avoid confusing we should move 6lowpan.c to 6lowpan.ko. Then we can support multiple source files for 6lowpan module.

---
 net/ieee802154/{6lowpan.c => 6lowpan_rtnl.c} | 0
 net/ieee802154/Makefile                      | 1 +
 2 files changed, 1 insertion(+)
 rename net/ieee802154/{6lowpan.c => 6lowpan_rtnl.c} (100%)
net/ieee802154/6lowpan_rtnl.c renamed from net/ieee802154/6lowpan.c +0 -0
similarity index 100%
rename from net/ieee802154/6lowpan.c
rename to net/ieee802154/6lowpan_rtnl.c
net/ieee802154/Makefile +1 -0
index e8f0588..3d08adf 100644
@@ -2,5 +2,6 @@ obj-$(CONFIG_IEEE802154) += ieee802154.o af_802154.o
 obj-$(CONFIG_IEEE802154_6LOWPAN) += 6lowpan.o
 obj-$(CONFIG_6LOWPAN_IPHC) += 6lowpan_iphc.o
 
+6lowpan-y := 6lowpan_rtnl.o
 ieee802154-y := netlink.o nl-mac.o nl-phy.o nl_policy.o wpan-class.o
 af_802154-y := af_ieee802154.o raw.o dgram.o
Signature · 1 line
1.9.0
#10 lore raw

Re: [PATCH net-next 3/6] 6lowpan: move 6lowpan.c to 6lowpan_rtnl.c

Quoted 2 lines · Alexander Aring

We have a 6lowpan.c file and 6lowpan.ko file. To avoid confusing we should move 6lowpan.c to 6lowpan.ko. Then we can support multiple source

You put the wrong filename here ^

Ben.

Quoted 25 lines

files for 6lowpan module.

---
 net/ieee802154/{6lowpan.c => 6lowpan_rtnl.c} | 0
 net/ieee802154/Makefile                      | 1 +
 2 files changed, 1 insertion(+)
 rename net/ieee802154/{6lowpan.c => 6lowpan_rtnl.c} (100%)
net/ieee802154/6lowpan_rtnl.c renamed from net/ieee802154/6lowpan.c +0 -0
similarity index 100%
rename from net/ieee802154/6lowpan.c
rename to net/ieee802154/6lowpan_rtnl.c
net/ieee802154/Makefile +1 -0
index e8f0588..3d08adf 100644
@@ -2,5 +2,6 @@ obj-$(CONFIG_IEEE802154) += ieee802154.o af_802154.o
 obj-$(CONFIG_IEEE802154_6LOWPAN) += 6lowpan.o
 obj-$(CONFIG_6LOWPAN_IPHC) += 6lowpan_iphc.o
 
+6lowpan-y := 6lowpan_rtnl.o
 ieee802154-y := netlink.o nl-mac.o nl-phy.o nl_policy.o wpan-class.o
 af_802154-y := af_ieee802154.o raw.o dgram.o
Signature · 2 lines
Ben Hutchings
I haven't lost my mind; it's backed up on tape somewhere.

A message that is not in the archive (sent off-list or not yet received): 1393076452.15717.98.camel-nDn/Rdv9kqW9Jme8/[email protected]

#12 lore raw

Re: [PATCH net-next 3/6] 6lowpan: move 6lowpan.c to 6lowpan_rtnl.c

Hi Ben,

thanks for your reply.

Quoted 6 lines · Ben Hutchings
Quoted 2 lines · Alexander Aring

We have a 6lowpan.c file and 6lowpan.ko file. To avoid confusing we should move 6lowpan.c to 6lowpan.ko. Then we can support multiple source

You put the wrong filename here ^

mhh, I meant here:

Currently we have only one-file supporting like:

obj-$(CONFIG_IEEE802154_6LOWPAN) += 6lowpan.o

It's generate a 6lowpan.ko from a 6lowpan.c file.

Now we need some multiple-file supporting and I change it to:

obj-$(CONFIG_IEEE802154_6LOWPAN) += 6lowpan.o
6lowpan-y := 6lowpan_rtnl.o reassembly.o

to generate a still the 6lowpan.ko module with object files of 6lowpan_rtnl.o (which contains mostly some rtnl callbacks implementations now) and reassembly.o file.

It's to support multiple files for a module only.

I can't do something like:

obj-$(CONFIG_IEEE802154_6LOWPAN) += 6lowpan.o
6lowpan-y := 6lowpan.o reassembly.o

because I have the same name for 6lowpan.c and 6lowpan.ko.

Is there maybe a better solution for this?

btw.

I also detected:

obj-$(CONFIG_6LOWPAN_IPHC) += 6lowpan_iphc.o

which is a seperate module. (if you selected it as module) but this makes no sense, we should built it in 6lowpan.ko like:

6lowpan-y := 6lowpan_rtnl.o 6lowpan_iphc.o reassembly.o

aswell.

- Alex

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk

#13 lore raw

Re: [PATCH net-next 3/6] 6lowpan: move 6lowpan.c to 6lowpan_rtnl.c

Quoted 4 lines · Alexander Aring

Hi Ben,

thanks for your reply.

Quoted 8 lines
Quoted 6 lines · Ben Hutchings
Quoted 2 lines · Alexander Aring

We have a 6lowpan.c file and 6lowpan.ko file. To avoid confusing we should move 6lowpan.c to 6lowpan.ko. Then we can support multiple source

You put the wrong filename here ^

mhh, I meant here:

[...]

I know what you mean, but the second '6lowpan.ko' in the description should surely be '6lowpan_rtnl.c' like in the subject.

Ben.

Signature · 2 lines
Ben Hutchings
I haven't lost my mind; it's backed up on tape somewhere.

A message that is not in the archive (sent off-list or not yet received): 1393078035.15717.103.camel-nDn/Rdv9kqW9Jme8/[email protected]

#15 lore raw

Re: [PATCH net-next 3/6] 6lowpan: move 6lowpan.c to 6lowpan_rtnl.c

Quoted 10 lines · Ben Hutchings
Quoted 9 lines · Alexander Aring

Hi Ben,

thanks for your reply.

Quoted 4 lines · Ben Hutchings
Quoted 2 lines · Alexander Aring

We have a 6lowpan.c file and 6lowpan.ko file. To avoid confusing we should move 6lowpan.c to 6lowpan.ko. Then we can support multiple source

Quoted 8 lines
Quoted 3 lines
Quoted 2 lines

You put the wrong filename here ^

mhh, I meant here:

[...]

I know what you mean, but the second '6lowpan.ko' in the description should surely be '6lowpan_rtnl.c' like in the subject.

oh yes. Thanks. :-)

- Alex

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk