FreeBSD Bugzilla – Attachment 233823 Details for
Bug 263886
dwc: dwc driver fails to detect a bad checksum packet when the RXCSUM capability is turned on
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
python script for sending a good/bad checksum packet
send_raw_ping.py (text/plain), 1.58 KB, created by
Jiahao LI
on 2022-05-09 18:36:17 UTC
(
hide
)
Description:
python script for sending a good/bad checksum packet
Filename:
MIME Type:
Creator:
Jiahao LI
Created:
2022-05-09 18:36:17 UTC
Size:
1.58 KB
patch
obsolete
>import string >from scapy.all import * >import argparse > > >#fa:97:92:f6:f1:09 > ># This is a ping packet with a good checksum (0xb789), IP addresses ># don't matter as this will be used in testing IP checksum >good_ping_pkt_payload = b'\xFA\x97\x92\xF6\xF1\x09' +\ > b'\x00\x00\x00\x00\x00\x01' +\ > b'\x08\x00\x45\x00\x00\x1E\x00\x00\x40\x00\x40\x01' +\ > b'\xB7\x89\xC0\xA8\x01\x02\xC0\xA8\x01\x03\x08\x00' +\ > b'\xF7\xFE\x00\x00\x00\x00\x00\x01' > ># This is a ping packet with a bad checksum (0xb788), IP addresses ># don't matter as this will be used in testing IP checksum >bad_ping_pkt_payload = b'\xFA\x97\x92\xF6\xF1\x09' +\ > b'\x00\x00\x00\x00\x00\x01' +\ > b'\x08\x00\x45\x00\x00\x1e\x00\x00\x40\x00\x40\x01' +\ > b'\xb7\x88\xc0\xa8\x01\x02\xc0\xa8\x01\x03\x08\x00' +\ > b'\xf7\xfe\x00\x00\x00\x00\x00\x01' > >def send_good_ping(): > netpacket = Raw(good_ping_pkt_payload) > print(netpacket) > sendp(netpacket, iface="enp0s31f6") > >def send_bad_ping(): > netpacket = Raw(bad_ping_pkt_payload) > print(netpacket) > sendp(netpacket, iface="enp0s31f6") > > > >if __name__ == "__main__": > parser = argparse.ArgumentParser() > > parser.add_argument("-s", "--string", type=str, required=True) > args = parser.parse_args() > print(args.string) > if args.string == 'good': > print('Send good packet') > send_good_ping() > elif args.string == 'bad': > print('Send bad packet') > send_bad_ping() >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 263886
: 233823 |
233824
|
233961
|
234238