Skip to content

Commit

Permalink
Merge pull request #24 from kamorin/update-flags
Browse files Browse the repository at this point in the history
Update flags
  • Loading branch information
kamorin authored Jan 4, 2024
2 parents bb68dff + 105aed1 commit b580dc3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pig.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ def run(self):
dhcp_discover = v6_build_discover(m,trid=myxid,options=REQUEST_OPTS)
LOG(type="-->", message="v6_DHCP_Discover [cid:%s]"%(repr(str(dhcp_discover[DHCP6OptClientId].duid))))
else:
dhcp_discover = Ether(src=mymac,dst="ff:ff:ff:ff:ff:ff")/IP(src="0.0.0.0",dst="255.255.255.255")/UDP(sport=68,dport=67)/BOOTP(chaddr=[mac2str(m)],xid=myxid,flags=0xFFFFFF)/DHCP(options=myoptions)
dhcp_discover = Ether(src=mymac,dst="ff:ff:ff:ff:ff:ff")/IP(src="0.0.0.0",dst="255.255.255.255")/UDP(sport=68,dport=67)/BOOTP(chaddr=[mac2str(m)],xid=myxid,flags=0x8000)/DHCP(options=myoptions)
LOG(type="-->", message="DHCP_Discover")
sendPacket(dhcp_discover)
if TIMEOUT['timer']>0:
Expand Down Expand Up @@ -618,7 +618,7 @@ def detect_dhcp(self, pkt):
LOG(type="DEBUG", message= "\t\t* %s\t%s"%(o[0],o[1:]) )

# ("param_req_list",0) is the equivalent of using DHCPRevOptions["pad"][0]
dhcp_req = Ether(src=mymac,dst="ff:ff:ff:ff:ff:ff")/IP(src="0.0.0.0",dst="255.255.255.255")/UDP(sport=68,dport=67)/BOOTP(chaddr=[mac2str(localm)],xid=localxid,flags=0xFFFFFF)/DHCP(options=[("message-type","request"),("server_id",sip),("requested_addr",myip),("hostname",myhostname),("param_req_list",0),"end"])
dhcp_req = Ether(src=mymac,dst="ff:ff:ff:ff:ff:ff")/IP(src="0.0.0.0",dst="255.255.255.255")/UDP(sport=68,dport=67)/BOOTP(chaddr=[mac2str(localm)],xid=localxid,flags=0x8000)/DHCP(options=[("message-type","request"),("server_id",sip),("requested_addr",myip),("hostname",myhostname),("param_req_list",0),"end"])

LOG(type="-->", message= "DHCP_Request "+myip)
sendPacket(dhcp_req)
Expand Down

0 comments on commit b580dc3

Please sign in to comment.