Changeset 879:2ce525f01293
- 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
| r862 |
r879 |
|
| 29 | 29 | |
|---|
| 30 | 30 | 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) |
|---|
| 32 | 34 | |
|---|
| 33 | 35 | def __repr__(self): |
|---|
| … | … | |
| 80 | 82 | if x is None: |
|---|
| 81 | 83 | 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.") |
|---|
| 83 | 85 | return MACField.i2h(self, pkt, x) |
|---|
| 84 | 86 | def i2m(self, pkt, x): |
|---|
| … | … | |
| 222 | 224 | |
|---|
| 223 | 225 | |
|---|
| 224 | | |
|---|
| | 226 | conf.neighbor.register_l3(Ether, Dot1Q, lambda l2,l3: conf.neighbor.resolve(l2,l3.payload)) |
|---|
| 225 | 227 | |
|---|
| 226 | 228 | class STP(Packet): |
|---|