Date: Wed, 22 Mar 2000 18:13:51 +0100 (CET) From: sam@enst.fr To: FreeBSD-gnats-submit@freebsd.org Subject: docs/17552: Documentation error in divert(4) Message-ID: <20000322171351.6FE491E3@antinea.enst.fr>
next in thread | raw e-mail | index | archive | help
>Number: 17552
>Category: docs
>Synopsis: Documentation error in divert(4)
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-doc
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: doc-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Mar 22 09:40:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: Samuel Tardieu
>Release: FreeBSD 5.0-CURRENT i386
>Organization:
TELECOM Paris
>Environment:
>Description:
When developing an toy application using divert(4), I was surprised to see
that it was working only if the PF_INET/SOCK_RAW/IPPROTO_DIVERT socket,
at bind() time, has a *valid* interface address (such as INADDR_ANY).
divert(4) manpage says:
The IP ad-
dress in the bind is ignored; only the port number is significant. A di-
vert socket bound to a divert port will receive all packets diverted to
that port by some (here unspecified) kernel mechanism(s).
This is false, as the bind() operation for a divert socket will call
in_pcbbind() which makes use of the interface address.
>How-To-Repeat:
Build a PF_INET/SOCK_RAW/IPPROTO_DIVERT socket, bind it with a sockaddr_in
structure which has an invalid sin_addr field. Diverted packets will not be
available on the socket and will be silently dropped by the kernel as if
no diverted socket was listening.
>Fix:
Two possible immediate fixes:
(1) Doc fix: change divert(4) manpage
(2) Code fix: when entering div_bind, change the nam->sin_addr field
if nam->sin_family is AF_INET so that it contains INADDR_ANY. It may
break things that would depend on the fact that a diverted socket
can be bound to a particular interface though (natd does use
INADDR_ANY explicitely).
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000322171351.6FE491E3>
