Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Feb 2013 23:44:47 +0000
From:      Gerald McNulty <>
Subject:   Retrieving the destination port in an ipfw fwd'ed UDP packet
Message-ID:  <>

Next in thread | Raw E-Mail | Index | Archive | Help
I'm trying to get the destination port from a UDP packet that's been ipfw
fwd'ed to my code. Getting the destination IP address works fine with *
setsockopt(...,IP_RECVDSTADDR,...)* and then *recvfrom*, but there doesn't
seem to be a way to get the port.

For TCP I could just use
getpeername(2) <>; for all the IP
address info but this only returns the locally bound address and port, not
the actual destination.

Is there an elegant way to get the destination IP port from an ipfw fwd'ed


Want to link to this message? Use this URL: <>