Skip to content

Ipv6: more address types#3575

Merged
OlegHahm merged 2 commits intoRIOT-OS:masterfrom
OlegHahm:ipv6_more_address_types
Aug 7, 2015
Merged

Ipv6: more address types#3575
OlegHahm merged 2 commits intoRIOT-OS:masterfrom
OlegHahm:ipv6_more_address_types

Conversation

@OlegHahm
Copy link
Copy Markdown
Member

@OlegHahm OlegHahm commented Aug 6, 2015

No description provided.

@OlegHahm OlegHahm added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: network Area: Networking NSTF labels Aug 6, 2015
@miri64
Copy link
Copy Markdown
Member

miri64 commented Aug 6, 2015

Don't know what you did, but the diff looks very chaotic for an addition of new features oO

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.

ffc0 would fall through the cracks, too. Also, since the link-local equivalent is checking the link-local multicast prefix too, this one should do it too.

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.

ffc0 would fall through the cracks, too
Yes, but according to RFC4291 site-local has the first 10 bits set to 1111111011. Hence, ffc0 would not be site-local.

Also, since the link-local equivalent is checking the link-local multicast prefix too, this one should do it too.

Will add.

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.

You misunderstood: ffc0 will be registered as site-local by this function, since the & shadows the lsb of the first byte.

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.

Also: I think the compiler has a better chance of optimization if you swap the byteorder of the constants (as I did in the rest of the file)

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.

Ah, I see.

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.

Why should 0b1111111011000000 result in smaller size than 0b0000001101111111?
Or did I get you wrong?

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.

Because the code to convert it like that isn't generated.

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.

wanted to make a build size comparison:

/home/oleg/git/RIOT/sys/include/net/ng_ipv6/addr.h: In function ‘ng_ipv6_addr_is_site_local’
/home/oleg/git/RIOT/sys/include/net/ng_ipv6/addr.h:366:46: error: incompatible type for argument 1 of ‘byteorder_ntohs’
     return (((addr->u16[0] & byteorder_ntohs(0xFFC0)) ==

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.

I tried several combinations, none of them was compilable. If you can provide the exact code I should test, I will run a buildsize comparison.

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.

Will do in the current diff, but I see the error on spot: you use byteorder_ntohs() with an integer (thus an hosts ordered value) you should have used `byteorder_htons().

@OlegHahm
Copy link
Copy Markdown
Member Author

OlegHahm commented Aug 6, 2015

Don't know what you did, but the diff looks very chaotic for an addition of new features oO

I move one or two checks to order them according to their order in RFC4291.

@OlegHahm
Copy link
Copy Markdown
Member Author

OlegHahm commented Aug 6, 2015

I think if you play around with the diff options it looks less chaotic.

@OlegHahm OlegHahm added the CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable label Aug 6, 2015
@OlegHahm
Copy link
Copy Markdown
Member Author

OlegHahm commented Aug 6, 2015

updated

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 byteorder conversion necessary:

addr->u16[5].u16 == 0xffff

since 0xffff is symmetrical.

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.

true, will change

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.

addressed

@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 Aug 7, 2015
@miri64
Copy link
Copy Markdown
Member

miri64 commented Aug 7, 2015

Apart from a minor copy-pasta error in doc: ACK

@miri64
Copy link
Copy Markdown
Member

miri64 commented Aug 7, 2015

(please squash immediately)

Added checks for:
* Global Unicast Addresses
* IPv6 Addresses with Embedded IPv4 Addresses
  * IPv4-Compatible IPv6 Address
  * IPv4-Mapped IPv6 Address
* Site-Local IPv6 Unicast Addresses
@OlegHahm OlegHahm force-pushed the ipv6_more_address_types branch from 836b16d to f9417ba Compare August 7, 2015 06:18
@OlegHahm
Copy link
Copy Markdown
Member Author

OlegHahm commented Aug 7, 2015

Addressed comment, fixed a minor glitch, and squashed without conflicts. Thanks for the review.

@OlegHahm OlegHahm removed the CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable label Aug 7, 2015
OlegHahm added a commit that referenced this pull request Aug 7, 2015
@OlegHahm OlegHahm merged commit 1373795 into RIOT-OS:master Aug 7, 2015
@OlegHahm OlegHahm deleted the ipv6_more_address_types branch August 7, 2015 07:22
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: 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