Skip to content
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

More nh groups #1863

Merged
merged 3 commits into from
Mar 14, 2018
Merged

More nh groups #1863

merged 3 commits into from
Mar 14, 2018

Conversation

donaldsharp
Copy link
Member

Some more nexthop_group work

@LabN-CI
Copy link
Collaborator

LabN-CI commented Mar 10, 2018

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/1863 9bda875
Date 03/10/2018
Start 16:30:13
Finish 16:52:59
Run-Time 22:46
Total 1813
Pass 1813
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2018-03-10-16:30:13.txt
Log autoscript-2018-03-10-16:30:57.log.bz2

For details, please contact louberger

@donaldsharp donaldsharp force-pushed the more_nh_groups branch 2 times, most recently from 682c2c2 to 6e3ad5b Compare March 11, 2018 12:05
Copy link
Member

@qlyoung qlyoung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

lib/.gitignore Outdated
@@ -25,3 +25,4 @@ grammar_sandbox
clippy
defun_lex.c
plist_clippy.c
nexthop_group_clippy.c
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove this, it's covered in the root gitignore in master now.

Copy link
Member

@rwestphal rwestphal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, a few comments inline.

"If the nexthop is in a different vrf tell us\n"
"The nexthop-vrf Name\n")
{
struct nexthop_group_cmd *nhgc = VTY_GET_CONTEXT(nexthop_group_cmd);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to use VTY_DECLVAR_CONTEXT to provide protection against someone removing the nexthop-group in another session.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

nhop.ifindex = ifname2ifindex(intf, vrf->vrf_id);
if (nhop.ifindex == IFINDEX_INTERNAL) {
vty_out(vty,
"Specified Intf %s does not exist in vrf: %s\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better if we allow the users to configure nexthops pointing to non-existing interfaces/VRFs? #1819 comes to mind.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that this needs to be done. Can I open an issue to track this and allow this commit to go in?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I don't think this should block this PR.

break;
}

if (nh->vrf_id) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe if (nh->vrf_id != VRF_DEFAULT) {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed this in the 3rd commit since I didn't want to have to edit the 1st and remake it, if you are looking for where I did thist

nhgc = nhgc_find(name);
if (!nhgc) {
nhgc = XCALLOC(MTYPE_TMP, sizeof(*nhgc));
strcpy(nhgc->name, name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is dangerous, please use strlcpy() instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Add a nexthop-group cli:

nexthop-group NAME
  nexthop A
  nexthop B
  nexthop C
!

This will allow interested parties to hook into the cli for
nexthops.  Users can add callback functions for add/delete
of a nexthop group as well as add/delete of each individual
nexthop.

Future work( PBR and static routes ) will take advantage
of this.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Expose to the world the nhgc_find command so that
interested parties can find a stored nexthop group.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Add code to allow nexthops to be written by people who are
interested in writing their own nexthop line.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Copy link
Member

@pguibert6WIND pguibert6WIND left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
however, I would like to put in perspective flowspec.
In the nexthop-group, I would like to add some more items:

  • mark a packet ( DSCP)
  • add traffic control on a defined rate)

the modification does not need to be done now.
but I want to ask:

  • is the nexthop group name ok to host something else than nexthop IPs or interfaces ?

this will permit to reach

@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-2880/

This is a comment from an EXPERIMENTAL automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

@LabN-CI
Copy link
Collaborator

LabN-CI commented Mar 14, 2018

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/1863 1b7bce0
Date 03/14/2018
Start 10:03:35
Finish 10:26:55
Run-Time 23:20
Total 1813
Pass 1813
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2018-03-14-10:03:35.txt
Log autoscript-2018-03-14-10:04:25.log.bz2

For details, please contact louberger

@FRRouting FRRouting deleted a comment from NetDEF-CI Mar 14, 2018
@FRRouting FRRouting deleted a comment from NetDEF-CI Mar 14, 2018
@FRRouting FRRouting deleted a comment from NetDEF-CI Mar 14, 2018
@FRRouting FRRouting deleted a comment from NetDEF-CI Mar 14, 2018
@donaldsharp
Copy link
Member Author

@rwestphal @pguibert6WIND is there anything else I need to do here? For this review?

@pguibert6WIND pguibert6WIND merged commit 2f9fca6 into FRRouting:master Mar 14, 2018
@donaldsharp donaldsharp deleted the more_nh_groups branch March 24, 2018 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants