|
Bugzilla – Full Text Bug Listing |
| Summary: | "Attribute name=net.ipv4.tcp_sack does not exist for this object" | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Sam Jansen <sam.jansen> |
| Component: | internet | Assignee: | Mathieu Lacage <mathieu.lacage> |
| Status: | RESOLVED WORKSFORME | ||
| Severity: | normal | CC: | fw-ns3, ns-bugs, sam.jansen, tomh |
| Priority: | P3 | ||
| Version: | ns-3-dev | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: | proposed patch | ||
|
Description
Sam Jansen
2008-09-25 12:36:05 UTC
It might be a good idea to enable printk output during
the stack initialization phase; this will show if ns-3
queries nsc about the attribute list.
Currently, one needs to edit
src/internet-stack/nsc-tcp-l4-protocol.cc
And change this (in NscTcpL4Protocol::SetNode) from
m_softTimer.SetDelay (MilliSeconds (1000/hzval));
m_nscStack->init(hzval);
// This enables stack and NSC debug messages
// m_nscStack->set_diagnostic(1000);
to:
m_softTimer.SetDelay (MilliSeconds (1000/hzval));
m_nscStack->set_diagnostic(10);
m_nscStack->init(hzval);
I'll see about making this an attribute.
the problem is that there is a mismatch between client code in nsc-sysctl.cc and nsc code in sim_support.cc:
Here, we check the return value of sysctl_get and expect the return value to indicate the size of the value string. i.e., the expectation is that strlen (value) == return value.
if (m_stack->sysctl_get (buf, value, sizeof(value)) > 0)
{
tid.AddAttribute (buf, "Help text",
StringValue (value),
Create<NscStackStringAccessor> (buf),
MakeStringChecker ());
}
In the nsc code, on the other hand, from nsc_sysctl_util_get:
ret = nsc_linux_sysctl_map[i].convert_r(buf, buflen, value, len);
if (ret > 0)
return 0;
and convert_r is a pointer which goes in:
static size_t convert_inttostr(const void *integer, size_t sizeof_int, char *out, size_t out_len)
{
if (sizeof_int == sizeof(int)) {
const int *ptr = integer;
return snprintf(out, out_len, "%d", *ptr);
}
return 0;
}
So, it looks like this:
ret = nsc_linux_sysctl_map[i].convert_r(buf, buflen, value, len);
if (ret > 0)
return 0;
should be changed to:
ret = nsc_linux_sysctl_map[i].convert_r(buf, buflen, value, len);
if (ret > 0)
return ret;
in nsc/linux-2.6.26/nsc/sysctl.c and nsc/linux-2.6.18/nsc/sysctl.c
The above seems to fix this bug for me.
Created attachment 280 [details]
proposed patch
Mathieu, I've pushed your patch to NSC mercurial. Thank you for the investigation; you're absolutely correct in the error. What happened was I found a problem with length=0 returns, and in fixing that, I inadvertently changed what the return value meant and broke ns-3. However! The original bug was reported before my change -- that is the confusing thing here. The problem the user is reporting is not the same problem as what you have fixed. I think Florian can confirm this. Florian, you mentioned to me on IM that the usewr emailed you and said that they have things working without this error on another computer or similar? Can you confirm? If this is the case, will you please close this bug (as unreproducible)? I'll leave it to you as I do not know the details here. User has switched to a different box with a newer gcc release and the problem went away. If someone finds a box where this is is actually reproduceable this bug entry can be re-opened. |