Repository: secdev/scapy

Issue:
Syntax Error when importing from command()
I sniffed a packet and used packet.command():
```
"RadioTap(len=33, present=2684895274, version=0, notdecoded=b' \\x08\\x00\\xa0 \\x08\\x00\\x00\\x10\\x00\\x9e\\t\\x80\\x04\\xb7\\x00\\x00\\x007\\x00\\x07\\xb7\\x00\\xb7\\x01', pad=0)/Dot11(addr3='06:18:0a:f2:1e:10', proto=0, ID=11264, FCfield=1, addr1='06:18:0a:f2:1e:10', SC=4736, addr2='ec:55:f9:74:b2:22', type=2, addr4=None, subtype=12)/Dot11QoS(TID=0, Ack Policy=0, TXOP=0, EOSP=0, Reserved=0)/LLC(dsap=160, ctrl=136, ssap=134)/Raw(load=b'&')"
```

Then I try to re-import the packet from the string using `eval(packet.command())` and I get the following:

```
In [130]: exec(sc.command())
Traceback (most recent call last):

  File "/home/zachary/programming/replay/env/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2910, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)

  File "<ipython-input-130-e957189c5242>", line 1, in <module>
    exec(sc.command())

  File "<string>", line 1
    RadioTap(len=33, present=2684895274, version=0, notdecoded=b' \x08\x00\xa0 \x08\x00\x00\x10\x00\x9e\t\x80\x04\xb7\x00\x00\x007\x00\x07\xb7\x00\xb7\x01', pad=0)/Dot11(addr3='06:18:0a:f2:1e:10', proto=0, ID=11264, FCfield=1, addr1='06:18:0a:f2:1e:10', SC=4736, addr2='ec:55:f9:74:b2:22', type=2, addr4=None, subtype=12)/Dot11QoS(TID=0, Ack Policy=0, TXOP=0, EOSP=0, Reserved=0)/LLC(dsap=160, ctrl=136, ssap=134)/Raw(load=b'&')
                                                                                                                                                                                                                                                                                                                                                           ^
SyntaxError: invalid syntax
```

It seems to not like that we are trying to do `Ack Policy=0` because the field has a space. 

A potential fix for this would be renaming the field from `Ack Policy` to something like `Ack_Policy`

The line causing the bug can be found [On line 183](https://github.com/secdev/scapy/blob/master/scapy/layers/dot11.py)

---
Python: 3.5.2
Scapy: 89a077139b5328f2ba165a305602b65930418686


Discussion:
Another note: 
`eval(pkt.command().replace("Ack Policy=0, ", ""))` will work for that packet.

Resolving patch:
diff --git a/scapy/layers/dot11.py b/scapy/layers/dot11.py
--- a/scapy/layers/dot11.py
+++ b/scapy/layers/dot11.py
@@ -180,7 +180,7 @@ def unwep(self, key=None, warn=1):
 class Dot11QoS(Packet):
     name = "802.11 QoS"
     fields_desc = [ BitField("Reserved",None,1),
-                    BitField("Ack Policy",None,2),
+                    BitField("Ack_Policy", None, 2),
                     BitField("EOSP",None,1),
                     BitField("TID",None,4),
                     ByteField("TXOP",None) ]


Test patch:
diff --git a/test/regression.uts b/test/regression.uts
--- a/test/regression.uts
+++ b/test/regression.uts
@@ -9466,8 +9466,11 @@ Dot11 in p and p.addr3 == "00:00:00:00:00:00"
 p.mysummary() == '802.11 Management 0 00:00:00:00:00:00 > 00:00:00:00:00:00'
 
 = Dot11QoS - build
+s = raw(Dot11()/Dot11QoS(Ack_Policy=1))
+assert s == b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x00'
+
 s = raw(Dot11(type=2, subtype=8)/Dot11QoS(TID=4))
-s == b'\x88\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00'
+assert s == b'\x88\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00'
 
 = Dot11 - binary in SSID
 pkt = Dot11() / Dot11Beacon() / Dot11Elt(ID=0, info=b"".join(chb(i) for i in range(32)))