<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">Apply by doing:
	cd /usr/src
	patch -p0 &lt; 001_bgpd.patch

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

Index: usr.sbin/bgpd/rde.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/rde.c,v
retrieving revision 1.316
retrieving revision 1.316.2.1
diff -u -r1.316 -r1.316.2.1
--- usr.sbin/bgpd/rde.c	27 May 2012 18:52:07 -0000	1.316
+++ usr.sbin/bgpd/rde.c	29 Nov 2012 20:06:16 -0000	1.316.2.1
@@ -1382,7 +1382,7 @@
 	} while (0)
 
 #define CHECK_FLAGS(s, t, m)	\
-	(((s) &amp; ~(ATTR_EXTLEN | (m))) == (t))
+	(((s) &amp; ~(ATTR_DEFMASK | (m))) == (t))
 
 int
 rde_attr_parse(u_char *p, u_int16_t len, struct rde_peer *peer,
Index: usr.sbin/bgpd/rde.h
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/rde.h,v
retrieving revision 1.142
retrieving revision 1.142.4.1
diff -u -r1.142 -r1.142.4.1
--- usr.sbin/bgpd/rde.h	21 Sep 2011 08:59:01 -0000	1.142
+++ usr.sbin/bgpd/rde.h	29 Nov 2012 20:06:16 -0000	1.142.4.1
@@ -118,6 +118,9 @@
 #define ATTR_PARTIAL		0x20
 #define ATTR_TRANSITIVE		0x40
 #define ATTR_OPTIONAL		0x80
+#define ATTR_RESERVED		0x0f
+/* by default mask the reserved bits and the ext len bit */
+#define ATTR_DEFMASK		(ATTR_RESERVED | ATTR_EXTLEN)
 
 /* default attribute flags for well known attributes */
 #define ATTR_WELL_KNOWN		ATTR_TRANSITIVE
Index: usr.sbin/bgpd/rde_attr.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/rde_attr.c,v
retrieving revision 1.90
retrieving revision 1.90.2.1
diff -u -r1.90 -r1.90.2.1
--- usr.sbin/bgpd/rde_attr.c	12 Apr 2012 17:27:20 -0000	1.90
+++ usr.sbin/bgpd/rde_attr.c	29 Nov 2012 20:06:16 -0000	1.90.2.1
@@ -37,12 +37,12 @@
 	u_char		*b = p;
 	u_int16_t	 tmp, tot_len = 2; /* attribute header (without len) */
 
+	flags &amp;= ~ATTR_DEFMASK;
 	if (data_len &gt; 255) {
 		tot_len += 2 + data_len;
 		flags |= ATTR_EXTLEN;
 	} else {
 		tot_len += 1 + data_len;
-		flags &amp;= ~ATTR_EXTLEN;
 	}
 
 	if (tot_len &gt; p_len)
@@ -69,12 +69,12 @@
 {
 	u_char	hdr[4];
 
+	flags &amp;= ~ATTR_DEFMASK;
 	if (data_len &gt; 255) {
 		flags |= ATTR_EXTLEN;
 		hdr[2] = (data_len &gt;&gt; 8) &amp; 0xff;
 		hdr[3] = data_len &amp; 0xff;
 	} else {
-		flags &amp;= ~ATTR_EXTLEN;
 		hdr[2] = data_len &amp; 0xff;
 	}
 
@@ -322,6 +322,7 @@
 		fatal("attr_optadd");
 	rdemem.attr_cnt++;
 
+	flags &amp;= ~ATTR_DEFMASK;	/* normalize mask */
 	a-&gt;flags = flags;
 	a-&gt;hash = hash32_buf(&amp;flags, sizeof(flags), HASHINIT);
 	a-&gt;type = type;
@@ -351,6 +352,7 @@
 	struct attr		*a;
 	u_int32_t		 hash;
 
+	flags &amp;= ~ATTR_DEFMASK;	/* normalize mask */
 	hash = hash32_buf(&amp;flags, sizeof(flags), HASHINIT);
 	hash = hash32_buf(&amp;type, sizeof(type), hash);
 	hash = hash32_buf(&amp;len, sizeof(len), hash);

</pre></body></html>