Stuart Henderson | 1 May 2007 13:25
Favicon
Gravatar

tcpdump/print-bgp.c: additional TCHECKs etc.

I am doing work on print-bgp.c, pulling in some of the more useful
changes from tcpdump.org, bringing the display format of communities
into the century of the fruitbat, and adding 4-byte ASN support.

Much of it is working already but I have split up the changes
into more manageable chunks.

Here is the first part, mostly a tidyup:

- additional truncation checks from tcpdump.org
- remove unused hlen (found by lint)
- remove comparison uint < 0 in decode_prefix4 (found by lint)
- note that BGPTYPE_DPA has a published draft

Index: print-bgp.c
===================================================================
RCS file: /cvs/src/usr.sbin/tcpdump/print-bgp.c,v
retrieving revision 1.7
diff -u -p -r1.7 print-bgp.c
--- print-bgp.c	28 Mar 2006 15:48:34 -0000	1.7
+++ print-bgp.c	1 May 2007 10:52:16 -0000
 <at>  <at>  -117,12 +117,13  <at>  <at>  struct bgp_attr {
 #define	BGPTYPE_COMMUNITIES		8	/* RFC1997 */
 #define	BGPTYPE_ORIGINATOR_ID		9	/* RFC1998 */
 #define	BGPTYPE_CLUSTER_LIST		10	/* RFC1998 */
-#define	BGPTYPE_DPA			11	/* work in progress */
+#define	BGPTYPE_DPA			11	/* draft-ietf-idr-bgp-dpa */
 #define	BGPTYPE_ADVERTISERS		12	/* RFC1863 */
 #define	BGPTYPE_RCID_PATH		13	/* RFC1863 */
 #define BGPTYPE_MP_REACH_NLRI		14	/* RFC2283 */
(Continue reading)

Stuart Henderson | 1 May 2007 17:06
Favicon
Gravatar

Re: tcpdump/print-bgp.c: additional TCHECKs etc.

thanks to some offlist feedback, here's an updated diff.

> -                       if (wpfx < 0) {
> +                       if (wpfx = -1) {
>                                 printf(" (illegal prefix length)");
>                                 break;
> -                       }

I just fixed this (assignment vs. comparison) and although
decode_prefix4 should only return +ve values unless it's
explicitly signalling a problem, it doesn't hurt to keep the
wpfx < 0 check like this.

:  			wpfx = decode_prefix4(&p[i], buf, sizeof(buf));
: -			if (wpfx < 0) {
: +			if (wpfx == -2)
: +				goto trunc;
: +			else if (wpfx < 0) {
:  				printf(" (illegal prefix length)");
:  				break;
:  			}

Index: print-bgp.c
===================================================================
RCS file: /cvs/src/usr.sbin/tcpdump/print-bgp.c,v
retrieving revision 1.7
diff -u -p -u -r1.7 print-bgp.c
--- print-bgp.c	28 Mar 2006 15:48:34 -0000	1.7
+++ print-bgp.c	1 May 2007 14:56:06 -0000
 <at>  <at>  -117,12 +117,13  <at>  <at>  struct bgp_attr {
(Continue reading)

Jeremy C. Reed | 1 May 2007 21:27

rc.conf.8 manpage says routed=YES

src/etc/rc.conf.8  1.13 says:

     ... For example, whether the system runs the routed daemon
     is determined by the line in this section

           routed=NO               # for normal use: "-q"

     If this line is edited to contain some valid routed daemon command-line
     flags, such as

           routed="-q"             # for normal use: "-q"

But src/etc/rc  1.304 has:

if [ X"${routed_flags}" != X"NO" ]; then
        echo -n ' routed';              routed $routed_flags
fi

Where is "$routed" turned into "$routed_flags"? Or is this a documentation 
bug? Or point me to my misunderstanding.

  Jeremy C. Reed

p.s. I am working on some documentation at
http://bsdwiki.reedmedia.net/wiki/Configure_a_service_to_start_at_boot_time.html
Feel free to join in!

Will Maier | 1 May 2007 22:00
Gravatar

Re: rc.conf.8 manpage says routed=YES

On Tue, May 01, 2007 at 02:27:34PM -0500, Jeremy C. Reed wrote:
> Where is "$routed" turned into "$routed_flags"? Or is this a
> documentation bug? Or point me to my misunderstanding.

I think that's a doc bug; patch below my sig.

-- 

o--------------------------{ Will Maier }--------------------------o
| web:.......http://www.lfod.us/ | email.........willmaier <at> ml1.net |
*------------------[ BSD Unix: Live Free or Die ]------------------*

Index: rc.conf.8
===================================================================
RCS file: /cvs/src/share/man/man8/rc.conf.8,v
retrieving revision 1.13
diff -u -u -r1.13 rc.conf.8
--- rc.conf.8	2007/03/21 22:07:52	1.13
+++ rc.conf.8	2007/05/01 19:57:59
 <at>  <at>  -57,13 +57,13  <at>  <at> 
 .Nm routed
 daemon is determined by the line in this section
 .Bd -literal -offset indent
-routed=NO		# for normal use: "-q"
+routed_flags=NO		# for normal use: "-q"
 .Ed
 .Pp
 If this line is edited to contain some valid routed daemon command-line
 flags, such as
 .Bd -literal -offset indent
(Continue reading)

Jason McIntyre | 1 May 2007 22:57
Picon

Re: rc.conf.8 manpage says routed=YES

On Tue, May 01, 2007 at 03:00:20PM -0500, Will Maier wrote:
> On Tue, May 01, 2007 at 02:27:34PM -0500, Jeremy C. Reed wrote:
> > Where is "$routed" turned into "$routed_flags"? Or is this a
> > documentation bug? Or point me to my misunderstanding.
> 
> I think that's a doc bug; patch below my sig.
> 

yep, just fixed it.
jmc

> -- 
> 
> o--------------------------{ Will Maier }--------------------------o
> | web:.......http://www.lfod.us/ | email.........willmaier <at> ml1.net |
> *------------------[ BSD Unix: Live Free or Die ]------------------*
> 
> Index: rc.conf.8
> ===================================================================
> RCS file: /cvs/src/share/man/man8/rc.conf.8,v
> retrieving revision 1.13
> diff -u -u -r1.13 rc.conf.8
> --- rc.conf.8	2007/03/21 22:07:52	1.13
> +++ rc.conf.8	2007/05/01 19:57:59
>  <at>  <at>  -57,13 +57,13  <at>  <at> 
>  .Nm routed
>  daemon is determined by the line in this section
>  .Bd -literal -offset indent
> -routed=NO		# for normal use: "-q"
> +routed_flags=NO		# for normal use: "-q"
(Continue reading)

Piotr Sikora | 2 May 2007 03:03
Picon

[patch] hoststated(8) - inaccurate counters

If any of the hosts in table with 'check icmp' was down, then counters
of all hosts which were up were increased twice (after receiving icmp
echo reply and after timeout). This could lead to inaccurate
availability statistics ;)

p.

Index: usr.sbin/hoststated/check_icmp.c
===================================================================
RCS file: /cvs/src/usr.sbin/hoststated/check_icmp.c,v
retrieving revision 1.14
diff -u -a -r1.14 check_icmp.c
--- usr.sbin/hoststated/check_icmp.c    23 Feb 2007 00:28:06 -0000      1.14
+++ usr.sbin/hoststated/check_icmp.c    1 May 2007 23:49:30 -0000
 <at>  <at>  -146,9 +146,10  <at>  <at> 
                        if (((struct sockaddr *)&host->ss)->sa_family !=
                            cie->af)
                                continue;
-                       if (!(host->flags & F_CHECK_DONE))
+                       if (!(host->flags & F_CHECK_DONE)) {
                                host->up = HOST_DOWN;
-                       hce_notify_done(host, msg);
+                               hce_notify_done(host, msg);
+                       }
                }
        }
 }

Gordon Willem Klok | 2 May 2007 08:07
Picon
Favicon

MP setperf for amd64

Pretty much the same deal as i386 but fewer choices in underlying
mechanisms atm (only powernow).

Basically if you have a multiprocessor amd64 machine and when you
boot *GENERIC* on it you see e.g.:

cpu0: Cool'n'Quiet K8 2000 MHz: speeds: 2000 1800 1000 MHz

Then your machine is an ideal canidate for testing.

Testing consists of setting hw.setperf to 0 and 100 and some
states in between, at each transition run md5 -t a few times and
ensure that the resulting speed figures are similar (wildly
diverging values indicate bugs) and that they are actually changing
from 0 -> 100 and back (states in between are tricky since you wont
know the critical numbers where transitions take place). I should
point out that if you use apmd that you want to make sure it is not
running when you do this, you will get confounding results otherwise.

I will have serveral more diffs for powernow on amd64 this week
that should let people who are missing the functionallity to use
it (almost everyone with an amd64 processor has it).

gwk

Index: sys/arch/amd64/amd64/identcpu.c
===================================================================
RCS file: /cvs/src/sys/arch/amd64/amd64/identcpu.c,v
retrieving revision 1.11
diff -u -p -r1.11 identcpu.c
(Continue reading)

James Turner | 3 May 2007 00:45
Favicon

4.1 disklable compile issues

I recently used anoncvs to update my 4.1 sources using this command
within /usr/src: cvs -qd anoncvs <at> rt.fm:/cvs up -rOPENBSD_4_1 -Pd.  I
noticed a message saying sbin/disklabel/editor.c was no longer in cvs.
I disregarded it and continued to build my new system.  I was able to
compile and install the kernel just fine.  When it came down to make
build it errored out complaining about editor.c not being there, so I
edited the Makefile and removed editor.c.  I ran make build again, it
got farther but exited with the below error, again pointing to a missing
editor.c.  Thanks for your help.

===> sbin/disklabel
cc -O2 -pipe  -DNUMBOOT=2 -DDOSLABEL -DSEEALSO="\"fdisk(8),
installboot(8)\""   -c /
usr/src/sbin/disklabel/disklabel.c
cc -O2 -pipe  -DNUMBOOT=2 -DDOSLABEL -DSEEALSO="\"fdisk(8),
installboot(8)\""   -c /
usr/src/sbin/disklabel/dkcksum.c
cc -O2 -pipe  -DNUMBOOT=2 -DDOSLABEL -DSEEALSO="\"fdisk(8),
installboot(8)\""   -c m
anual.c
cc  -static -o disklabel disklabel.o dkcksum.o manual.o -lutil
disklabel.o(.text+0x327): In function `main':
: undefined reference to `editor'
collect2: ld returned 1 exit status
*** Error code 1

Stop in /usr/src/sbin/disklabel (line 95 of /usr/share/mk/bsd.prog.mk).
*** Error code 1

Stop in /usr/src/sbin.
(Continue reading)

Emilio Perea | 3 May 2007 04:21

Re: 4.1 disklable compile issues

On Wed, May 02, 2007 at 09:19:00PM -0500, Emilio Perea wrote:
> You can just get editor.c from the website until they fix the cvs
> problem
> 
> http://www.openbsd.org/cgi-bin/cvsweb/src/sbin/disklabel/editor.c?rev=1.112&content-type=text/x-cvsweb-markup

URL should have been:

http://www.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sbin/disklabel/editor.c?rev=1.112

Emilio Perea | 3 May 2007 04:19

Re: 4.1 disklable compile issues

On Wed, May 02, 2007 at 06:45:38PM -0400, James Turner wrote:
> I recently used anoncvs to update my 4.1 sources using this command
> within /usr/src: cvs -qd anoncvs <at> rt.fm:/cvs up -rOPENBSD_4_1 -Pd.  I
> noticed a message saying sbin/disklabel/editor.c was no longer in cvs.
> I disregarded it and continued to build my new system.  I was able to
> compile and install the kernel just fine.  When it came down to make
> build it errored out complaining about editor.c not being there, so I
> edited the Makefile and removed editor.c.  I ran make build again, it
> got farther but exited with the below error, again pointing to a missing
> editor.c.  Thanks for your help.

You can just get editor.c from the website until they fix the cvs
problem

http://www.openbsd.org/cgi-bin/cvsweb/src/sbin/disklabel/editor.c?rev=1.112&content-type=text/x-cvsweb-markup


Gmane