Skip to content
New issue

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

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

Already on GitHub? # to your account

gnrc ipv6: append empty netif hdr for loopback #5247

Closed

Conversation

OlegHahm
Copy link
Member

@OlegHahm OlegHahm commented Apr 4, 2016

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
Copy link
Member

miri64 commented Apr 5, 2016

What are the implications of this regarding the chosen interface?

@OlegHahm
Copy link
Member Author

OlegHahm commented Apr 5, 2016

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

@kaspar030
Copy link
Contributor

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

@miri64
Copy link
Member

miri64 commented Apr 5, 2016

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
Copy link
Contributor

kaspar030 commented Apr 5, 2016 via email

@OlegHahm
Copy link
Member Author

OlegHahm commented Apr 5, 2016

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

@miri64
Copy link
Member

miri64 commented Apr 5, 2016

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
Copy link
Member Author

OlegHahm commented Apr 5, 2016

I still don't quite understand the actual question.

@miri64
Copy link
Member

miri64 commented Apr 5, 2016

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
Copy link
Member

miri64 commented Apr 5, 2016

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
Copy link
Member Author

OlegHahm commented Apr 5, 2016

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
Copy link
Member

miri64 commented Apr 5, 2016

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
Copy link
Member Author

OlegHahm commented Apr 5, 2016

Yes.

@miri64
Copy link
Member

miri64 commented Apr 5, 2016

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
Copy link
Member Author

OlegHahm commented Apr 5, 2016

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

@miri64
Copy link
Member

miri64 commented Apr 5, 2016

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
Copy link
Member Author

OlegHahm commented Apr 5, 2016

There's no loopback in CCN.

@miri64
Copy link
Member

miri64 commented Apr 5, 2016

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

@OlegHahm
Copy link
Member Author

OlegHahm commented Apr 5, 2016

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
Copy link
Member

miri64 commented Apr 5, 2016

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
Copy link
Member Author

OlegHahm commented Apr 8, 2016

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
Copy link
Member

miri64 commented Apr 8, 2016

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
Copy link
Member

miri64 commented Aug 5, 2016

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
Copy link
Member

miri64 commented Aug 5, 2016

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

@miri64
Copy link
Member

miri64 commented Aug 30, 2016

ping?

@OlegHahm
Copy link
Member Author

I haven't changed my mind.

@miri64
Copy link
Member

miri64 commented Oct 31, 2016

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
Member Author

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

@@ -41,6 +41,11 @@ extern "C" {
#endif

/**
* @brief Identifier of the loopback interface
*/
#define GNRC_NETIF_LOOPBACK_PID (-1)
Copy link
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.

Copy link
Member Author

@OlegHahm OlegHahm Jan 15, 2017

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
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
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
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
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
Copy link
Contributor

aabadie commented Jun 20, 2017

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

@miri64
Copy link
Member

miri64 commented Jun 20, 2017

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
Copy link
Contributor

kYc0o commented Jun 30, 2017

So you propose to close this one?

@miri64
Copy link
Member

miri64 commented Jun 30, 2017

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
Copy link
Member

miri64 commented Nov 15, 2017

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
# for free to join this conversation on GitHub. Already have an account? # 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