Optional encapsulation format in Ethernet II and SNAP#341
Open
rogeroger-yu wants to merge 1 commit into
Open
Conversation
86c9f60 to
7431cc8
Compare
The encapsulation of LLDP protocal can be switched between Ethernet and snap. Issue: 340 Change-Id: Ia010ddb72e959be9312f0de6eb2fe4a0586a8d0a
7431cc8 to
8f6ea96
Compare
vincentbernat
requested changes
Oct 10, 2019
vincentbernat
left a comment
Member
There was a problem hiding this comment.
This looks OK for me. It is missing tests, but I can add them later.
| } else if (set->local_lldp_snap == 0) { | ||
| log_debug("rpc", "Disable SNAP encapsulation format"); | ||
| port->p_lldp_snap = 0; | ||
| } |
Member
There was a problem hiding this comment.
I think any port-related command will disable SNAP encapsulation. You should use 1 (true), 2 (false) instead.
| lldpctl_k_port_id_subtype, /**< `(IS)` The subtype ID of this port. */ | ||
| lldpctl_k_port_id, /**< `(BS,WO)` The ID of this port. */ | ||
| lldpctl_k_port_descr, /**< `(S,WO)` The description of this port. */ | ||
| lldpctl_k_port_lldp_snap_enabled, /**< `(I,WO)` The lldp snap encapsulation enable status of this port. */ |
Member
There was a problem hiding this comment.
Do not put a new value in the middle of existing values. It breaks the ABI (old clients cannot talk to new lldpd). Add it at the end of the section.
| memcpy(packet + 2*ETHER_ADDR_LEN, &type, bytes)) | ||
| #define POKE_REAL_LENGTH_REPLACE(value, bytes) \ | ||
| POKE_REAL_LENGTH(value, types.f_uint16, bytes, htons) | ||
|
|
Member
There was a problem hiding this comment.
These macros are used only in one place. I think this is better to put the code directly instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The encapsulation of LLDP protocal can be switched
between Ethernet II and SNAP.
Issue: 340
Change-Id: Ia010ddb72e959be9312f0de6eb2fe4a0586a8d0a