@@ -25,7 +25,7 @@ def __init__(self, interface, protocol, sock=None, no_recv_protocol=False):
2525 :param no_recv_protocol: If true (default False), the socket will not subscribe to anything, recv will just block.
2626 :type no_recv_protocol: bool
2727 """
28- if not 1536 < protocol < 0xFFFF :
28+ if not protocol < 0xFFFF :
2929 raise ValueError ("Protocol has to be in the range 0 to 65535" )
3030 self .no_recv_protocol = no_recv_protocol
3131 self .non_processed_protocol = protocol
@@ -37,7 +37,7 @@ def __init__(self, interface, protocol, sock=None, no_recv_protocol=False):
3737 :type: str/bytes/bytearray"""
3838 if no_recv_protocol :
3939 self .sock = self .sock_create (self .interface , 0 , sock )
40- else :
40+ else :
4141 self .sock = self .sock_create (self .interface , self .protocol , sock )
4242 self .close = self .sock .close
4343
@@ -65,7 +65,7 @@ def send(self, msg, dest=None, ethertype=None):
6565 """
6666 if ethertype is None : ethertype = self .ethertype
6767 if dest is None : dest = self .BROADCAST
68- payload = ( to_bytes ( dest ) + self .mac + to_bytes ( ethertype ) + to_bytes ( msg ))
68+ payload = dest + self .mac + ethertype + msg
6969 self .sock .send (payload )
7070
7171 def recv (self ):
@@ -75,7 +75,7 @@ def recv(self):
7575
7676 :rtype: RawPacket
7777 """
78- data = self .sock .recv (1500 )
78+ data = self .sock .recv (1024 )
7979 return RawPacket (data )
8080
8181 def __str__ (self ):
0 commit comments