Skip to content

lib,ospfd: support table-direct in OSPFv2 #19316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rzalamena
Copy link
Member

This PR does two things:

  1. Fixes the generation of the redistribute methods string to not include table and table-direct automatically. These two redistribute methods require an argument which is the table ID so they can not be mixed with other redistribution types.

    Example of broken command:

     DEFUN (ospf_redistribute_source,                                                                                                                                                             
          ospf_redistribute_source_cmd,                                                                                                                                                         
          "redistribute " FRR_REDIST_STR_OSPFD " [{metric (0-16777214)|metric-type (1-2)|route-map RMAP_NAME}]",                                                                                
          REDIST_STR                                                                                                                                                                            
          FRR_REDIST_HELP_STR_OSPFD                                                                                                                                                             
          "Metric for redistributed routes\n"                                                                                                                                                   
          "OSPF default metric\n"                                                                                                                                                               
          "OSPF exterior metric type for redistributed routes\n"                                                                                                                                
          "Set OSPF External Type 1/2 metrics\n"                                                                                                                                                
          "Route map reference\n"                                                                                                                                                               
          "Pointer to route-map entries\n")
    
    // Where:
    #define FRR_REDIST_STR_OSPFD \                                                                                                                                                                 
      "<kernel|connected|local|static|rip|isis|bgp|eigrp|nhrp|table|vnc|babel|sharp|openfabric|table-direct>"

    (the command is broken because redistribute table or redistribute table-direct won't work as is)

  2. Add support for table-direct in OSPFv2 by reusing the DEFUN of redistribute table (both take the same integer argument with the same limits).

Those two redistribution methods require an argument to select the table
to draw the routes from, so they will need their own command to catch
this argument.

Signed-off-by: Rafael Zalamena <[email protected]>
Add the 'table-direct' option to the redistribute command in OSPF.

Signed-off-by: Rafael Zalamena <[email protected]>
The command `no redistribute table-direct` is no longer available
because it was wrongly generated by `route_types.txt`. We can get it
back if someone extends the existing DEFUN/DEFPY for it.

Signed-off-by: Rafael Zalamena <[email protected]>
@frrbot frrbot bot added the bugfix label Jul 31, 2025
@riw777
Copy link
Member

riw777 commented Aug 5, 2025

Can you give before and after examples of redistribution? Sorry, just having a problem visualizing what this is doing ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants