We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a0b15a commit 689fc20Copy full SHA for 689fc20
demos/copilot/src/python/switchRawSocket.py
@@ -14,18 +14,16 @@
14
15
Interface = 'lo'
16
17
-DestMac = b'\x00\x00\x00\x00\x00\x00'
18
-SrcMac = b'\x00\x00\x00\x00\x00\x00'
19
20
switchLogger = logger.Logger().GetLogger()
21
22
def SendRawPacket(message):
23
"""Sends a Raw packet to the Light Server."""
24
25
eth_type = 0x88B5
26
- sock = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.htons(eth_type))
+ sock = socket.socket(socket.AF_PACKET, socket.SOCK_DGRAM, socket.htons(eth_type))
27
sock.bind((Interface, 0))
28
- ethernet_frame = DestMac + SrcMac + struct.pack('!H', eth_type) + message
+ ethernet_frame = message
29
sock.send(ethernet_frame)
30
31
sock.close()
0 commit comments