Bug 3980 - NSH client broken - Not able to send packets 04/24004/2
authorReinaldo Penno <[email protected]>
Fri, 10 Jul 2015 16:28:04 +0000 (09:28 -0700)
committerReinaldo Penno <[email protected]>
Fri, 10 Jul 2015 17:42:27 +0000 (10:42 -0700)
commitba95e064bad77f41e86967ad2e5c34aba02470d3
tree6e7e9222c3253f7a25bc134703d8549c86b41200
parent53a406ea41e1d9f207f52789294b890e27925cad
Bug 3980 - NSH client broken - Not able to send packets

the following patch broke NSH client

https://git.opendaylight.org/gerrit/#/c/23415/1

root@SFF-1-p:/vagrant/sfc-py/sfc# python3.4 sff_client.py --remote-sff-ip 192.168.33.31
 --remote-sff-port 6633 --sfp-id 1 --sfp-index 255
ERROR:asyncio:Exception in callback <bound method MyVxlanGpeNshIpClient.connection_made
of <__main__.MyVxlanGpeNshIpClient object at 0x7f52828a6f28>>(<asyncio.selector_events._
SelectorDatagramTransport object at 0x7f528296f748>,)
handle: Handle(<bound method MyVxlanGpeNshIpClient.connection_made of <__main__.MyVxlanG
peNshIpClient object at 0x7f52828a6f28>>, (<asyncio.selector_events._SelectorDatagramTra
nsport object at 0x7f528296f748>,))
Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/events.py", line 39, in _run
    self._callback(*self._args)
  File "sff_client.py", line 90, in connection_made
    udp_packet = build_udp_packet(self.dest_addr, "10.0.1.1", 10000, self.dest_port, "te
st".encode('utf-8'))
  File "/vagrant/sfc-py/sfc/nsh/encode.py", line 282, in build_udp_packet
    ip_header, ip_header_pack = build_ipv4_header(total_len, socket.IPPROTO_UDP, src_ip,
 dest_ip)
  File "/vagrant/sfc-py/sfc/nsh/encode.py", line 237, in build_ipv4_header
    ip_header = IPHEADER(IP_HEADER_LEN, IPV4_VERSION, IPV4_TOS, ip_tot_len, IPV4_PACKET_
ID, 0, IPV4_TTL, proto, 0,
NameError: name 'IPHEADER' is not defined

Change-Id: I94ecec23c4de60f3f200d1f8e08c03ec9ddcf32e
Signed-off-by: Reinaldo Penno <[email protected]>
sfc-py/sfc/nsh/encode.py