Skip to content

Commit

Permalink
Interfaces: Diagnostics: Ping - minor adjustments for #6378, limit th…
Browse files Browse the repository at this point in the history
…e maximum runtime to a day, fix form help an add source address
  • Loading branch information
AdSchellevis committed Mar 16, 2023
1 parent ffcda5b commit d1468a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<id>ping.settings.packetsize</id>
<label>Packet size</label>
<type>text</type>
<help><![CDATA[Specify the number of data bytes to be sent.]]></help>
<help>Specify the number of data bytes to be sent. Keep in mind this is the payload size, an IP and ICMP header are added.</help>
</field>
<field>
<id>ping.settings.disable_frag</id>
Expand All @@ -29,7 +29,6 @@
<help>
Disable fragmentation.
Can be helpful to determine the maximum size a transport is able to send.
Keep in mind this is the payload size, an IP and ICMP header are added.
</help>
</field>
<field>
Expand Down
4 changes: 4 additions & 0 deletions src/opnsense/scripts/interfaces/ping.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,12 @@ def read_latest_stats(filename):
'-p', "%s%s.pid" % (TEMP_DIR, cmd_args.job),
'-t', 'ping_%s' % cmd_args.job,
'/sbin/ping',
'-c', '86400', # hard limit: stop after 1 day
'-4' if settings.get('fam', 'ip') == 'ip' else '-6'
]
if settings.get('source_address', '') != '':
args.append('-S')
args.append(settings['source_address'])
if settings.get('packetsize', '') != '':
args.append('-s')
args.append(settings['packetsize'])
Expand Down

0 comments on commit d1468a3

Please sign in to comment.