Skip to content

Commit

Permalink
Update icmp_responder to only respond only linkmgrd requests (sonic…
Browse files Browse the repository at this point in the history
…-net#9089)

Summary:
Fixes # (issue)

To make sure `icmp_responder` only replies ICMP requests sent by linkmgrd, So 

1. it won't reply packets from other tests.
2. to be consistent with production behavior

sign-off: Jing Zhang [email protected]
  • Loading branch information
zjswhhh authored and mssonicbld committed Aug 4, 2023
1 parent 0982d75 commit d870626
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/scripts/icmp_responder.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@
# As defined in asm/socket.h
SO_ATTACH_FILTER = 26

# BPF filter "icmp[0] == 8"
# BPF filter "icmp[icmptype]==8 and src host 10.1.0.36"
icmp_bpf_filter = [
[0x28, 0, 0, 0x0000000c],
[0x15, 0, 8, 0x00000800],
[0x15, 0, 10, 0x00000800],
[0x30, 0, 0, 0x00000017],
[0x15, 0, 6, 0x00000001],
[0x15, 0, 8, 0x00000001],
[0x28, 0, 0, 0x00000014],
[0x45, 4, 0, 0x00001fff],
[0x45, 6, 0, 0x00001fff],
[0xb1, 0, 0, 0x0000000e],
[0x50, 0, 0, 0x0000000e],
[0x15, 0, 1, 0x00000008],
[0x15, 0, 3, 0x00000008],
[0x20, 0, 0, 0x0000001a],
[0x15, 0, 1, 0x0a010024],
[0x6, 0, 0, 0x00040000],
[0x6, 0, 0, 0x00000000]
]
Expand Down

0 comments on commit d870626

Please sign in to comment.