-
Notifications
You must be signed in to change notification settings - Fork 193
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
Switch stat description does not conform to the specification #14
Comments
Well, I am more concern about sending extra bytes out of the switch. In my switch msg->mfr_desc contains hardly 20bytes of data but OFL sending 235 extra bytes back to the controller. |
The specification requires the switch to send out 256 bytes for the description (padded if string is shorter). This code does that. If you want the specification to be changed, you should file a ticket to ONF/ExtWG about that. Also, the switch features description is sent out only once per OpenFlow session. Saving 235 bytes per session is pointless I would say. |
You are right, saving extra bytes is pointless but sending extra information (may be a garbage ) may contain something that controller/admin is not suppose to see. Thanks. |
OK, now I understand what you meant in the previous comment. So if the padding is implemented, this concern is fixed as well. |
One more thing, I have only 20bytes of mfr description and so I SHOULD malloc only 20bytes in "msg->mfr_desc". But when OFL copy "msg->mfr_desc" in "stats->mfr_desc", it goes ahead and copy beyond 20bytes. Now if OFL also copy only 20bytes(till finds '\0') then I need not to malloc whole 256byes for mfr_desc. Though again keeping 1056 bytes total (4*256 + 32 for serial_num) for structure ofp_desc_stats is not a big deal. |
If anyone issues a pull request for this issue we are happy to accept it Thx, On Sat, Feb 16, 2013 at 2:51 PM, Arunkjdhsfkhsdfhjsdf <
Christian Esteve Rothenberg, Ph.D. |
Fixed. |
State statistic message + OFPGT_RANDOM removed
Hi All,
I have a question regarding sending back total DESC_STR_LEN (256) bytes for mfr_desc and rest of the switch description data.
Why is pointer "stats->mfr_desc" (and rest in the structure) in function ofl_msg_pack_stats_reply_desc( ) in file ofl-messages-pack.c not initialized with 0 and then why it doesn't copy from msg->mfr_desc until it receives '\0' instead of copying whole DESC_STR_LEN bytes?
Thanks,
Arun
Hi Arun,
You are right, this does not conform to the specification, as that requires those strings to be padded with zeroes.
It should cause no harm, as the fields will contain a zero delimited string (although it might freak out some memory managers :-).
Kind Regards,
Zoltan.
The text was updated successfully, but these errors were encountered: