summaryrefslogtreecommitdiffstats
path: root/sys/netipsec/keysock.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2008-07-09 15:48:16 +0000
committerrwatson <rwatson@FreeBSD.org>2008-07-09 15:48:16 +0000
commit754034c5cf572b6def935dfa55606273daf042c8 (patch)
tree723ae7ca9460a1b1337cd82ac0bd81bb312adb58 /sys/netipsec/keysock.c
parentc490da6d2678016039a02b7fbe09affbc616e9f9 (diff)
downloadFreeBSD-src-754034c5cf572b6def935dfa55606273daf042c8.zip
FreeBSD-src-754034c5cf572b6def935dfa55606273daf042c8.tar.gz
Remove unused support for local and foreign addresses in generic raw
socket support. These utility routines are used only for routing and pfkey sockets, neither of which have a notion of address, so were required to mock up fake socket addresses to avoid connection requirements for applications that did not specify their own fake addresses (most of them). Quite a bit of the removed code is #ifdef notdef, since raw sockets don't support bind() or connect() in practice. Removing this simplifies the raw socket implementation, and removes two (commented out) uses of dtom(9). Fake addresses passed to sendto(2) by applications are ignored for compatibility reasons, but this is now done in a more consistent way (and with a comment). Possibly, EINVAL could be returned here in the future if it is determined that no applications depend on the semantic inconsistency of specifying a destination address for a protocol without address support, but this will require some amount of careful surveying. NB: This does not affect netinet, netinet6, or other wire protocol raw sockets, which provide their own independent infrastructure with control block address support specific to the protocol. MFC after: 3 weeks Reviewed by: bz
Diffstat (limited to 'sys/netipsec/keysock.c')
-rw-r--r--sys/netipsec/keysock.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/sys/netipsec/keysock.c b/sys/netipsec/keysock.c
index cc1214b..5b26b2e 100644
--- a/sys/netipsec/keysock.c
+++ b/sys/netipsec/keysock.c
@@ -67,7 +67,6 @@ struct key_cb {
};
static struct key_cb key_cb;
-static struct sockaddr key_dst = { 2, PF_KEY, };
static struct sockaddr key_src = { 2, PF_KEY, };
static int key_sendup0 __P((struct rawcb *, struct mbuf *, int));
@@ -412,8 +411,6 @@ key_attach(struct socket *so, int proto, struct thread *td)
if (kp->kp_raw.rcb_proto.sp_protocol == PF_KEY) /* XXX: AF_KEY */
key_cb.key_count++;
key_cb.any_count++;
- kp->kp_raw.rcb_laddr = &key_src;
- kp->kp_raw.rcb_faddr = &key_dst;
soisconnected(so);
so->so_options |= SO_USELOOPBACK;
OpenPOWER on IntegriCloud