Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xbee: make address length configurable #3158

Merged
merged 1 commit into from
Jun 12, 2015

Conversation

miri64
Copy link
Member

@miri64 miri64 commented Jun 3, 2015

6LoWPAN-ND states [1] that the IPv6 address should be generated from the EUI-64 of the interface, since it can be assumed as globally unique and would not require duplicate address detection. Currently the xbee module is not able to use any other address for short address with IPv6 since
NETCONF_OPT_SRC_LEN always returns 2. This patch fixes that.

[1] https://tools.ietf.org/html/rfc6775#section-5.2

@miri64 miri64 added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: drivers Area: Device drivers NSTF labels Jun 3, 2015
@miri64 miri64 added this to the Release 2015.06 milestone Jun 3, 2015
@@ -104,6 +117,7 @@ typedef struct {
gpio_t sleep_pin; /**< GPIO pin connected to SLEEP */
ng_nettype_t proto; /**< protocol the interface speaks */
uint8_t options; /**< options field */
uint8_t addr_flags; /**< address flags as defined above */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you introduce a new flag? Just use one bit of the options flag (thats what it is for...).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure if these were not device dependent, since they are added to the tx-buffer in https://github.com/authmillenon/RIOT/blob/xbee/enh/addr-len/drivers/xbee/xbee.c#L553

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right, forget what I said..

@haukepetersen
Copy link
Contributor

If you test this and say its working I will give my ACK.

@miri64
Copy link
Member Author

miri64 commented Jun 11, 2015

Works:

Type '/exit' to exit.
2015-06-11 19:47:01,255 - INFO # kernel_init(): This is RIOT! (Version: 2014.12-1785-g06924-stolzfuss-xbee/enh/addr-len)
2015-06-11 19:47:01,256 - INFO # kernel_init(): jumping into first task...
2015-06-11 19:47:02,728 - INFO # Xbee S1 device driver test
2015-06-11 19:47:02,731 - INFO # Initialization OK, starting shell now
ifconfig
2015-06-11 19:47:06,856 - INFO # > ifconfig
2015-06-11 19:47:06,921 - INFO # Iface  4   HWaddr: f8:d4  Channel: 17  NID: 0x23 
2015-06-11 19:47:06,968 - INFO #            Long HWaddr: 00:13:a2:00:40:a9:f8:d4
2015-06-11 19:47:06,971 - INFO #            Source address length: 2
2015-06-11 19:47:06,972 - INFO #            
ifconfig 4 set src_len 1
2015-06-11 19:47:15,237 - INFO # > ifconfig 4 set src_len 1
2015-06-11 19:47:15,241 - INFO # error: unable to set source address length
ifconfig 4 set src_len 2
2015-06-11 19:47:16,724 - INFO # > ifconfig 4 set src_len 2
2015-06-11 19:47:16,728 - INFO # success: set source address length on interface 4 to 2
ifconfig 4 set src_len 3
2015-06-11 19:47:18,198 - INFO # > ifconfig 4 set src_len 3
2015-06-11 19:47:18,202 - INFO # error: unable to set source address length
ifconfig 4 set src_len 4
2015-06-11 19:47:19,358 - INFO # > ifconfig 4 set src_len 4
2015-06-11 19:47:19,361 - INFO # error: unable to set source address length
ifconfig 4 set src_len 5
2015-06-11 19:47:20,648 - INFO # > ifconfig 4 set src_len 5
2015-06-11 19:47:20,652 - INFO # error: unable to set source address length
ifconfig 4 set src_len 6
2015-06-11 19:47:24,752 - INFO # > ifconfig 4 set src_len 6
2015-06-11 19:47:24,756 - INFO # error: unable to set source address length
ifconfig 4 set src_len 7
2015-06-11 19:47:26,268 - INFO # > ifconfig 4 set src_len 7
2015-06-11 19:47:26,272 - INFO # error: unable to set source address length
ifconfig 4 set src_len 8
2015-06-11 19:47:27,574 - INFO # > ifconfig 4 set src_len 8
2015-06-11 19:47:27,580 - INFO # success: set source address length on interface 4 to 8
ifconfig
2015-06-11 19:47:31,007 - INFO # > ifconfig
2015-06-11 19:47:31,072 - INFO # Iface  4   HWaddr: f8:d4  Channel: 17  NID: 0x23 
2015-06-11 19:47:31,122 - INFO #            Long HWaddr: 00:13:a2:00:40:a9:f8:d4
2015-06-11 19:47:31,123 - INFO #            Source address length: 8
2015-06-11 19:47:31,126 - INFO #            
ifconfig 4 set src_len 2
2015-06-11 19:47:38,507 - INFO # > ifconfig 4 set src_len 2
2015-06-11 19:47:38,511 - INFO # success: set source address length on interface 4 to 2
ifconfig
2015-06-11 19:47:40,666 - INFO # > ifconfig
2015-06-11 19:47:40,731 - INFO # Iface  4   HWaddr: f8:d4  Channel: 17  NID: 0x23 
2015-06-11 19:47:40,780 - INFO #            Long HWaddr: 00:13:a2:00:40:a9:f8:d4
2015-06-11 19:47:40,781 - INFO #            Source address length: 2
2015-06-11 19:47:40,784 - INFO # 

6LoWPAN-ND states [1] that the IPv6 address should be generated from the
EUI-64 of the interface, since it can be assumed as globally unique and
would not require duplicate address detection. Currently the xbee module is
not able to use any other address for short address with IPv6 since
NETCONF_OPT_SRC_LEN always returns 2. This patch fixes that.

[1] https://tools.ietf.org/html/rfc6775#section-5.2
@miri64 miri64 force-pushed the xbee/enh/addr-len branch from 069247c to f4392f7 Compare June 11, 2015 17:51
@miri64
Copy link
Member Author

miri64 commented Jun 11, 2015

Accidentally amended fix (s/->flags/->addr_flags/ in init function)

@miri64 miri64 added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jun 12, 2015
@haukepetersen
Copy link
Contributor

ACK when Travis is happy.

@haukepetersen
Copy link
Contributor

and go.

haukepetersen added a commit that referenced this pull request Jun 12, 2015
xbee: make address length configurable
@haukepetersen haukepetersen merged commit 6f2f716 into RIOT-OS:master Jun 12, 2015
@miri64 miri64 deleted the xbee/enh/addr-len branch June 12, 2015 12:36
@miri64 miri64 added the Area: network Area: Networking label Sep 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: drivers Area: Device drivers Area: network Area: Networking CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants