Skip to content

containsActionCompletedCode returns incorrect result, if protocol or table name includes digits. #5

Description

@timmyventura-tmv

Hello!

If protocol name or table name includes digits that follow the pattern [089]\d{3}, for example:

ipv4 table in8724;
ipv6 table in8726;

protocol kernel kernel_in8724 {
    learn;
    ipv4 {
          table in8724;
          import none;
          export filter allow_only_bgp;
    };

    kernel table 872; 
}
protocol kernel kernel_in8726 {
    learn;
    ipv6 {
          table in8726;
          import none;
          export filter allow_only_bgp;
    };

    kernel table 872;
}

then the function containsActionCompletedCode may return incorrect result.
For example, if huge numbers of protocols are configured in bird and after invocation of command show protocols all(see bird_exporter case), the buffer may start with the string: 8726 up 2026-04-27 11:38:28 and the following readings of query's output is interrupted. The buffer example:

8726    up     2026-04-27 11:38:28
1006-  Channel ipv6
     State:          UP
     Table:          in8726
     Preference:     10
     Input filter:   REJECT
     Output filter:  allow_only_bgp
     Routes:         0 imported, 0 exported, 0 preferred
     Route change stats:     received   rejected   filtered    ignored   accepted
       Import updates:              0          0          0          0          0
       Import withdraws:            0          0        ---          0          0
       Export updates:              0          0          0        ---          0
       Export withdraws:            0        ---        ---        ---          0

1002-kernel_in8734 Kernel     in8734    up     2026-04-27 11:38:28
1006-  Channel ipv4
     State:          UP
     Table:          in8734
     Preference:     10
     Input filter:   REJECT
     Output filter:  allow_only_bgp
     Routes:         0 imported, 1 exported, 0 preferred
     Route change stats:     received   rejected   filtered    ignored   accepted
       Import updates:              0          0          0          0          0
       Import withdraws:            0          0        ---          0          0
       Export updates:             11          0          2        ---          9
       Export withdraws:            8        ---        ---        ---          8

Expected behavior:

The query readings shall not be interrupted if protocol or table name consists of the reply_codes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions