Commit d18f0777c6 for frr

commit d18f0777c634c82863d4fbca5f52a45718846313
Author: Enke Chen <enchen@paloaltonetworks.com>
Date:   Tue Oct 20 14:34:26 2026 -0700

    doc: clarify BGP default-originate behavior

    Clarify and document the existing behavior of the neighbor default-originate
    command.  The behavior described here is already in the implementation: when
    default-originate is configured, subgroup_announce_check() skips the
    default prefix (0.0.0.0/0 or ::/0), so the advertisement of the default
    route is governed entirely by the default-originate configuration.

    The documentation now explains:
    - Default behavior without the command
    - How default-originate governs the default route advertisement
    - The two modes: Unconditional and Conditional

    Also define "synthesized default route" as the default route generated
    by the default-originate feature itself.

    Document the new "bgp default-originate set-only-unconditional"
    command which controls backward compatibility for set-only route-maps
    with empty BGP tables. By default, the old behavior is preserved
    (requiring at least one table route). The new behavior can be enabled
    with this command, and will become the default in a future release.

    Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>

diff --git a/doc/user/bgp.rst b/doc/user/bgp.rst
index 33d0adf204..f38b5ffb56 100644
--- a/doc/user/bgp.rst
+++ b/doc/user/bgp.rst
@@ -2130,14 +2130,28 @@ Configuring Peers

 .. clicmd:: neighbor PEER default-originate [route-map WORD]

-   *bgpd*'s default is to not announce the default route (0.0.0.0/0) even if it
-   is in routing table. When you want to announce default routes to the peer,
-   use this command.
+   Without this command, the default route (0.0.0.0/0 or ::/0) is treated the
+   same as any other route: it is advertised to the peer only if it is present
+   in the BGP table and passes the normal outbound policy.

-   If ``route-map`` keyword is specified, then the default route will be
-   originated only if route-map conditions are met. For example, announce
-   the default route only if ``10.10.10.10/32`` route exists and set an
-   arbitrary community for a default route.
+   When ``default-originate`` is configured, the advertisement of the default
+   route to that peer is governed entirely by this configuration, irrespective
+   of whether a default route exists in the BGP table. The synthesized default
+   route (i.e., the default route generated by the ``default-originate`` feature
+   itself) takes precedence: an existing 0.0.0.0/0 in the BGP table is never
+   advertised to the peer as a separate route.
+
+   There are two modes of operation:
+
+   **Unconditional** (no ``route-map``, or a ``route-map`` with only ``set``
+   clauses and no ``match`` clauses): the default route is always originated
+   to the peer. Any ``set`` clauses in the route-map are applied to set the
+   attributes of the advertised default route.
+
+   **Conditional** (a ``route-map`` with at least one ``match`` clause): the
+   default route is originated only if the match conditions are satisfied.
+   For example, announce the default route only if ``10.10.10.10/32`` route
+   exists and set an arbitrary community for a default route.

    .. code-block:: frr

@@ -2152,6 +2166,29 @@ Configuring Peers
        set community 123:123
       !

+   See also :clicmd:`bgp default-originate set-only-unconditional` for
+   backward compatibility options when using set-only route-maps with an
+   empty BGP table.
+
+.. clicmd:: bgp default-originate set-only-unconditional
+
+   This command controls the behavior of set-only route-maps (route-maps with
+   only ``set`` clauses and no ``match`` clauses) when the BGP table is empty.
+
+   By default (without this command), a set-only route-map still requires at
+   least one route to exist in the BGP table before originating the default
+   route. This preserves backward compatibility with previous FRR behavior
+   where the route-map condition check would iterate over the table, and an
+   empty table would result in no match.
+
+   When this command is configured, set-only route-maps will originate the
+   default route unconditionally, even if the BGP table is empty. This is the
+   intended behavior for set-only route-maps, as they have no match conditions
+   that could fail.
+
+   This command is scheduled to become the default behavior in a future FRR
+   release, at which point the command will be deprecated.
+
 .. clicmd:: neighbor PEER port PORT

 .. clicmd:: neighbor PEER password PASSWORD