On 10:43:30, 30.05.17, Job Snijders wrote:
> In the registry created by RFC 6608, the value "0" is the BGP Finite
> State Machine Error subcode meaning "Unspecified Error". I think that
> when a name is assigned to a value, the name should be printed (like
> your patch does for subcode values 1, 2, and 3).
> 
> If no name is known for the error subcode, just printing the number is
> useful indeed.

You are right.

Index: usr.sbin/tcpdump/print-bgp.c
===================================================================
RCS file: /cvs/src/usr.sbin/tcpdump/print-bgp.c,v
retrieving revision 1.21
diff -u -p -r1.21 print-bgp.c
--- usr.sbin/tcpdump/print-bgp.c        24 Apr 2017 20:35:35 -0000      1.21
+++ usr.sbin/tcpdump/print-bgp.c        30 May 2017 09:00:49 -0000
@@ -226,6 +226,16 @@ static const char *bgpnotify_minor_updat
        "Invalid Network Field", "Malformed AS_PATH",
 };
 
+static const char *bgpnotify_minor_holdtime[] = {
+       NULL,
+};
+
+/* RFC 6608 */
+static const char *bgpnotify_minor_fsm[] = {
+       "Unspecified Error", "In OpenSent State", "In OpenConfirm State",
+       "In Established State",
+};
+
 /* RFC 4486 */
 #define BGP_NOTIFY_MINOR_CEASE_MAXPRFX  1
 /* draft-ietf-idr-shutdown-07 */
@@ -246,14 +256,16 @@ static const char *bgpnotify_minor_cap[]
 
 static const char **bgpnotify_minor[] = {
        NULL, bgpnotify_minor_msg, bgpnotify_minor_open, bgpnotify_minor_update,
+       bgpnotify_minor_holdtime, bgpnotify_minor_fsm, bgpnotify_minor_cease,
+       bgpnotify_minor_cap,
 };
 static const int bgpnotify_minor_siz[] = {
        0,
        sizeof(bgpnotify_minor_msg)/sizeof(bgpnotify_minor_msg[0]),
        sizeof(bgpnotify_minor_open)/sizeof(bgpnotify_minor_open[0]),
        sizeof(bgpnotify_minor_update)/sizeof(bgpnotify_minor_update[0]),
-       0,
-       0,
+       sizeof(bgpnotify_minor_holdtime)/sizeof(bgpnotify_minor_holdtime[0]),
+       sizeof(bgpnotify_minor_fsm)/sizeof(bgpnotify_minor_fsm[0]),
        sizeof(bgpnotify_minor_cease)/sizeof(bgpnotify_minor_cease[0]),
        sizeof(bgpnotify_minor_cap)/sizeof(bgpnotify_minor_cap[0]),
 };

-- 
Michal Mazurek

Reply via email to