From owner-svn-soc-all@freebsd.org Sun Jun 28 01:39:41 2015 Return-Path: Delivered-To: svn-soc-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 B4C5998C81E for ; Sun, 28 Jun 2015 01:39:41 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (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 A6C491304 for ; Sun, 28 Jun 2015 01:39:41 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5S1dfVT059545 for ; Sun, 28 Jun 2015 01:39:41 GMT (envelope-from roam@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5S1df5X059540 for svn-soc-all@FreeBSD.org; Sun, 28 Jun 2015 01:39:41 GMT (envelope-from roam@FreeBSD.org) Date: Sun, 28 Jun 2015 01:39:41 GMT Message-Id: <201506280139.t5S1df5X059540@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to roam@FreeBSD.org using -f From: roam@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287685 - soc2015/roam/ng_ayiya MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2015 01:39:41 -0000 Author: roam Date: Sun Jun 28 01:39:40 2015 New Revision: 287685 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287685 Log: Detect link-local addresses better. It's not just fe80::/16, it's a bit more complicated than that. Also, explain the reasoning behind skipping link-local addresses. ObQuote: "Step 2: There's so much we can do" Modified: soc2015/roam/ng_ayiya/ng_ayiya.c Modified: soc2015/roam/ng_ayiya/ng_ayiya.c ============================================================================== --- soc2015/roam/ng_ayiya/ng_ayiya.c Sun Jun 28 01:39:37 2015 (r287684) +++ soc2015/roam/ng_ayiya/ng_ayiya.c Sun Jun 28 01:39:40 2015 (r287685) @@ -450,7 +450,13 @@ continue; const struct sockaddr_in6 * const a = (const struct sockaddr_in6 *)ifa->ifa_addr; - if (a->sin6_addr.s6_addr16[0] == IPV6_ADDR_INT16_ULL) + /** + * Skip link-local addresses, they can't be used as + * AYIYA "Identity"; hope the administrator or the TIC + * client has set the appropriate tunnel endpoint IPv6 + * address on the interface by now. + */ + if ((htons(a->sin6_addr.s6_addr16[0]) & 0xFFC0) == 0xFE80) continue; const priv_p priv = NG_NODE_PRIVATE(node);