Skip to content

gnrc_ipv6_nib: add prefix list component#7222

Merged
cgundogan merged 3 commits intoRIOT-OS:masterfrom
miri64:gnrc_ipv6_nib/feat/pl-component
Oct 6, 2017
Merged

gnrc_ipv6_nib: add prefix list component#7222
cgundogan merged 3 commits intoRIOT-OS:masterfrom
miri64:gnrc_ipv6_nib/feat/pl-component

Conversation

@miri64
Copy link
Copy Markdown
Member

@miri64 miri64 commented Jun 21, 2017

Another step in the grant NIB journey. Implements the prefix list view of the NIB (see NDP model). This is aiming to remove the ambiguity of assigned addresses to an interface and the prefix list, currently present in the NIB (and also adds the capability to forward based on the prefix list once implemented, see #4730).

Currently WIP. Still missing:

  • unittests
  • shell command

Depends on #7212.

This PR is part of the network layer remodelling effort:
PR dependencies

@miri64 miri64 added GNRC Area: network Area: Networking Type: new feature The issue requests / The PR implemements a new feature for RIOT labels Jun 21, 2017
@miri64 miri64 requested a review from cgundogan June 21, 2017 19:12
@miri64 miri64 added State: waiting for other PR State: The PR requires another PR to be merged first State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet labels Jun 21, 2017
@miri64 miri64 force-pushed the gnrc_ipv6_nib/feat/pl-component branch from 0118125 to f66942b Compare June 22, 2017 16:41
@miri64 miri64 removed the State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet label Jun 22, 2017
@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Jun 22, 2017

Rebased to current #7212 and no longer WIP

@miri64 miri64 force-pushed the gnrc_ipv6_nib/feat/pl-component branch from f66942b to 51f65b9 Compare June 23, 2017 17:49
@aabadie aabadie modified the milestone: Release 2017.07 Jun 26, 2017
@miri64 miri64 force-pushed the gnrc_ipv6_nib/feat/pl-component branch from 51f65b9 to 18b216d Compare June 27, 2017 15:43
miri64 added a commit to miri64/RIOT that referenced this pull request Jun 27, 2017
miri64 added a commit to miri64/RIOT that referenced this pull request Jun 29, 2017
@miri64 miri64 force-pushed the gnrc_ipv6_nib/feat/pl-component branch from 945f669 to dd13a6e Compare June 30, 2017 16:06
@miri64 miri64 force-pushed the gnrc_ipv6_nib/feat/pl-component branch from dd13a6e to 46a4282 Compare June 30, 2017 16:18
miri64 added a commit to miri64/RIOT that referenced this pull request Jun 30, 2017
miri64 added a commit to miri64/RIOT that referenced this pull request Jul 4, 2017
@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Aug 21, 2017

Rebased to current master and current dependencies

@miri64 miri64 force-pushed the gnrc_ipv6_nib/feat/pl-component branch from 7842670 to 7c19572 Compare August 21, 2017 10:38
@miri64 miri64 force-pushed the gnrc_ipv6_nib/feat/pl-component branch 2 times, most recently from 57a08f0 to eb8a53c Compare October 6, 2017 10:23
@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Oct 6, 2017

Rebased to current master.

@miri64 miri64 added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed State: waiting for other PR State: The PR requires another PR to be merged first labels Oct 6, 2017
Copy link
Copy Markdown
Member

@cgundogan cgundogan left a comment

Choose a reason for hiding this comment

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

not much comments from my side here

*/
typedef struct {
ipv6_addr_t pfx; /**< prefix */
uint16_t pfx_len; /**< length of gnrc_ipv6_nib_pl_t::pfx in bits */
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why is this 16 bit wide?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

For alignment reasons mainly, but can make it uint8_t (will result in the same size).

* multicast address and its first @p pfx_len bits
* may not be 0.
* @param[in] pfx_len Length of @p pfx in bits.
* Condition 0 < @p pfx_len > 0 must hold.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

that's a very weird condition (:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Its not weird... it's just a weird way to say pfx_len > 0... Anyway, will remove one of the ends ^^

uint32_t now;
_nib_offl_entry_t *dst = _nib_offl_add(NULL, iface, pfx, pfx_len, _PL);

if (dst == NULL) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

wow; early exit (:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Never said I'm strictly against them :P But for gnrc_ndp it was pointed out by @OlegHahm so I kept it in gnrc_ndp2 ;-).

if (dst == NULL) {
return NULL;
}
assert((valid_ltime >= pref_ltime));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

remove one level of parens, please

pref_ltime += now;
}
if (valid_ltime != UINT32_MAX) {
if (((valid_ltime + now) == UINT32_MAX) && (now != 0)) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

no need to check nor now != 0, because it cannot be 0 due to the check above (valid_ltime != UINT32_MAX).

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Oct 6, 2017

Addressed @cgundogan's and @riot-ci's comments.

@cgundogan
Copy link
Copy Markdown
Member

that was a quick one (: pleas squash!

@miri64 miri64 force-pushed the gnrc_ipv6_nib/feat/pl-component branch from 20e5e0e to 32746b4 Compare October 6, 2017 13:36
@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Oct 6, 2017

Squashed

@cgundogan
Copy link
Copy Markdown
Member

GO!

@cgundogan cgundogan merged commit 080590f into RIOT-OS:master Oct 6, 2017
@miri64 miri64 deleted the gnrc_ipv6_nib/feat/pl-component branch October 6, 2017 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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: new feature The issue requests / The PR implemements a new feature for RIOT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants