From owner-freebsd-security Fri Oct 13 3:31:56 2000 Delivered-To: freebsd-security@freebsd.org Received: from sentinel.office1.bg (sentinel.office1.bg [195.24.48.182]) by hub.freebsd.org (Postfix) with SMTP id 0A42837B66C for ; Fri, 13 Oct 2000 03:31:13 -0700 (PDT) Received: (qmail 18832 invoked by uid 1001); 13 Oct 2000 10:27:43 -0000 Date: Fri, 13 Oct 2000 13:27:43 +0300 From: Peter Pentchev To: Rolf Edwards Cc: freebsd-security@FreeBSD.ORG Subject: Re: Dynamic rc.firewall Message-ID: <20001013132743.B17444@ringwraith.office1.bg> References: <5.0.0.25.2.20001013032255.00a8ee40@127.0.0.1> <20001013131528.A17444@ringwraith.office1.bg> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20001013131528.A17444@ringwraith.office1.bg>; from roam@orbitel.bg on Fri, Oct 13, 2000 at 01:15:28PM +0300 Sender: owner-freebsd-security@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Fri, Oct 13, 2000 at 01:15:28PM +0300, Peter Pentchev wrote: [snip] > > Actually, this just made me think of a way better solution. In a Bourne > shell, you just do.. > > [roam@ringwraith /etc]$ set `ifconfig | fgrep -w inet`; outaddr=$2; outmask=$4; outbcast = $6 > > Yes, it really is that easy :) ..except it doesn't necessarily work :) Don't you just love this feeling - spotting an error in something you just mailed out to God knows how many people :) ifconfig | fgrep -w inet returns the 'inet' line for ALL configured interfaces; set `...` shall only use the first line, which in my case just happened to be the xl0 iface.. set `ifconfig xl0 | fgrep -w inet`; outaddr="$2"; outmask="$4"; outbcast="$6" ..is a much better solution. G'luck, Peter -- What would this sentence be like if pi were 3? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-security" in the body of the message