Skip to content
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

issue in ccnl_mkSimpleContent #207

Open
mfrey opened this issue Mar 1, 2018 · 6 comments
Open

issue in ccnl_mkSimpleContent #207

mfrey opened this issue Mar 1, 2018 · 6 comments
Assignees
Labels

Comments

@mfrey
Copy link
Collaborator

mfrey commented Mar 1, 2018

Hi,

I've encountered an issue while using ccnl_mkContentObject. Basically, the pointer to the content (returned via the function) does not match the content I've passed to the function. I've started to narrow it down and basically there seems to be something wrong with

315     c_p->content = c_p->buf->data + dataoffset;

Unfortunately, copy/paste in my VM setup does not work, but I basically provided my own local producer function which in turn calls ccnl_mkSimpleContent. The following screenshot depicts an interest /foo/bar which triggers the call of my local producer which tries to create content. The content is set to "RIOT!" (meaning no matter which name you pass via an interest, it will always create a corresponding NDO containing a "RIOT!" string).

image

What you notice is that the offset is 25 while the actual content is at offset 18. Speaking again about the listing above, the data in c_p->content is not pointing to actual data I've passed to ccnl_mkSimpleContent.

First, am I missing something? Second, can somebody confirm this behaviour?

TIA

@mfrey
Copy link
Collaborator Author

mfrey commented Mar 1, 2018

I've uploaded the code for this example over here.

@OlegHahm
Copy link
Collaborator

OlegHahm commented Mar 4, 2018

In order to compile your example I had to apply some changes: https://gist.github.com/OlegHahm/5c6034994e324f6c2769c00fc6802f7a and build with WERROR=0.

@OlegHahm
Copy link
Collaborator

OlegHahm commented Mar 4, 2018

Since there seems to be no documentation on ccnl_mkSimpleContent() it's hard to tell what the parameter payoffset is supposed to contain. However, it seems that it is set to the offset within the ccnl_buf_s struct, not the actual data buffer (buf->data).

So, yes, I can confirm the behavior. Yes, it is confusing. No, I have no idea what was the intentions (if any) behind that.

@blacksheeep
Copy link
Contributor

I can also confirm the behavior, but I have no idea, why it is like it is.
Christian implemented that.

@mfrey
Copy link
Collaborator Author

mfrey commented Mar 7, 2018

So we can agree that It is pointing to the wrong position in the buffer and make it a bug?

@blacksheeep
Copy link
Contributor

Yes, I think so

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants