From owner-freebsd-net@FreeBSD.ORG Wed Aug 21 15:42:43 2013 Return-Path: Delivered-To: freebsd-net@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 ESMTP id 678729D6 for ; Wed, 21 Aug 2013 15:42:43 +0000 (UTC) (envelope-from will@firepipe.net) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2A61C2559 for ; Wed, 21 Aug 2013 15:42:42 +0000 (UTC) Received: by mail-ve0-f169.google.com with SMTP id db10so511702veb.28 for ; Wed, 21 Aug 2013 08:42:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc :content-type; bh=7qeTvOzZvwk6+t2HagsYRQX+d4cSEkvwD1XkRhjEp48=; b=iqG1zcJRu+NBnGn2PLK7Do3MZJFCOJnsQK9HOCiw5Qyae6pw8IOxv/SSY+KQSHxWji RRQpiJvL+cXQgel39Sq2L2kDyeFdzNFL9svetEReooBsY/UL3spgAQ+YN6pMoc/bf/AM uvFLA65yTS6XkDq1OmiYzeVDY+/l4mYtnz1LToiahDvSIc1xh+2PbNnvrTy1NuDcZitw XdV4lpiqE8xsjvNBnNg64iADOCiV7Ogff8EfHk80qkvJlZyevhm85EkgB5p7FkFrVpKj 5i0grCI/dzZR7LFjY9TPXoYquoCWM04R+p5+IFeGNgRxD5BsyxuOVJiZOTJUStuugY09 KxSw== X-Gm-Message-State: ALoCoQmS6I1QfAcjRs14ymHa9TdrA6U6JQhGlhwaBlEcoXXofxgN5ShC7+rjLeNp1uPxyhvCFIua MIME-Version: 1.0 X-Received: by 10.220.10.194 with SMTP id q2mr7008652vcq.2.1377099756400; Wed, 21 Aug 2013 08:42:36 -0700 (PDT) Received: by 10.58.226.66 with HTTP; Wed, 21 Aug 2013 08:42:36 -0700 (PDT) Date: Wed, 21 Aug 2013 09:42:36 -0600 Message-ID: Subject: CFR: FIB handling improvements From: Will Andrews To: freebsd-net@freebsd.org Content-Type: text/plain; charset=UTF-8 Cc: "Justin T. Gibbs" , Alan Somers X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 15:42:43 -0000 Hi, I'm working to port forward to FreeBSD/head, improvements made to FIB handling by my colleagues Alan Somers and Justin Gibbs. Please review: http://people.freebsd.org/~will/fix-fib-issues.1.diff This patch includes fixes for several issues relating to FIBs: * Use of dhclient with non-zero FIBs. With this patch, it is possible to use DHCP on a specific interface with a non-zero FIB and have it work correctly with this rc.conf snippet: ifconfig_em1="SYNCDHCP" dhclient_fib_em1=1 This part of the patch includes a XXX, because I am not sure whether the dhclient rc.d script should manually set the FIB on the given interface, or if it should be inferred via some other mechanism. * Always add loopback routes for non-zero FIBs, for both IPv4 and IPv6. Arguably, this could be a policy issue, but it is currently less-than-trivial to specify (in rc.conf) that a route needs to be applied to every FIB. * Having two or more FIBs whose interfaces share the same prefix and netmask. This involves adding fibnum arguments to ifa_ifwithnet() and ifa_ifwithdstaddr(), and checking it within. * Setting the FIB on a network interface. rtinit1() looks it up via the current process context, so we must be calling setfib(2) from within ifconfig. * Creating & deleting loopback routes now works correctly for non-default FIBs, by using the interface's FIB instead of always 0. Commits would be made on each of these issues separately, but since they are all related, I thought it would be easier for others to evaluate them with context. Thanks! --Will.