View | Details | Raw Unified | Return to bug 2233
Collapse All | Expand All

(-)a/src/internet/model/ipv6-l3-protocol.cc (-7 / +11 lines)
 Lines 84-89    Link Here 
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),
 Lines 1010-1021    Link Here 
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++)
 Lines 1024-1038    Link Here 
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");
(-)a/src/internet/model/ipv6-l3-protocol.h (+5 lines)
 Lines 695-700    Link Here 
695
  uint8_t m_defaultTclass;
695
  uint8_t m_defaultTclass;
696
696
697
  /**
697
  /**
698
   * \brief Rejects packets directed to an interface with wrong address (\RFC{1222}).
699
   */
700
  bool m_strongEndSystemModel;
701
702
  /**
698
   * \brief Routing protocol.
703
   * \brief Routing protocol.
699
   */
704
   */
700
  Ptr<Ipv6RoutingProtocol> m_routingProtocol;
705
  Ptr<Ipv6RoutingProtocol> m_routingProtocol;

Return to bug 2233