-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Eigrp #11301 - Configuration failed error type: validation #14765
base: master
Are you sure you want to change the base?
Eigrp #11301 - Configuration failed error type: validation #14765
Conversation
b15c391
to
7010f1f
Compare
Not sure if I need to fix the CI warnings, it is not dangerous to ignore identifier names for function declarations in the header. Unless maintainers would like me to handle this. |
The rule is that you don't have to fix something you don't touch but if you add new code it must conform to our standard. The tool is telling you about the problem |
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.
Documentation and the tests are missing yet.
@@ -91,7 +85,7 @@ struct eigrp_interface *eigrp_if_new(struct eigrp *eigrp, struct interface *ifp, | |||
ei->curr_bandwidth = ifp->bandwidth; | |||
ei->curr_mtu = ifp->mtu; | |||
|
|||
return ei; | |||
return 0; |
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 this is just returning, we might then use a void() at all?
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.
It is a hook definition; the declaration is expected to return int. The same goes for interface deletion.
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.
So, the pattern is clear.
rg> ^int.*eigrp_if_ < 7/7 (0)
eigrp_interface.c | 51 | int eigrp_if_new_hook(struct interface *ifp)
eigrp_interface.c | 91 | int eigrp_if_delete_hook(struct interface *ifp)
eigrp_interface.c | 111 | static int eigrp_ifp_create(struct interface *ifp)
eigrp_interface.c | 126 | static int eigrp_ifp_up(struct interface *ifp)
eigrp_interface.c | 167 | static int eigrp_ifp_down(struct interface *ifp)
eigrp_interface.c | 179 | static int eigrp_ifp_destroy(struct interface *ifp)
# returns a real 0/1 value, but no one handles
eigrp_interface.c | 324 | int eigrp_if_down(struct eigrp_interface *ei)
eigrp_interface.c | 231 | int eigrp_if_up(struct eigrp_interface *ei)
You have a point - many return 0, so we can change it to void if you wish
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.
From the hook documentation:
* The return value is always "int" for now; hook_call will sum up the
* return values from each registered user. Default is 0.
*
* There are no pre-defined semantics for the value, in most cases it is
* ignored. For success/failure indication, 0 should be success, and
* handlers should make sure to only return 0 or 1 (not -1 or other values).```
Leave a return of 0 on success
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.
looks good ... waiting on @ton31337 's comments to be resolved
7010f1f
to
9c4e157
Compare
Regarding missing documentation - it is already present.
I have fixed the CI warnings and will check if somebody from my team can assist with the test case. |
not certain we need a topo test here? |
@volodymyrhuti if we can get the invalid interface bits fixed, we can merge this, I think ... |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
1 similar comment
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Commit 0eb4168 ("eigrp: T2472: improve code for later tests") added a basic smoketest for EIGRP, which is also run by the CI hence not having a +x bit at all. This just deletes the basic smoketest testing for ASN and EIGRP router-id. We can revert it once it's fixed in FRR upstream. FRRouting/frr#14765
Instatiate interface structure once demon is started. Otherwise it is not possible to set parameters such as bandwidth untill a `network` configuration was applied. Fixes: FRRouting#11301 Signed-off-by: Volodymyr Huti <[email protected]>
Maintain a vector of mappings [if_name -> if_passive]. Otherwise, if topo is not already convereged, configuration does not apply, since iface is missing from the iface list. Fixes: FRRouting#11301 Signed-off-by: Volodymyr Huti <[email protected]>
9c4e157
to
d92757c
Compare
Is anyone still working on this? |
@frrbot autoclose in 1 month |
@riw777 sorry for not following up on this one. I believe it is still relevant and applicable |
This issue will no longer be automatically closed. |
This PR is stale because it has been open 180 days with no activity. Comment or remove the |
d15f762
to
d92757c
Compare
So, I fixed the index issue and returned 0 if no interface was configured.
I'm going to run and verify that everything is ok, as I haven't touched this for a long time ...
Would someone be able to give this another look? I would much appreciate it, thanks |
Looking at the new tickets #18239, this could be a problem since most of the logic was taken from the |
I believe the test in eigrpd_instance_passive_interface_create in the validation part is just... wrong. The whole point of the validation stage is to check to see if anything would prevent a interface from being passive( ie some other config that would prevent it ) not that the ei has been created for the interface or not. Changing the validation part would of course necessitate changing the APPLY part as well, in that the ei should be created there if it does not exist.. This of course brings out another problem with the eigrp implementation as a whole confabulates the idea of a eigrp_interface with the associated addresses that are interesting to eigrp. There needs to be another level of abstraction here to handle that. That would entail reaching deep into the eigrp code to fix... Which is why I haven't done it yet. The approach that should be taken is that the network statement should create a series of eigrp_connected structures ( similiar in nature how the rest of FRR has the ifp and the ifp->connected structures ). Then when that is done appropriately any configuration that mentions a interface would just create a ei. When a network statement is issued the ifp's in the system would be iterated over and a series of eigrp_interface_addresses would be created. As it stands If I were working on this issue, I would first get the ei data structure split out from the idea of a prefix and create the list of eigrp_connected structures that hang off the ei ). Then the rest of eigrp could be fixed to use this. Then fixing the UI would be very easy to do. |
Sure, @donaldsharp. Now that things are clear, I will invest some time into investigating how complicated that would be. |
For more details, please look at: #11301 (comment)
Additional context: https://vyos.dev/T5737