From owner-svn-src-projects@FreeBSD.ORG Wed Jul 9 05:34:37 2014 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3B84E6B; Wed, 9 Jul 2014 05:34:36 +0000 (UTC) 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 C69C2228A; Wed, 9 Jul 2014 05:34:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s695YaJs087262; Wed, 9 Jul 2014 05:34:36 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s695YaW3087261; Wed, 9 Jul 2014 05:34:36 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201407090534.s695YaW3087261@svn.freebsd.org> From: Bryan Venteicher Date: Wed, 9 Jul 2014 05:34:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r268448 - projects/vxlan/sys/net X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jul 2014 05:34:37 -0000 Author: bryanv Date: Wed Jul 9 05:34:36 2014 New Revision: 268448 URL: http://svnweb.freebsd.org/changeset/base/268448 Log: More misc vxlan changes: - Remove a block of disabled (and incorrect) code, and replace it with a comment that describes what we later might need to do there - Clear IFF_UP during the interface teardown Modified: projects/vxlan/sys/net/if_vxlan.c Modified: projects/vxlan/sys/net/if_vxlan.c ============================================================================== --- projects/vxlan/sys/net/if_vxlan.c Wed Jul 9 04:37:50 2014 (r268447) +++ projects/vxlan/sys/net/if_vxlan.c Wed Jul 9 05:34:36 2014 (r268448) @@ -1096,28 +1096,21 @@ vxlan_socket_mc_join_group(struct vxlan_ if (error) return (error); -#ifdef notyet - struct ip_mreqn mreqn; - bzero(&mreqn, sizeof(mreqn)); - - bzero(&sopt, sizeof(sopt)); - sopt.sopt_dir = SOPT_GET; - sopt.sopt_level = IPPROTO_IP; - sopt.sopt_name = IP_MULTICAST_IF; - sopt.sopt_val = &mreqn; - sopt.sopt_valsize = sizeof(mreqn); - error = sogetopt(vso->vxlso_sock, &sopt); - if (error) - return (error); - - MPASS(source->in4.sin_addr.s_addr == INADDR_ANY || - source->in4.sin_addr.s_addr == mreqn.imr_address.s_addr); - source->in4.sin_addr = mreqn.imr_address; - *ifidx = mreqn.imr_ifindex; -#else + /* + * BMV: Ideally, there would be a formal way for us to get + * the local interface that was selected based on the + * imr_interface address. We could then update *ifidx so + * vxlan_sockaddr_mc_info_match() would return a match for + * later creates that explicitly set the multicast interface. + * + * If we really need to, we can of course look in the INP's + * membership list: + * sotoinpcb(vso->vxlso_sock)->inp_moptions-> + * imo_membership[]->inm_ifp + * similarly to imo_match_group(). + */ source->in4.sin_addr = local->in4.sin_addr; - *ifidx = 0; -#endif + } else if (VXLAN_SOCKADDR_IS_IPV6(group)) { struct ipv6_mreq mreq; @@ -1134,23 +1127,10 @@ vxlan_socket_mc_join_group(struct vxlan_ if (error) return (error); -#ifdef notyet - int idx; - bzero(&sopt, sizeof(sopt)); - sopt.sopt_dir = SOPT_GET; - sopt.sopt_level = IPPROTO_IPV6; - sopt.sopt_name = IPV6_MULTICAST_IF; - sopt.sopt_val = &idx; - sopt.sopt_valsize = sizeof(int); - error = sogetopt(vso->vxlso_sock, &sopt); - if (error) - return (error); - - MPASS(*ifidx == 0 || *ifidx == idx); - *ifidx = idx; -#else - *ifidx = 0; -#endif + /* + * BMV: As with IPv4, we would really like to know what + * interface in6p_lookup_mcast_ifp() selected. + */ } else error = EAFNOSUPPORT; @@ -1710,6 +1690,7 @@ vxlan_teardown_locked(struct vxlan_softc VXLAN_LOCK_WASSERT(sc); MPASS(sc->vxl_flags & VXLAN_FLAG_TEARDOWN); + ifp->if_flags &= ~IFF_UP; ifp->if_drv_flags &= ~IFF_DRV_RUNNING; callout_stop(&sc->vxl_callout); vso = sc->vxl_sock; @@ -2516,7 +2497,7 @@ vxlan_input(struct vxlan_socket *vso, ui m->m_pkthdr.rcvif = ifp; M_SETFIB(m, ifp->if_fib); - error = netisr_queue_src(NETISR_ETHER, 0 ,m); + error = netisr_queue_src(NETISR_ETHER, 0, m); *m0 = NULL; out: