Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Sep 2020 11:19:54 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r365657 - head/usr.sbin/traceroute6
Message-ID:  <202009121119.08CBJsNU068278@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Sat Sep 12 11:19:54 2020
New Revision: 365657
URL: https://svnweb.freebsd.org/changeset/base/365657

Log:
  Simplify code, no functional change.
  
  Since https://svnweb.freebsd.org/base?view=revision&revision=365378
  UDP is handled the same way as SCTP and TCP (using a raw socket).
  Therefore use the same code path.

Modified:
  head/usr.sbin/traceroute6/traceroute6.c

Modified: head/usr.sbin/traceroute6/traceroute6.c
==============================================================================
--- head/usr.sbin/traceroute6/traceroute6.c	Sat Sep 12 09:47:58 2020	(r365656)
+++ head/usr.sbin/traceroute6/traceroute6.c	Sat Sep 12 11:19:54 2020	(r365657)
@@ -568,15 +568,10 @@ main(int argc, char *argv[])
 	case IPPROTO_ICMPV6:
 		sndsock = rcvsock;
 		break;
-	case IPPROTO_UDP:
-		if ((sndsock = socket(AF_INET6, SOCK_RAW, IPPROTO_UDP)) < 0) {
-			perror("socket(SOCK_RAW)");
-			exit(5);
-		}
-		break;
 	case IPPROTO_NONE:
 	case IPPROTO_SCTP:
 	case IPPROTO_TCP:
+	case IPPROTO_UDP:
 		if ((sndsock = socket(AF_INET6, SOCK_RAW, useproto)) < 0) {
 			perror("socket(SOCK_RAW)");
 			exit(5);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009121119.08CBJsNU068278>