summaryrefslogtreecommitdiff
path: root/net/py-dpkt/patches/patch-aa
blob: 2d7a1f4a5b20c5fbd44c9fe1a0a470fd8d5ecbf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
$NetBSD: patch-aa,v 1.1.1.1 2010/03/11 11:31:19 pettai Exp $

# 'as' became a reserved keyword in newer python versions
#

--- dpkt/bgp.py.orig	2010-02-13 21:32:43.000000000 +0100
+++ dpkt/bgp.py	2010-02-13 21:33:17.000000000 +0100
@@ -140,7 +140,7 @@
     class Open(dpkt.Packet):
         __hdr__ = (
             ('v', 'B', 4),
-            ('as', 'H', 0),
+            ('AS', 'H', 0),
             ('holdtime', 'H', 0),
             ('identifier', 'I', 0),
             ('param_len', 'B', 0)
@@ -675,7 +675,7 @@
             self.failUnless(a.len == 12)
             self.failUnless(len(a.communities.list) == 3)
             c = a.communities.list[0]
-            self.failUnless(c.as == 65215)
+            self.failUnless(c.AS == 65215)
             self.failUnless(c.value == 1)
             r = b2.update.announced[0]
             self.failUnless(r.len == 22)
@@ -712,7 +712,7 @@
             b4 = BGP(self.bgp4)
             self.failUnless(b4.len == 45)
             self.failUnless(b4.type == OPEN)
-            self.failUnless(b4.open.as == 237)
+            self.failUnless(b4.open.AS == 237)
             self.failUnless(b4.open.param_len == 16)
             self.failUnless(len(b4.open.parameters) == 3)
             p = b4.open.parameters[0]