Skip to content

gnrc ipv6: append empty netif hdr for loopback#5247

Closed
OlegHahm wants to merge 3 commits into
RIOT-OS:masterfrom
OlegHahm:gnrc_ipv6_loopback_netif_hdr
Closed

gnrc ipv6: append empty netif hdr for loopback#5247
OlegHahm wants to merge 3 commits into
RIOT-OS:masterfrom
OlegHahm:gnrc_ipv6_loopback_netif_hdr

Conversation

@OlegHahm

@OlegHahm OlegHahm commented Apr 4, 2016

Copy link
Copy Markdown
Member

The netif header gets discarded during the reverse procedure.

@OlegHahm OlegHahm added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Area: network Area: Networking GNRC labels Apr 4, 2016
@OlegHahm OlegHahm added this to the Release 2016.04 milestone Apr 4, 2016
@miri64

miri64 commented Apr 5, 2016

Copy link
Copy Markdown
Member

What are the implications of this regarding the chosen interface?

@OlegHahm

OlegHahm commented Apr 5, 2016

Copy link
Copy Markdown
Member Author

Not sure what you mean. The interface should be KERNEL_PID_UNDEF.

@kaspar030

Copy link
Copy Markdown
Contributor

I can confirm that this fixes the crash experienced in #4725.

@miri64

miri64 commented Apr 5, 2016

Copy link
Copy Markdown
Member

Not sure what you mean. The interface should be KERNEL_PID_UNDEF.

Yes, but how does IPv6 react to that fact in the long run?

@kaspar030

kaspar030 commented Apr 5, 2016 via email

Copy link
Copy Markdown
Contributor

@OlegHahm

OlegHahm commented Apr 5, 2016

Copy link
Copy Markdown
Member Author

I hope IPv6 stops sending RAs to the loopback interface in the long run. ;)

@miri64

miri64 commented Apr 5, 2016

Copy link
Copy Markdown
Member

Yes, but how does IPv6 react to that fact in the long run?

Let's ask someone who must know... ;)

The requirement for netif headers wasn't my idea, so I ask what the expected behavior for its iface value set to KERNEL_PID_UNDEF.

@OlegHahm

OlegHahm commented Apr 5, 2016

Copy link
Copy Markdown
Member Author

I still don't quite understand the actual question.

@miri64

miri64 commented Apr 5, 2016

Copy link
Copy Markdown
Member

I want to know, if in the current implementation it is problematic when the given interface is set to KERNEL_PID_UNDEF and if no, why. Alternatively, if no, why is the netif header then required as assessed #5179. Wouldn't it then make more sense to revert #5179 and have iface = KERNEL_PID_UNDEF if netif == NULL.

@miri64

miri64 commented Apr 5, 2016

Copy link
Copy Markdown
Member

The more I think about it, I think reverting #5179 and amending the else-case is far less intrusive and restricting (given that KERNEL_PID_UNDEF doesn't lead to problems)...

@OlegHahm

OlegHahm commented Apr 5, 2016

Copy link
Copy Markdown
Member Author

IMO KERNEL_PID_UNDEF is the correct interface identifier for loopback (as there is no loopback device in GNRC).

I still think that an upper layer should have the information about which interface a packet was received.

@miri64

miri64 commented Apr 5, 2016

Copy link
Copy Markdown
Member

Kk, but I repeat (and modify) my question from #5179: Can we think about other cases except loopback where KERNEL_PID_UNDEF might be a valid value?

@OlegHahm

OlegHahm commented Apr 5, 2016

Copy link
Copy Markdown
Member Author

Yes.

@miri64

miri64 commented Apr 5, 2016

Copy link
Copy Markdown
Member

But then we can't assume KERNEL_PID_UNDEF to be the identifier for loopback, just that no interface information is available. So why require a netif header? The absence of it should be enough to implicitly assume KERNEL_PID_UNDEF (or equivalent values for addresses and RSSI/LQI).

@OlegHahm

OlegHahm commented Apr 5, 2016

Copy link
Copy Markdown
Member Author

What about other link layer information? NDP or CCN requires information about the sender's link layer address, too.

@miri64

miri64 commented Apr 5, 2016

Copy link
Copy Markdown
Member

NDP doesn't require that. It should by (and is to my knowledge) able to also handle address-less link-layers as e.g. SLIP. As for CCN: how do you handle the loopback case then and isn't this applicable for other "interface-less" packets?

@OlegHahm

OlegHahm commented Apr 5, 2016

Copy link
Copy Markdown
Member Author

There's no loopback in CCN.

@miri64

miri64 commented Apr 5, 2016

Copy link
Copy Markdown
Member

Then what has it to do with this PR / with the argument if a netif header is required for IPv6 or not?

@OlegHahm

OlegHahm commented Apr 5, 2016

Copy link
Copy Markdown
Member Author

I don't know, you asked. Anyhow, I'm tired of discussing this over and over again. IMO it would be far more important to debug why RAs are sent over the loopback interface in the first place instead of discussing the same things again and again.

@miri64

miri64 commented Apr 5, 2016

Copy link
Copy Markdown
Member

I'm just advocating for questioning what we are doing before applying some "quick-fix" that opens a whole new well of problems, which then open another can and so on... Otherwise I fear we run into a similar situation as with the previous stack were nobody knows anymore what's going on exactly.

@OlegHahm

OlegHahm commented Apr 8, 2016

Copy link
Copy Markdown
Member Author

For the release we need either to merge this or to revert #5179. I'm still convinced that this PR is the right solution, but if other people think differently or we cannot come to an agreement soon, I would be also fine with (temporarily) reverting #5179.

@miri64

miri64 commented Apr 8, 2016

Copy link
Copy Markdown
Member

Problem is, except the both of us nobody gave an argument to one or the other side. What is your opinion, @cgundogan @haukepetersen @kaspar030?

@miri64

miri64 commented Aug 5, 2016

Copy link
Copy Markdown
Member

How about defining -1 as system-wide as the identifier for loopback (also would be so beautifully symbolic because it mirrors [or in other terms negates] packets :D)

@miri64

miri64 commented Aug 5, 2016

Copy link
Copy Markdown
Member

(but we still shouldn't make netif-headers a requirement, just if the user wants to specifically address the loopback interface).

@miri64

miri64 commented Aug 30, 2016

Copy link
Copy Markdown
Member

ping?

@OlegHahm

Copy link
Copy Markdown
Member Author

I haven't changed my mind.

@miri64

miri64 commented Oct 31, 2016

Copy link
Copy Markdown
Member

Postponed due to feature freeze

@miri64 miri64 modified the milestones: Release 2017.01, Release 2016.10 Oct 31, 2016
@OlegHahm OlegHahm force-pushed the gnrc_ipv6_loopback_netif_hdr branch from 3d35474 to b789680 Compare January 14, 2017 14:11
@OlegHahm

Copy link
Copy Markdown
Member Author

I added a system-wide identifier for the loopback interface and rebased the PR. @miri64, what do you think?


/**
* @brief Identifier of the loopback interface
*/

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.

I'd rather have it a positive number (maybe KERNEL_PID_MAX?), since I think there might be checks for >= KERNEL_PID_UNDEF in the code.

@OlegHahm OlegHahm Jan 15, 2017

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.

Actually, -1 was your proposal:
#5247 (comment)

KERNEL_PID_LAST + 1 would work for me, too.

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.

Mh, then I trust past me for now. Let's test this :D

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.

assertion fails at gnrc_ipv6.c:817 when pinging ::1 or one of the node's unicast link local addresses in the gnrc_networking application.

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.

Considering that I chose -1 as NETIF_INVALID in #6413, I would actually prefer KERNEL_PID_LAST + 1 now.

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.

Ping?

@OlegHahm OlegHahm added the Community: Hack'n'ACK candidate This PR is a candidate for review and discussion during one of RIOT's monthly Hack'n'ACK parties label Jan 18, 2017
@PeterKietzmann PeterKietzmann added Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch and removed Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch labels Jan 26, 2017
@PeterKietzmann PeterKietzmann modified the milestones: Release 2017.04, Release 2017.01 Jan 31, 2017
@aabadie

aabadie commented Jun 20, 2017

Copy link
Copy Markdown
Contributor

ping @OlegHahm @miri64, what should we do here ?

@miri64

miri64 commented Jun 20, 2017

Copy link
Copy Markdown
Member

Since a redo of GNRC's network interfaces is in the pipeline, I think I can include a loopback, but adding an empty netif header for loopback isn't the solution, due to its ambiguity.

@kYc0o

kYc0o commented Jun 30, 2017

Copy link
Copy Markdown
Contributor

So you propose to close this one?

@miri64

miri64 commented Jun 30, 2017

Copy link
Copy Markdown
Member

Nope, keep it open as a reminder. But I still don't agree that every packet must have a netif header on sending.

@miri64 miri64 removed the Community: Hack'n'ACK candidate This PR is a candidate for review and discussion during one of RIOT's monthly Hack'n'ACK parties label Nov 6, 2017
@miri64

miri64 commented Nov 15, 2017

Copy link
Copy Markdown
Member

I think I prefer this one to be closed now as well. I plan to add some proper loopback representation when #7925 is through anyways

@miri64 miri64 closed this Nov 15, 2017
@miri64 miri64 added the State: archived State: The PR has been archived for possible future re-adaptation label Nov 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: network Area: Networking State: archived State: The PR has been archived for possible future re-adaptation Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants