|
Bugzilla – Full Text Bug Listing |
| Summary: | Ipv4::GetIfIndexByAddress is virtual and has an argument with a default value | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Mathieu Lacage <mathieu.lacage> |
| Component: | network | Assignee: | ns-bugs <ns-bugs> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | pre-release | ||
| Hardware: | All | ||
| OS: | All | ||
|
Description
Mathieu Lacage
2008-01-07 05:12:21 UTC
I was assuming that subclasses would not be inclined to change this default value. However, there is really no strong need for the mask parameter anyway, if we assume that this function strictly does what it says in the function name. I'll post a patch later. Hmm.. how about just making this non-virtual?
diff -r 4ba90810ae30 src/node/ipv4.h
--- a/src/node/ipv4.h Tue Jan 08 14:06:49 2008 +0000
+++ b/src/node/ipv4.h Tue Jan 08 07:04:17 2008 -0800
@@ -451,13 +451,15 @@ public:
/**
* \brief Convenience function to return the ifIndex corresponding
- * to the Ipv4Address provided
+ * to the Ipv4Address provided. If an Ipv4Mask is provided also,
+ * then the address is masked, which allows one to determine the
+ * interface corresponding to a network prefix.
*
* \param addr Ipv4Address
* \param mask corresponding Ipv4Mask
* \returns ifIndex corresponding to a/amask
*/
- virtual uint32_t GetIfIndexByAddress (Ipv4Address addr,
+ uint32_t GetIfIndexByAddress (Ipv4Address addr,
Ipv4Mask mask = Ipv4Mask("255.255.255.255"));
};
(In reply to comment #2) > Hmm.. how about just making this non-virtual? +1 I suspect that the final patch will include the associated change to ipv4.cc and ipv4-impl.h and ipv4-impl.cc Mathieu fixed by changeset 2214 (no need to touch other functions) |