Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 02 Nov 2014 14:59:30 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 194758] New: Need an API to obtain original destination port of locally forwarded UDP packet
Message-ID:  <bug-194758-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=194758

            Bug ID: 194758
           Summary: Need an API to obtain original destination port of
                    locally forwarded UDP packet
           Product: Base System
           Version: 10.0-RELEASE
          Hardware: Any
                OS: Any
            Status: Needs Triage
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: hoomanfazaeli@gmail.com

For UDP packets forwarded to a local daemon with a rule like below:

ipfw add 10 fwd localhost,7000 udp from any to any in recv em1

The daemon may obtain the original destination address of forwarded packets
using recvmsg(2) and IP_RECVDSTADDR socket option. However, there is no
API to obtain the original destination _port_.

One possible solution is to add a new socket option, say IP_RECVDSTSOADDR.
If set on a datagram socket, ip_savecontorl/ip6_savecontrol_v4 would record 
the datagram's destination address and port as a 'sockaddr_in[6]' structure.

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-194758-8>