Skip to content

Conversation

@lyubov-popova
Copy link

Change-Id: Iad717eab3f16a1c722d79f55bec0008bf0529e2c

MERAprojects/ops-build#21

Following BGP commands implemented in commit:
neighbor x.x.x.x local-as <1-4294967295>
no neighbor x.x.x.x local-as <1-4294967295>

@lyubov-popova lyubov-popova self-assigned this Mar 1, 2017
@lyubov-popova lyubov-popova changed the title Issue #21: Implementation of local-as command MERAprojects/ops-build#21: Implementation of local-as command Mar 1, 2017
if (!ovs_bgp_neighbor) {
ABORT_DB_TXN(txn, BGP_ERR_NEIGHBOR_IS_NOT_CONFIGURED);
}

Copy link

@kontorschikov kontorschikov Mar 1, 2017

Choose a reason for hiding this comment

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

Missing check for peer-group membership for "no neighbor local-as" command?
if(ovs_bgp_neighbor->bgp_peer_group) {
ABORT_DB_TXN(txn, BGP_ERR_INVALID_FOR_PEER_GROUP_MEMBER);}

Copy link
Author

Choose a reason for hiding this comment

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

yes, fixed

Copy link

@mfwlarionov mfwlarionov left a comment

Choose a reason for hiding this comment

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

Why commit two rather than one?

vtysh/bgp_vty.c Outdated
void
remove_parameters_invalid_for_ibgp_peer(const struct ovsrec_bgp_neighbor *ovs_bgp_neighbor)
{
if (ovs_bgp_neighbor->remove_private_as) {

Choose a reason for hiding this comment

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

I suggest instead of operation with a pointer used with a counter operation.
In this case "ovs_bgp_neighbor->remove_private_as" replace "ovs_bgp_neighbor->n_remove_private_as"

vtysh/bgp_vty.c Outdated
ovsrec_bgp_neighbor_set_remove_private_as(ovs_bgp_neighbor, NULL, 0);
}

if (ovs_bgp_neighbor->local_as) {

Choose a reason for hiding this comment

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

Similarly suggest instead of operation with a pointer used with a counter operation.,

ABORT_DB_TXN(txn, BGP_ERR_LOCAL_AS_ALLOWED_ONLY_FOR_EBGP);
}

if (local_as == asn) {

Choose a reason for hiding this comment

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

Suggest аdd analysis of the impossibility of assigning "local_as" values are equal "remote as" for neighbor. If the neighbor is a group that respectively need analysis for all members of the group.

Copy link
Author

Choose a reason for hiding this comment

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

Added below for peer-group (BGP_ERR_CANNOT_HAVE_LOCAL_AS_SAME_REMOTE_AS) and all neighbors

vtysh/bgp_vty.c Outdated
(int64_t *)&tim_val, ovs_bgp_peer_group->n_timers);
}

if (ovs_bgp_peer_group->local_as) {

Choose a reason for hiding this comment

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

Similarly suggest instead of operation with a pointer used with a counter operation

}
}

if (nbr_table->local_as) {

Choose a reason for hiding this comment

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

Similarly suggest instead of operation with a pointer used with a counter operation

Copy link
Member

Choose a reason for hiding this comment

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

Do you suggest to do it for all the cases in this function or just local-as?

To keep the common style we the proper way is to replace all such checks in this file(or at least in this function) or let it be as it is now. I see no major point to apply change that you've suggested.

Choose a reason for hiding this comment

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

Yes, I propose to maintain this style everywhere. In my opinion the number of records is more adequate criterion, than the value of the pointer.

@lyubov-popova lyubov-popova force-pushed the meraswitch/devel/issue_21 branch 2 times, most recently from 1527b69 to 411200e Compare March 6, 2017 14:08
@lyubov-popova
Copy link
Author

Hi!
Comments are applied and merged into 1 new commit 411200e:

  1. Use number of records instead of the value of the pointer - Fixed for local_as

  2. Add analysis of the impossibility of assigning "local_as" values are equal "remote as" for neighbor - Fixed for peer-group and neighbors in cli_neighbor_local_as_cmd_execute. Similar check added to cli_neighbor_set_peer_group_cmd_execute before setting of local_as for peer-group member. Need if remote-as is configured for peer-group member, not for peer-group.

  3. Added unset of local_as for peer-group member in cli_neighbor_set_peer_group_cmd_execute - this parameter is inherited from the peer-group (e.g., in Cisco).

  4. Added unset of local_as in cli_no_neighbor_set_peer_group_cmd_execute

@lyubov-popova lyubov-popova force-pushed the meraswitch/devel/issue_21 branch from 411200e to 0dd382f Compare March 9, 2017 09:56
@lyubov-popova
Copy link
Author

Hi!
Comments are applied in 0dd382f

@stroykov stroykov removed their request for review March 9, 2017 14:57
@lyubov-popova lyubov-popova force-pushed the meraswitch/devel/issue_21 branch from 0dd382f to e53cc58 Compare March 10, 2017 12:02
@lyubov-popova
Copy link
Author

Replaced local_as == *ovs_bgp_neighbor->remote_as to compare_neighbor_remote_as_with_asn(ovs_bgp_neighbor, local_as) in e53cc58

Change-Id: Id6a0f974276ee66bdd6251dab5e7f2055b39f4f3
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.

5 participants