Apply by doing:
	cd /usr/src
	patch -p0 < 010_bgpd.patch

And then rebuild and install bgpd:
	cd usr.sbin/bgpd
	make depend
	make
	make install

Index: usr.sbin/bgpd/rde_attr.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/rde_attr.c,v
retrieving revision 1.76
diff -u -p -r1.76 rde_attr.c
--- usr.sbin/bgpd/rde_attr.c	8 May 2008 09:51:46 -0000	1.76
+++ usr.sbin/bgpd/rde_attr.c	18 Feb 2009 20:02:41 -0000
@@ -832,6 +832,8 @@ aspath_prepend(struct aspath *asp, u_int
 		size = 0;
 	}
 
+	if (quantum > 255)
+		fatalx("aspath_prepend: preposterous prepend");
 	if (quantum == 0) {
 		/* no change needed but return a copy */
 		p = malloc(asp->len);
@@ -843,7 +845,10 @@ aspath_prepend(struct aspath *asp, u_int
 	} else if (type == AS_SET || size + quantum > 255) {
 		/* need to attach a new AS_SEQUENCE */
 		l = 2 + quantum * sizeof(u_int32_t) + asp->len;
-		overflow = type == AS_SET ? quantum : (size + quantum) & 0xff;
+		if (type == AS_SET)
+			overflow = quantum;
+		else
+			overflow = size + quantum - 255;
 	} else
 		l = quantum * sizeof(u_int32_t) + asp->len;