Bug 155040 - [linux] [patch] Linux recvfrom doesn't handle proto family
Summary: [linux] [patch] Linux recvfrom doesn't handle proto family
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: Dmitry Chagin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-25 19:50 UTC by Simon Walton
Modified: 2016-06-05 07:50 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (450 bytes, patch)
2011-02-25 19:50 UTC, Simon Walton
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Walton 2011-02-25 19:50:07 UTC
In the linux socket recvfrom emulation the incoming socket address family is
not converted to BSD values, although the reverse conversion is done. The values
for local and inet are identical so this still works, but inet6 values differ.

Fix: Apply patch. This also defaults unknown families to inet as apparently linux
ignores bad values in this syscall. This was necessary to get a linux
binary to work.

Alternatively maybe just force the address family to AF_UNSPEC.


Patch attached with submission follows:
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2011-02-26 09:20:23 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-emulation

Over to maintainer(s).
Comment 2 Dmitry Chagin freebsd_committer freebsd_triage 2015-05-24 21:20:32 UTC
grab it
Comment 3 commit-hook freebsd_committer freebsd_triage 2016-05-22 19:08:43 UTC
A commit references this bug:

Author: dchagin
Date: Sun May 22 19:08:29 UTC 2016
New revision: 300431
URL: https://svnweb.freebsd.org/changeset/base/300431

Log:
  Convert proto family in both directions. The linux and native values for
  local and inet are identical, but for inet6 values differ.

  PR:		155040
  Reported by:	Simon Walton
  MFC after:	2 week

Changes:
  head/sys/compat/linux/linux_socket.c
Comment 4 commit-hook freebsd_committer freebsd_triage 2016-06-05 07:44:06 UTC
A commit references this bug:

Author: dchagin
Date: Sun Jun  5 07:43:20 UTC 2016
New revision: 301431
URL: https://svnweb.freebsd.org/changeset/base/301431

Log:
  MFC r300431:

  Convert proto family in both directions. The linux and native values for
  local and inet are identical, but for inet6 values differ.

  PR:		155040
  Reported by:	Simon Walton

Changes:
_U  stable/10/
  stable/10/sys/compat/linux/linux_socket.c