From 734a66b389401392d78d4cb81b576bbbf9de9a29 Mon Sep 17 00:00:00 2001 From: bz Date: Sat, 30 Apr 2011 11:17:00 +0000 Subject: Make the UDP code compile without INET. Expose udp_usrreq.c to IPv6 only as well compiling out most functions adding or extending #ifdef INET coverage. Reviewed by: gnn Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems MFC after: 4 days --- sys/netinet6/udp6_usrreq.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sys/netinet6') diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index 04ba3c5..d574c19 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -849,6 +849,7 @@ udp6_bind(struct socket *so, struct sockaddr *nam, struct thread *td) if (IN6_IS_ADDR_UNSPECIFIED(&sin6_p->sin6_addr)) inp->inp_vflag |= INP_IPV4; +#ifdef INET else if (IN6_IS_ADDR_V4MAPPED(&sin6_p->sin6_addr)) { struct sockaddr_in sin; @@ -859,10 +860,13 @@ udp6_bind(struct socket *so, struct sockaddr *nam, struct thread *td) td->td_ucred); goto out; } +#endif } error = in6_pcbbind(inp, nam, td->td_ucred); +#ifdef INET out: +#endif INP_WUNLOCK(inp); INP_INFO_WUNLOCK(&V_udbinfo); return (error); @@ -909,6 +913,7 @@ udp6_connect(struct socket *so, struct sockaddr *nam, struct thread *td) INP_INFO_WLOCK(&V_udbinfo); INP_WLOCK(inp); +#ifdef INET if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { struct sockaddr_in sin; @@ -932,6 +937,7 @@ udp6_connect(struct socket *so, struct sockaddr *nam, struct thread *td) soisconnected(so); goto out; } +#endif if (!IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr)) { error = EISCONN; goto out; -- cgit v1.1