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
Fix a number of VPN SAFI related issues, add vrf flavor of vnc commands #75
Fix a number of VPN SAFI related issues, add vrf flavor of vnc commands #75
Conversation
To remove commands duplicated in bgp_mplsvpn/_encap Also until vpn/encap specific show pieces are merged into generic afi/safi show. Signed-off-by: Lou Berger <lberger@labn.net>
Signed-off-by: Lou Berger <lberger@labn.net>
…FRRouting#71) Signed-off-by: Lou Berger <lberger@labn.net>
Also minor show format cleanup Signed-off-by: Lou Berger <lberger@labn.net>
add add/clear vrf prefix Signed-off-by: Lou Berger <lberger@labn.net>
…iguated by RD Signed-off-by: Lou Berger <lberger@labn.net>
Continous Integration Result: FAILEDSee below for issues. This is a comment from an EXPERIMENTAL automated CI system. Get source and apply patch from patchwork: SuccessfulBuilding Stage: FailedFedora24 amd64 build: Successful OmniOS amd64 build: FailedMake failed for OmniOS amd64 build:
OmniOS amd64 build: Unknown Log <config.status> |
Signed-off-by: Lou Berger <lberger@labn.net>
Continous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-55/ This is a comment from an EXPERIMENTAL automated CI system. |
@@ -3317,7 +3317,7 @@ rfapiDeleteLocalPrefixesByRFD (struct rfapi_local_reg_delete_arg *cda, | |||
rfapiQprefix2Rprefix (pPrefix, &rprefix); | |||
} | |||
|
|||
while (noop--) /* to preserve old code structure */ | |||
while (loop--) /* to preserve old code structure */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get rid of loop/noop and use a do { ....} while (0); structure? So we know it's supposed to be run one time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure.
|
||
if (bgp_debug_update(peer, NULL, NULL, 0)) | ||
zlog_debug ("u%" PRIu64 ":s%" PRIu64 " %s send UPDATE w/ nexthop %s", | ||
zlog_debug ("u%" PRIu64 ":s%" PRIu64 " %s send UPDATE w/ nexthop %s%s", | ||
PAF_SUBGRP(paf)->update_group->id, PAF_SUBGRP(paf)->id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should fix this indentation too if we are modifying the indentation to be correct for the line below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
humm, I thought there was a bias against this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have two choices here, either make the + line line up with the PAF_SUBGRP.. line or move the PAF_SUBGRP... line line up with the correct spot for zlog_debug. Adding a code change where we now have two separate indentations breaks the rule of 'do what the code does around me' that we try to have. Of the two I would prefer fixing the indentation right. The point of not changing lines is that it makes it harder to merge. But since we are already changing the line above and line below the PAF_SUBGRP line it will kill any merges there. As such choose one indentation for the zlog_debug and use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well this is code written by your colleges -- and I didn't change any alignment -- I just added to the output. I really don't think changes should include gratuitous whit space changes. This said, I'll do whatever is needed to end this discussion;-) How do you want it formatted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lou -
You clearly changed the alignment for the function call to be different on different lines and arguing that you didn't is disingenuous. In what world is it acceptable coding style to intentionally put in mixed style in the middle of a function call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
huh, I'm responding to the lines quoted above. If you're referring to different lines -- my apologies. I'll go and look at the full patch set and try to understand what you might be referring to. (Alternatively, tell me the line numbers.) Either way, I'll make whatever white space changes...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bgp_updgrp_packet.c: 488-491
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats helpful -- I'll check it out.
Aren't these changes to the api directly what we are discussing in the RD/RT thread? |
yes. Basically accessing existing (VNC) function using new syntax. |
Signed-off-by: Lou Berger <lberger@labn.net>
Signed-off-by: Lou Berger <lberger@labn.net>
Continous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-57/ This is a comment from an EXPERIMENTAL automated CI system. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hello,
I approve the changes on the vrf-policy discussion.
Two questions:
- I did not see the code for configuring rt import | export command.
Maybe I misread. Is it present somewhere ? - About the code change, for continuation. I understand this is for stable/2.0. Does it mean I need to rebase all on stable/2.0, if I want to continue rd/rt development ?
if (rfg->rfp_cfg) | ||
XFREE (MTYPE_RFAPI_RFP_GROUP_CFG, rfg->rfp_cfg); | ||
listnode_delete (bgp->rfapi_cfg->l2_groups, rfg); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not better to remove from the list, before unchaining it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the member (rfg->rfp_cfg) is being freed before the node (rfg) is freed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
{ | ||
|
||
vty_out (vty, "!Error: Can't convert rd%s", VTY_NEWLINE); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it is for show running, this if condition should never occur
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair enough -- that said, I like handling unexpected error paths. Do you really think this needs to be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
VTY_NEWLINE); | ||
} | ||
vty_out (vty, " exit-vrf-policy%s", VTY_NEWLINE); | ||
vty_out (vty, "!%s", VTY_NEWLINE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vty_out (vty, " exit-vrf-policy%s", VTY_NEWLINE);
one single space character.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the alignment is right, here's sample output:
!
vrf-policy green
rd auto:nh:11
rt both 2002:99
exit-vrf-policy
!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe i am wrong, i am used to this. up to you if all bgp subnode commands are like that.
vrf-policy green
rd auto:ng:11
rt both 2002:99
exit-vrf-policy
@@ -2643,6 +2643,8 @@ bgp_packet_mpattr_start (struct stream *s, afi_t afi, safi_t safi, afi_t nh_afi, | |||
stream_putw (s, afi); | |||
stream_putc (s, (safi == SAFI_MPLS_VPN) ? SAFI_MPLS_LABELED_VPN : safi); | |||
|
|||
if (nh_afi == AFI_MAX) | |||
nh_afi = (attr->extra->mp_nexthop_len == 16 ? AFI_IP6 : AFI_IP); | |||
/* Nexthop */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mp_nexthop_len can be other than 16 for MPLS_VPN IPV6.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are correct!!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also see a related issue in bgp_route.c
(p->family == AF_INET6 || peer_cap_enhe(peer))) || \ | ||
(safi == SAFI_ENCAP && attr->extra->mp_nexthop_len == 16)) | ||
((safi == SAFI_ENCAP || safi != SAFI_MPLS_VPN) &&\ | ||
attr->extra->mp_nexthop_len == 16)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe a macro could detect if it is nexthop ipv6 or ipv4 by reusing defines used in code from bgp_info_nexthop_cmp() ?
BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL,
BGP_ATTR_NHLEN_IPV6_GLOBAL
BGP_ATTR_NHLEN_VPNV6_GLOBAL
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea of a macro. How about just testing if against IPV6_MAX_BYTELEN (< = IPv4)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!= 0 and < IPV6_MAX_BYTELEN
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in bgp_route.h
#define BGP_NEXTHOP_AFI_FROM_NHLEN(nhlen)
((nhlen) < IPV4_MAX_BYTELEN ? 0 :
((nhlen) < IPV6_MAX_BYTELEN ? AFI_IP : AFI_IP6))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one other question, it seems 1634b1b should be adapted too.
I'm tempted to NAK 57693ce as falling under "new feature". We can't keep piling stuff on stable/2.0... |
Much of this is bug fixes. The config/vty addition is of course not so is a valid comment, but it is new cli support for existing vnc function.... |
Non VRF changes are now part of #83 |
VRF part covered in #97 |
Some changes to try to resolve/understand CI failures on master
Issues:
bgpd: allow VPN next hop to be different AFI than NLRI next hop (Issue #71)
bgpd: fix RD stomping by update group code (Issue #71)
bgpd: partial revert of vpn/encap safi show changes (Issue #14)
To remove commands duplicated in bgp_mplsvpn/_encap
Also until vpn/encap specific show pieces are merged into
generic afi/safi show.
Fixes/cleanup
bgpd rfapi: fix issue where advertised prefixes were not being disambiguated
by RD
bgpd rfapi: use VN as nexthop for MPLS tunnels too
Also minor show format cleanup
bgpd rfapi: add NVE/VRF name to show vnc registrations
new commands (partail set from RD/RT discussion)
bgpd: add vrf-policy config using existing vnc code
add add/clear vrf prefix