From owner-svn-src-all@freebsd.org Sat Jun 27 12:37:10 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4458198D979; Sat, 27 Jun 2015 12:37:10 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28B001BAE; Sat, 27 Jun 2015 12:37:10 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5RCbAUp036830; Sat, 27 Jun 2015 12:37:10 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5RCbAFA036829; Sat, 27 Jun 2015 12:37:10 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201506271237.t5RCbAFA036829@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 27 Jun 2015 12:37:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284889 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jun 2015 12:37:10 -0000 Author: bz Date: Sat Jun 27 12:37:09 2015 New Revision: 284889 URL: https://svnweb.freebsd.org/changeset/base/284889 Log: Fix compilation without INET6 and without INET and INET6 after offload support was introduced in r284746. While here also fix the ioctl() handler for IPv4 added in r279819, which was never compiled in given opt_inet.h was not included. Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Sat Jun 27 09:47:28 2015 (r284888) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Sat Jun 27 12:37:09 2015 (r284889) @@ -55,6 +55,9 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_inet6.h" +#include "opt_inet.h" + #include #include #include @@ -179,8 +182,12 @@ static uint32_t get_transport_proto_type uint16_t ether_type = 0; int ether_len = 0; struct ether_vlan_header *eh; +#ifdef INET struct ip *iph; +#endif +#ifdef INET6 struct ip6_hdr *ip6; +#endif eh = mtod(m_head, struct ether_vlan_header*); if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { @@ -192,6 +199,7 @@ static uint32_t get_transport_proto_type } switch (ntohs(ether_type)) { +#ifdef INET6 case ETHERTYPE_IPV6: ip6 = (struct ip6_hdr *)(m_head->m_data + ether_len); @@ -201,6 +209,8 @@ static uint32_t get_transport_proto_type ret_val = TRANSPORT_TYPE_IPV6_UDP; } break; +#endif +#ifdef INET case ETHERTYPE_IP: iph = (struct ip *)(m_head->m_data + ether_len); @@ -210,6 +220,7 @@ static uint32_t get_transport_proto_type ret_val = TRANSPORT_TYPE_IPV4_UDP; } break; +#endif default: ret_val = TRANSPORT_TYPE_NOT_IP; break; @@ -608,6 +619,7 @@ do_tso: tso_info->lso_v2_xmit.type = RNDIS_TCP_LARGE_SEND_OFFLOAD_V2_TYPE; +#ifdef INET if (trans_proto_type & (TYPE_IPV4 << 16)) { struct ip *ip = (struct ip *)(m_head->m_data + ether_len); @@ -623,7 +635,13 @@ do_tso: th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(IPPROTO_TCP)); - } else { + } +#endif +#if defined(INET6) && defined(INET) + else +#endif +#ifdef INET6 + { struct ip6_hdr *ip6 = (struct ip6_hdr *)(m_head->m_data + ether_len); struct tcphdr *th = (struct tcphdr *)(ip6 + 1); @@ -633,6 +651,7 @@ do_tso: ip6->ip6_plen = 0; th->th_sum = in6_cksum_pseudo(ip6, 0, IPPROTO_TCP, 0); } +#endif tso_info->lso_v2_xmit.tcp_header_offset = 0; tso_info->lso_v2_xmit.mss = m_head->m_pkthdr.tso_segsz; @@ -950,6 +969,9 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, { hn_softc_t *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; +#ifdef INET + struct ifaddr *ifa = (struct ifaddr *)data; +#endif netvsc_device_info device_info; struct hv_device *hn_dev; int mask, error = 0;