From owner-freebsd-hackers@FreeBSD.ORG Mon Jun 16 18:27:02 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D9AE937B401 for ; Mon, 16 Jun 2003 18:27:02 -0700 (PDT) Received: from cage.simianscience.com (cage.simianscience.com [64.7.134.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1A6D643FB1 for ; Mon, 16 Jun 2003 18:27:01 -0700 (PDT) (envelope-from mike@sentex.net) Received: from house.sentex.net (fcage [192.168.0.2]) by cage.simianscience.com (8.12.9/8.12.9) with ESMTP id h5H1QvlD013438 for ; Mon, 16 Jun 2003 21:26:58 -0400 (EDT) (envelope-from mike@sentex.net) Message-Id: <5.2.0.9.0.20030616210725.082e5240@192.168.0.12> X-Sender: mdtancsa@192.168.0.12 X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9 Date: Mon, 16 Jun 2003 21:25:01 -0400 To: hackers@freebsd.org From: Mike Tancsa Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: amavis-20020220 Subject: updating a routing table entry X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jun 2003 01:27:03 -0000 I am trying to work around a problem, where a routing daemon (zebra) installs a subnet, that I then want to convert over to a connected route off an interface via ifconfig e.g. on vlan2 I want to add an interface on the subnet 12.0.0.112/28. Before the ifconfig I see # route get 12.0.0.112/28 route to: 12.0.0.112 destination: 12.0.0.112 mask: 255.255.255.240 gateway: 192.168.1.1 interface: vlan1 flags: recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire 0 0 0 0 0 0 1500 0 In the case of the 12.0.0.112/28 network I guess i need to get the kernel and zebra to know that its not flags: but flags: and via vlan2 Short of killing the routing daemon, doing the ifconfig, is there another way to do this ? What about some ifconfig hackery ? Is this not where it dies ? if (newaddr && (setaddr || setmask)) { strncpy(afp->af_addreq, name, sizeof ifr.ifr_name); if (ioctl(s, afp->af_aifaddr, afp->af_addreq) < 0) Perror("ioctl (SIOCAIFADDR)"); } What if I added a check for a flag/param (e.g. -force) if (newaddr && (setaddr || setmask) && !FORCE ) { strncpy(afp->af_addreq, name, sizeof ifr.ifr_name); if (ioctl(s, afp->af_aifaddr, afp->af_addreq) < 0) Perror("ioctl (SIOCAIFADDR)"); } Is there a better way to do it ? ---Mike -------------------------------------------------------------------- Mike Tancsa, tel +1 519 651 3400 Sentex Communications, mike@sentex.net Providing Internet since 1994 www.sentex.net Cambridge, Ontario Canada www.sentex.net/mike