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

Fix error on getsockopt if socket is disconnected #6444

Merged
merged 1 commit into from Nov 16, 2020

Conversation

vikman90
Copy link
Member

@vikman90 vikman90 commented Oct 28, 2020

Related issue
#6439

This PR aims to fix an error produced by getsockopt at OS_SetSocketSize in containers running on gVisor.

The error appears when setting the socket buffer size of newly bound TCP sockets as they are not connected yet. The particular implementation of the gVisor kernel returns an error code while Linux returns the default socket buffer size.

Log sample

Previous implementation

2020/10/28 12:55:31 wazuh-db: INFO: Started (pid: 15626).
2020/10/28 12:55:31 wazuh-db: CRITICAL: Unable to bind to socket '/queue/db/wdb': 'Transport endpoint is not connected'. Closing local server.

Applying patch

2020/10/28 12:59:41 wazuh-db: INFO: Started (pid: 15763).

Tests

  • Compile on Ubuntu 20.10.
  • Compile and run on Ubuntu 20.04 on gVisor.

@nicolaspapp nicolaspapp linked an issue Oct 28, 2020 that may be closed by this pull request
7 tasks
@vikman90 vikman90 changed the base branch from master to 4.0.1 November 6, 2020 19:49
@vikman90 vikman90 self-assigned this Nov 6, 2020
@vikman90 vikman90 added the module/shared This issue refers to shared code or independent of a particular component. label Nov 6, 2020
@vikman90 vikman90 added this to the Sprint 120 - Core milestone Nov 6, 2020
Copy link
Contributor

@chemamartinez chemamartinez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vikman90 vikman90 changed the base branch from 4.0.1 to 4.0.2 November 11, 2020 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/shared This issue refers to shared code or independent of a particular component.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Review Wazuh container functionallities while using gVisor
2 participants