networkprotocols/tcpipv4v6prt/src/iface.cpp
changeset 14 b33c3d136b7e
parent 0 af10295192d8
child 53 7e41d162e158
equal deleted inserted replaced
1:a579325b79dd 14:b33c3d136b7e
    73 
    73 
    74 #include <in6_opt.h>
    74 #include <in6_opt.h>
    75 #include <in_sock.h>
    75 #include <in_sock.h>
    76 #include "inet6log.h"
    76 #include "inet6log.h"
    77 #include "iface.h"
    77 #include "iface.h"
    78 #include <in6_if.h>     // IPv6 driver API specifications
    78 #include <in_iface.h>     // IPv6 driver API specifications
    79 #include <icmp6_hdr.h>
    79 #include <icmp6_hdr.h>
    80 #include <in_chk.h>
    80 #include <in_chk.h>
    81 #include <ip6_hook.h>
    81 #include <ip6_hook.h>
    82 #include "in_flow.h"
    82 #include "in_flow.h"
    83 #include <timeout.h>
    83 #include <timeout.h>
  5536 TInt CIp6Interface::SetId(TIp6AddressInfo &aId, const TIp6Addr &aAddr, const TInt aPrefix, const TInt aAddressType)
  5536 TInt CIp6Interface::SetId(TIp6AddressInfo &aId, const TIp6Addr &aAddr, const TInt aPrefix, const TInt aAddressType)
  5537     {
  5537     {
  5538     // Should this also check whether address type is same?
  5538     // Should this also check whether address type is same?
  5539     // Changing just type does not work with this code!
  5539     // Changing just type does not work with this code!
  5540     // -- msa 24.10.2003
  5540     // -- msa 24.10.2003
  5541     if (aId.IsSet() && aPrefix == aId.iPrefix && aAddr.IsEqual(aId.iId))
       
  5542         return 0;       // Id is same as before, no change!
       
  5543     if (aPrefix < 0 || aPrefix > 128)
  5541     if (aPrefix < 0 || aPrefix > 128)
  5544         return 0;       // Invalid length, do nothing!
  5542         return 0;       // Invalid length, do nothing!
  5545     if (TIp46Addr::Cast(aAddr).IsMulticast())
  5543     if (TIp46Addr::Cast(aAddr).IsMulticast())
  5546         return 0;       // A multicast address cannot be my own.
  5544         return 0;       // A multicast address cannot be my own.
       
  5545     if (aId.IsSet() && aPrefix == aId.iPrefix && aAddr.IsEqual(aId.iId))
       
  5546         {
       
  5547 		// Id has not changed but expecting some change in any of 
       
  5548 		// the other interface fields. So raising a Interface change event
       
  5549 		// for the subscribers to keep themselves updated
       
  5550 		
       
  5551         // Send notification to the event service
       
  5552         NotifyInterfaceEvent(EventTypeModify);
       
  5553         return 1;
       
  5554         }
  5547 
  5555 
  5548     UpdateIdRoutes(aId, 0);     // Remove old route (if needed)
  5556     UpdateIdRoutes(aId, 0);     // Remove old route (if needed)
  5549     aId.iId = aAddr;
  5557     aId.iId = aAddr;
  5550     aId.iPrefix = (TUint8)aPrefix;
  5558     aId.iPrefix = (TUint8)aPrefix;
  5551     aId.SetInitial(NeedsND());
  5559     aId.SetInitial(NeedsND());