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

conn: avoid duplicate binding #4387

Closed
OlegHahm opened this issue Dec 2, 2015 · 37 comments
Closed

conn: avoid duplicate binding #4387

OlegHahm opened this issue Dec 2, 2015 · 37 comments
Assignees
Labels
Area: network Area: Networking Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Comments

@OlegHahm
Copy link
Member

OlegHahm commented Dec 2, 2015

conn doesn't check if an address-port tuple is already used ("bound" in POSIX terminology) by another thread. One way to do so, would be by storing pointers to all created conn structs and iterate over this list on creation. A potential problem here is that the "owner" of this struct might free it without telling conn, i.e. calling close().

@OlegHahm OlegHahm added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Area: network Area: Networking labels Dec 2, 2015
@miri64
Copy link
Member

miri64 commented Dec 2, 2015

Since most stacks (except GNRC) already provide this functionality (which lead to problems in lwIP tests with conn_.*_sendto() btw, because you can't use sport for an already established connection), I think this is more a task for the stack. For GNRC the fix for that could be way simpler: if nettype TCP or UDP (or any other connection type using ports) then only allow one port as demux_ctx in gnrc_netreg. This makes registration to netreg slightly slower (because for those types the list needs to be iterated), but it shouldn't be more than 3-jump instructions + an extra return.

@OlegHahm
Copy link
Member Author

OlegHahm commented Dec 2, 2015

But binding a port to different addresses on the same host is valid behaviour.

@miri64
Copy link
Member

miri64 commented Dec 2, 2015

Ah, you're right.

@OlegHahm
Copy link
Member Author

OlegHahm commented Dec 2, 2015

Nevertheless, I think it could be okay for gnrc not to support this.

@miri64
Copy link
Member

miri64 commented Dec 2, 2015

Especially, since acceptance based on an (addr, port) pair is not something GNRC supports (GNRC lazy-ORs those two, not ANDs them)

@miri64
Copy link
Member

miri64 commented Dec 2, 2015

Lazy-ORing is not the right word, but I guess you know what I mean.

@miri64
Copy link
Member

miri64 commented Dec 2, 2015

It checks if the packets destination is on an interface and it checks if the packets destination port has a subscriber, but it does not check if the subscriber is bound to both on the same time.

@OlegHahm
Copy link
Member Author

OlegHahm commented Dec 2, 2015

Yepp, in that case I would be fine with the proposed solution.

@OlegHahm OlegHahm modified the milestone: Release 2016.03 Dec 7, 2015
@miri64
Copy link
Member

miri64 commented Apr 19, 2016

#5091 was already moved to the next release so let's move this one too.

@miri64 miri64 modified the milestones: Release 2016.07, Release 2016.04 Apr 19, 2016
@OlegHahm
Copy link
Member Author

Did you put it into the known issue list? (I always prefer to keep issues tagged for the release until they're listed as a known issue in the release notes - if applicable.)

@miri64
Copy link
Member

miri64 commented Apr 19, 2016

Aren't any issues that aren't solved for the release known issues?

@miri64
Copy link
Member

miri64 commented Apr 19, 2016

Also, I'm still unsure if this is really a bug and not a feature ;-)

@OlegHahm
Copy link
Member Author

Aren't any issues that aren't solved for the release known issues?

Yes, but you need to track them somehow.

@miri64
Copy link
Member

miri64 commented Apr 19, 2016

@OlegHahm
Copy link
Member Author

Exactly this is why I like to keep them tagged for the release until they're noted down in the release notes.

@miri64
Copy link
Member

miri64 commented Apr 19, 2016

Tagged as what?

@OlegHahm
Copy link
Member Author

"Release 2016.04" in this case

@miri64
Copy link
Member

miri64 commented Apr 19, 2016

Yes, but what does it mean compared to "Known Issue" (aka issue not solved at release time)?

@OlegHahm
Copy link
Member Author

It's just much easier to list them.

@miri64
Copy link
Member

miri64 commented Apr 19, 2016

I still don't get, why the search for "All issues, except the ones for Milestone 'Release 2016.04'" isn't exactly the list of known issues and why we have to specially mark them (with the milestone for the release no less).

@OlegHahm
Copy link
Member Author

Usually it should be the other way around: all issues for the Milestone "Release 2016.04" is the list of known issues.

@miri64
Copy link
Member

miri64 commented Apr 19, 2016

But where go the other issues then?

@OlegHahm
Copy link
Member Author

If it's not tagged for the release, it's not relevant to be listed as a known issue (e.g. a feature request).

@miri64
Copy link
Member

miri64 commented Apr 19, 2016

I think this way some known issues get lost... You can also exclude labels in the search.

@miri64
Copy link
Member

miri64 commented Apr 19, 2016

Some known issues for 2015.12 are still marked with the milestone for that release (or even unmarked).

@miri64 miri64 modified the milestones: Release 2016.04, Release 2016.07 Apr 19, 2016
@miri64
Copy link
Member

miri64 commented Apr 19, 2016

But if this is your workflow, I won't criticize it more. Re-tagged it for this release.

@kaspar030
Copy link
Contributor

If it's not tagged for the release, it's not relevant to be listed as a known issue (e.g. a feature request).

But open issues from one release should all get re-tagged...

@cgundogan
Copy link
Member

But open issues from one release should all get re-tagged...

Once they were noted down in the release notes, they can be re-tagged AFAIU.

@miri64
Copy link
Member

miri64 commented Apr 19, 2016

They can, but some aren't (just click on the known issues in the last release and see)

@cgundogan
Copy link
Member

That's because human do err. Old issues should be verified for the current
release, retagged appropriately and added to the known issues.
Am 19.04.2016 20:05 schrieb "Martine Lenders" notifications@github.com:

They can, but some aren't (just click on the known issues in the last
release and see)


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#4387 (comment)

@miri64
Copy link
Member

miri64 commented Apr 19, 2016

yeah, but as far as I can see there are also old issues never mentioned in "known issues" (need to recheck).

@kaspar030
Copy link
Contributor

Maybe we should go back to a "RIOT next" milestone. Everything postponed gets retagged there. Everything that must be fixed can be tagged with a current release milestone. No release with open issues.

... that way we don't get stale issues...

@haukepetersen
Copy link
Contributor

retaggt to 2016.07, I will worry about collecting it for the open issue list...

@haukepetersen haukepetersen modified the milestones: Release 2016.07, Release 2016.04 Apr 20, 2016
@kaspar030
Copy link
Contributor

any news?

@miri64
Copy link
Member

miri64 commented Jul 11, 2016

See #5091...

@kYc0o
Copy link
Contributor

kYc0o commented Jul 25, 2016

There's no milestone for #5091, so I'll postpone this one.

@kYc0o kYc0o modified the milestones: Release 2016.10, Release 2016.07 Jul 25, 2016
@miri64
Copy link
Member

miri64 commented Oct 17, 2016

Fixed in #5772.

@miri64 miri64 closed this as completed Nov 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

No branches or pull requests

6 participants