|
|
| 84 |
MakeBooleanAccessor (&Ipv6L3Protocol::SetSendIcmpv6Redirect, |
84 |
MakeBooleanAccessor (&Ipv6L3Protocol::SetSendIcmpv6Redirect, |
| 85 |
&Ipv6L3Protocol::GetSendIcmpv6Redirect), |
85 |
&Ipv6L3Protocol::GetSendIcmpv6Redirect), |
| 86 |
MakeBooleanChecker ()) |
86 |
MakeBooleanChecker ()) |
|
|
87 |
.AddAttribute ("StrongEndSystemModel", |
| 88 |
"Reject packets for an address not configured on the interface they're coming from.", |
| 89 |
BooleanValue (true), |
| 90 |
MakeBooleanAccessor (&Ipv6L3Protocol::m_strongEndSystemModel), |
| 91 |
MakeBooleanChecker ()) |
| 87 |
.AddTraceSource ("Tx", |
92 |
.AddTraceSource ("Tx", |
| 88 |
"Send IPv6 packet to outgoing interface.", |
93 |
"Send IPv6 packet to outgoing interface.", |
| 89 |
MakeTraceSourceAccessor (&Ipv6L3Protocol::m_txTrace), |
94 |
MakeTraceSourceAccessor (&Ipv6L3Protocol::m_txTrace), |
|
|
| 1010 |
return; |
1015 |
return; |
| 1011 |
} |
1016 |
} |
| 1012 |
|
1017 |
|
| 1013 |
/// \todo Configurable option to enable \RFC{1222} Strong End System Model |
|
|
| 1014 |
// Right now, we will be permissive and allow a source to send us |
| 1015 |
// a packet to one of our other interface addresses; that is, the |
| 1016 |
// destination unicast address does not match one of the iif addresses, |
| 1017 |
// but we check our other interfaces. This could be an option |
| 1018 |
// (to remove the outer loop immediately below and just check iif). |
| 1019 |
for (uint32_t j = 0; j < GetNInterfaces (); j++) |
1018 |
for (uint32_t j = 0; j < GetNInterfaces (); j++) |
| 1020 |
{ |
1019 |
{ |
| 1021 |
for (uint32_t i = 0; i < GetNAddresses (j); i++) |
1020 |
for (uint32_t i = 0; i < GetNAddresses (j); i++) |
|
|
| 1024 |
Ipv6Address addr = iaddr.GetAddress (); |
1023 |
Ipv6Address addr = iaddr.GetAddress (); |
| 1025 |
if (addr.IsEqual (hdr.GetDestinationAddress ())) |
1024 |
if (addr.IsEqual (hdr.GetDestinationAddress ())) |
| 1026 |
{ |
1025 |
{ |
|
|
1026 |
bool rightInterface = false; |
| 1027 |
if (j == interface) |
1027 |
if (j == interface) |
| 1028 |
{ |
1028 |
{ |
| 1029 |
NS_LOG_LOGIC ("For me (destination " << addr << " match)"); |
1029 |
NS_LOG_LOGIC ("For me (destination " << addr << " match)"); |
|
|
1030 |
rightInterface = true; |
| 1030 |
} |
1031 |
} |
| 1031 |
else |
1032 |
else |
| 1032 |
{ |
1033 |
{ |
| 1033 |
NS_LOG_LOGIC ("For me (destination " << addr << " match) on another interface " << hdr.GetDestinationAddress ()); |
1034 |
NS_LOG_LOGIC ("For me (destination " << addr << " match) on another interface " << hdr.GetDestinationAddress ()); |
| 1034 |
} |
1035 |
} |
| 1035 |
LocalDeliver (packet, hdr, interface); |
1036 |
if (rightInterface || !m_strongEndSystemModel) |
|
|
1037 |
{ |
| 1038 |
LocalDeliver (packet, hdr, interface); |
| 1039 |
} |
| 1036 |
return; |
1040 |
return; |
| 1037 |
} |
1041 |
} |
| 1038 |
NS_LOG_LOGIC ("Address " << addr << " not a match"); |
1042 |
NS_LOG_LOGIC ("Address " << addr << " not a match"); |