From 373ef8a1bd1e2ee8ff0e405b7e4a9f1e96190950 Mon Sep 17 00:00:00 2001 From: mdodd Date: Tue, 29 Apr 2003 08:37:52 +0000 Subject: Document the IP_RECVIF socket option. Submitted by: Bruce M Simpson --- share/man/man4/ip.4 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/share/man/man4/ip.4 b/share/man/man4/ip.4 index 7130014..93bf0de 100644 --- a/share/man/man4/ip.4 +++ b/share/man/man4/ip.4 @@ -164,6 +164,22 @@ control message from can be used directly as a control message for .Xr sendmsg 2 . .Pp +If the +.Dv IP_RECVIF +option is enabled on a +.Dv SOCK_DGRAM +socket, the +.Xr recvmsg 2 +call returns a struct sockaddr_dl corresponding to the interface on which the +packet was received. The msg_control field in the msghdr structure points +to a buffer that contains a cmsghdr structure followed by the +struct sockaddr_dl. The cmsghdr fields have the following values: +.Bd -literal +cmsg_len = sizeof(struct sockaddr_dl) +cmsg_level = IPPROTO_IP +cmsg_type = IP_RECVIF +.Ed +.Pp .Dv IP_PORTRANGE may be used to set the port range used for selecting a local port number on a socket with an unspecified (zero) port number. -- cgit v1.1