add path mtu discovert (MTU) AKA Don't Fragment support

pull/91/head
Don Bowman 9 years ago
parent 925ef8fe12
commit 7c7448ab8c

@ -377,10 +377,19 @@ int main( int argc, char **argv )
/* get command line options */ /* get command line options */
while( ( c = getopt( argc, argv, "gedhlmnqusaAvDRz:t:H:i:p:f:r:c:b:C:Q:B:S:I:T:O:" ) ) != EOF ) while( ( c = getopt( argc, argv, "gedhlmnqusaAvDRz:t:H:i:p:f:r:c:b:C:Q:B:S:I:T:O:M" ) ) != EOF )
{ {
switch( c ) switch( c )
{ {
case 'M':
{
int val = IP_PMTUDISC_DO;
if (setsockopt(s, IPPROTO_IP, IP_MTU_DISCOVER, &val, sizeof(val))) {
perror("setsockopt IP_MTU_DISCOVER");
}
}
break;
case 't': case 't':
if( !( timeout = ( unsigned int )atoi( optarg ) * 100 ) ) if( !( timeout = ( unsigned int )atoi( optarg ) * 100 ) )
usage(1); usage(1);
@ -2380,6 +2389,7 @@ void usage(int is_error)
#endif #endif
fprintf(out, " -l loop sending pings forever\n" ); fprintf(out, " -l loop sending pings forever\n" );
fprintf(out, " -m ping multiple interfaces on target host\n" ); fprintf(out, " -m ping multiple interfaces on target host\n" );
fprintf(out, " -M Don't Fragment (IP_PMTUDISC_DO)\n" );
fprintf(out, " -n show targets by name (-d is equivalent)\n" ); fprintf(out, " -n show targets by name (-d is equivalent)\n" );
fprintf(out, " -O n set the type of service (tos) flag on the ICMP packets\n" ); fprintf(out, " -O n set the type of service (tos) flag on the ICMP packets\n" );
fprintf(out, " -p n interval between ping packets to one target (in millisec)\n" ); fprintf(out, " -p n interval between ping packets to one target (in millisec)\n" );

Loading…
Cancel
Save