SUSTech-HPCLab / CS305-2023Spring-Project

GNU General Public License v3.0
10 stars 5 forks source link

[Question] 'list' object has no attribute 'serialize' When Generating Packet #8

Open OctCarp opened 1 year ago

OctCarp commented 1 year ago

In assemble_offer in dhcp.py, I use offer_pkt = packet.Packet() to generate a packet, then use add_protocol to add info for each layer. Finally return offer_pkt as argument for _send_packet

When it goes to _send_packet , such error occurs:

'list' object has no attribute 'serialize'

Then I print parameter pkt in _send_packet it just like:

ethernet(dst='00:00:00:00:00:01',ethertype=2048,src='7e:49:b3:f0:f9:99'), ipv4(csum=0,dst='255.255.255.255',flags=0,header_length=5,identification=0,offset=0,option=None,proto=17,src='192.168.43.131',tos=0,total_length=0,ttl=255,version=4), udp(csum=0,dst_port=68,src_port=67,total_length=0), dhcp(...)

It seems the info in pkt is right, but how can I use serialize for offer_pkt? Or I need do something for it before serialize?

OctCarp commented 1 year ago

I got this, I didn't use options() when edit option filed in dhcp.