-
Notifications
You must be signed in to change notification settings - Fork 208
PD Interface Adjust / LLPD name Of station mode #319
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
Conversation
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.
Great!
I think we should modify src/common/pf_snmp.c
:
void pf_snmp_get_system_description (
pnet_t * net,
pf_snmp_system_description_t * description)
{
(void)pf_lldp_get_system_description (net, description->string, sizeof (description->string));
}
b2768cd
to
0989fe3
Compare
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.
Great!
Just a few minor comments (I tried to make it copy-paste friendly)
0989fe3
to
156dbdc
Compare
Some of the suggested updates did not compile. I guess I never saved before local build and test. |
156dbdc
to
aabaaa2
Compare
85c3fdf
to
2874382
Compare
Rebased on current to resolve conflicts |
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.
Reviewed changes for LLDP, pf_port and header files, but not pf_pdport and pf_block_*.
src/pf_types.h
Outdated
|
||
/** | ||
* LLDP Port Name | ||
* In standard name of device mode this is first part of Port 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.
* In standard name of device mode this is first part of Port ID | |
* In standard mode this is first part of Port 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.
name-of-device mode
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 will go with name-of-device mode so it is made clear which mode we are referring to
src/common/pf_lldp.c
Outdated
|
||
if (port_id.is_valid) | ||
{ | ||
for (i = 0; i < port_id.len && port_id.string[i] != '\0'; i++) |
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.
Perhaps use strchr() instead?
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 tried but the implementation got a bit messy and I will stick with current version.
I added an additional check of the i-index so that we don't write outside portname if port_id is not correctly formatted. Please check that out.
Done
2874382
to
6ab4654
Compare
if (port_id.is_valid) | ||
{ | ||
for (i = 0; (i < port_id.len) && (port_id.string[i] != '\0') && | ||
(i < (sizeof (p_port_name->string) - 1)); |
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.
Why was the condition i < (sizeof (p_port_name->string) - 1
introduced?
Given that i < port_id.len
, this should always be true
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.
port_id.string is 256 characters. I think I risk writing outside port_name->string if the port_id string is not formatted as it should be.
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.
Sorry, I misread it as sizeof (port_id->string)
instead of sizeof (p_port_name->string)
.
- Handle lldp name of station mode - Default name of station mode set to standard - In lldp replace zero-len station name with mac - Update tests
6ab4654
to
3c470d6
Compare
Included in #318 which is now merged. |
Add PD Interface Adjust