Skip to content

Ensure that a call of listen really binds the given socket to the INET_ADDR#439

Merged
dinosaure merged 3 commits into
mirage:masterfrom
dinosaure:fix-listen-unix
Mar 16, 2021
Merged

Ensure that a call of listen really binds the given socket to the INET_ADDR#439
dinosaure merged 3 commits into
mirage:masterfrom
dinosaure:fix-listen-unix

Conversation

@dinosaure
Copy link
Copy Markdown
Member

It's a simple fix for #438

@hannesm
Copy link
Copy Markdown
Member

hannesm commented Feb 1, 2021

this looks fine, but there are two other occasions of similar code in the same module -- would you mind to adapt them accordingly?

also, ocaml-ci complains (rightfully):

tcpip.opam: changes needed:
  "ppx_cstruct"

could you make this change as well, please. thanks.

@hannesm
Copy link
Copy Markdown
Member

hannesm commented Feb 1, 2021

(pushed the requested changes to your branch directly)

@dinosaure
Copy link
Copy Markdown
Member Author

I'm ok with updates 👍 thanks!

@hannesm
Copy link
Copy Markdown
Member

hannesm commented Feb 2, 2021

hmm, the error (on travis with 4.08) is unexpected, anyone encountered this before (/cc @mirage/core)?

ld: /home/opam/.opam/4.08/lib/pkgconfig/../../lib/ocaml-freestanding/libasmrun.a(startup_aux_n.o):/home/opam/.opam/4.08/.opam-switch/build/ocaml-freestanding.0.6.3/ocaml/runtime/startup_aux.c:35: multiple definition of `caml_atom_table'; /home/opam/.opam/4.08/lib/pkgconfig/../../lib/ocaml-freestanding/libasmrun.a(startup_nat_n.o):/home/opam/.opam/4.08/.opam-switch/build/ocaml-freestanding.0.6.3/ocaml/runtime/startup_nat.c:47: first defined here

run ['ld' '-nostdlib' '-z' 'max-page-size=0x1000' '-static' '-T'
     '/home/opam/.opam/4.08/lib/pkgconfig/../../lib/solo5-bindings-xen/solo5_xen.lds'
     '/home/opam/.opam/4.08/lib/pkgconfig/../../lib/solo5-bindings-xen/solo5_xen.o'
     '_build/main.native.o' '_build/manifest.o'
     '-L/home/opam/.opam/4.08/lib/mirage-crypto'
     '-l:libmirage_crypto_freestanding_stubs.a'
     '/home/opam/.opam/4.08/lib/pkgconfig/../../lib/mirage-xen/libmirage-xen_bindings.a'
     '-L/home/opam/.opam/4.08/lib/pkgconfig/../../lib/ocaml-freestanding'
     '-lasmrun' '-lnolibc' '-lopenlibm' '-o' 'services.xen']: exited with 1

@dinosaure
Copy link
Copy Markdown
Member Author

I never got this error but I never used xen backend.

@dinosaure
Copy link
Copy Markdown
Member Author

I think the error is related to #441 where we miss something about Xen C stubs which implements checksum. An easier proposal is to delete xen_linkopts = "-L@tcpip/xen -ltcpip_xen_stubs" I think. It's probably the best solution when the Xen backend use ocaml-freestanding now. WDYT?

@hannesm
Copy link
Copy Markdown
Member

hannesm commented Feb 19, 2021

@dinosaure good point, I pushed a commit here to remove the META template here (I forgot to do this in #434).

@dinosaure
Copy link
Copy Markdown
Member Author

According to mirage/ocaml-solo5#88 (comment), the error on the CI is about 4.08.0 but we will delete the support of it on the CI. I think it's ok to merge. I will prepare a small PR to delete the support of 4.08.0 and upgrade ocamlformat to get a green CI.

@dinosaure dinosaure merged commit 36d3cb5 into mirage:master Mar 16, 2021
dinosaure added a commit to dinosaure/opam-repository that referenced this pull request Mar 17, 2021
CHANGES:

* Ensure that listen really binds the given socket before
  creating a task on `tcpip.stack-socket` (@dinosaure, @hannesm, mirage/mirage-tcpip#439)
* Add `ppx_cstruct` as a dependency (@hannesm, @dinosaure, mirage/mirage-tcpip#439)
* Upgrade to ocamlformat.0.17.0 (@dinosaure, mirage/mirage-tcpip#442)
* Drop the support of OCaml 4.08.0 (@dinosaure, mirage/mirage-tcpip#442)
* Use the usual layout to compile freestanding C stubs and link them to
  a Solo5 unikernel (@dinosaure, @hannesm, mirage/mirage-tcpip#441)
  **breaking changes**
  C stubs are prepended by `mirage_`. Symbols such as checksum's
  symbols are `caml_mirage_tcpip_*` instead of `caml_tcpip_*`
  `tcpip.unix` is a fake sub-package and user does not it anymore, he can
  safely remove it from its project.
* Conflict with `< ocaml-freestanding.0.4.1` (@hannesm, mirage/mirage-tcpip#441)
dinosaure added a commit to dinosaure/opam-repository that referenced this pull request Mar 26, 2021
CHANGES:

* Add cancelation on `tcpip.stack-socket` (@dinosaure, @talex5, @hannesm, mirage/mirage-tcpip#443)
* Ensure that listen really binds the given socket before
  creating a task on `tcpip.stack-socket` (@dinosaure, @hannesm, mirage/mirage-tcpip#439)
* Add `ppx_cstruct` as a dependency (@hannesm, @dinosaure, mirage/mirage-tcpip#439)
* Upgrade to ocamlformat.0.17.0 (@dinosaure, mirage/mirage-tcpip#442)
* Drop the support of OCaml 4.08.0 (@dinosaure, mirage/mirage-tcpip#442)
* Use the usual layout to compile freestanding C stubs and link them to
  a Solo5 unikernel (@dinosaure, @hannesm, mirage/mirage-tcpip#441)
  **breaking changes**
  C stubs are prepended by `mirage_`. Symbols such as checksum's
  symbols are `caml_mirage_tcpip_*` instead of `caml_tcpip_*`
  `tcpip.unix` is a fake sub-package and user does not it anymore, he can
  safely remove it from its project.
* Conflict with `< ocaml-freestanding.0.4.1` (@hannesm, mirage/mirage-tcpip#441)
dinosaure added a commit to dinosaure/opam-repository that referenced this pull request Mar 26, 2021
CHANGES:

* checksum stubs: Drop `caml_` from their name (@hannesm, mirage/mirage-tcpip#445)
* Add cancelation on `tcpip.stack-socket` (@dinosaure, @talex5, @hannesm, mirage/mirage-tcpip#443)
* Ensure that listen really binds the given socket before
  creating a task on `tcpip.stack-socket` (@dinosaure, @hannesm, mirage/mirage-tcpip#439)
* Add `ppx_cstruct` as a dependency (@hannesm, @dinosaure, mirage/mirage-tcpip#439)
* Upgrade to ocamlformat.0.17.0 (@dinosaure, mirage/mirage-tcpip#442)
* Drop the support of OCaml 4.08.0 (@dinosaure, mirage/mirage-tcpip#442)
* Use the usual layout to compile freestanding C stubs and link them to
  a Solo5 unikernel (@dinosaure, @hannesm, mirage/mirage-tcpip#441)
  **breaking changes**
  C stubs are prepended by `mirage_`. Symbols such as checksum's
  symbols are `caml_mirage_tcpip_*` instead of `caml_tcpip_*`
  `tcpip.unix` is a fake sub-package and user does not it anymore, he can
  safely remove it from its project.
* Conflict with `< ocaml-freestanding.0.4.1` (@hannesm, mirage/mirage-tcpip#441)
dinosaure added a commit to dinosaure/opam-repository that referenced this pull request Mar 29, 2021
CHANGES:

* checksum stubs: Drop `caml_` from their name (@hannesm, mirage/mirage-tcpip#445)
* Add cancelation on `tcpip.stack-socket` (@dinosaure, @talex5, @hannesm, mirage/mirage-tcpip#443)
* Ensure that listen really binds the given socket before
  creating a task on `tcpip.stack-socket` (@dinosaure, @hannesm, mirage/mirage-tcpip#439)
* Add `ppx_cstruct` as a dependency (@hannesm, @dinosaure, mirage/mirage-tcpip#439)
* Upgrade to ocamlformat.0.17.0 (@dinosaure, mirage/mirage-tcpip#442)
* Drop the support of OCaml 4.08.0 (@dinosaure, mirage/mirage-tcpip#442)
* Use the usual layout to compile freestanding C stubs and link them to
  a Solo5 unikernel (@dinosaure, @hannesm, mirage/mirage-tcpip#441)
  **breaking changes**
  C stubs are prepended by `mirage_`. Symbols such as checksum's
  symbols are `caml_mirage_tcpip_*` instead of `caml_tcpip_*`
  `tcpip.unix` is a fake sub-package and user does not it anymore, he can
  safely remove it from its project.
* Conflict with `< ocaml-freestanding.0.4.1` (@hannesm, mirage/mirage-tcpip#441)
@dinosaure dinosaure deleted the fix-listen-unix branch November 23, 2022 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants