Changeset 879:2ce525f01293

Show
Ignore:
Timestamp:
08/20/08 17:10:56 (5 months ago)
Author:
Phil <phil@secdev.org>
Message:

Avoid crash when Ether dst resolver is missing, and added 802.1q resolver.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • scapy/layers/l2.py

    r862 r879  
    2929 
    3030    def resolve(self, l2inst, l3inst): 
    31         return self.resolvers[l2inst.__class__,l3inst.__class__](l2inst,l3inst) 
     31        k = l2inst.__class__,l3inst.__class__ 
     32        if k in self.resolvers: 
     33            return self.resolvers[k](l2inst,l3inst) 
    3234 
    3335    def __repr__(self): 
     
    8082            if x is None: 
    8183                x = "ff:ff:ff:ff:ff:ff" 
    82                 warning("Mac address to reach destination not found") 
     84                warning("Mac address to reach destination not found. Using broadcast.") 
    8385        return MACField.i2h(self, pkt, x) 
    8486    def i2m(self, pkt, x): 
     
    222224 
    223225             
    224  
     226conf.neighbor.register_l3(Ether, Dot1Q, lambda l2,l3: conf.neighbor.resolve(l2,l3.payload)) 
    225227 
    226228class STP(Packet):