Subject: Bug#3318: traceroute doesn't work with 1.2.13

From: Michael Shields <[email-masked]>
Date: Tue, 18 Jun 1996 20:18:00 +0000

Package: netstd
Version: 2.05-1

Debian 1.1 is supposed to work with kernel 1.2.13.  But traceroute is broken.

    traceroute: IP_HDRINCL: Protocol not available

--
Shields, CrossLink.

---

From: "Peter Tobias" <[email-masked]>
Date: Wed, 19 Jun 1996 00:05:48 +0200 (MET DST)

>     traceroute: IP_HDRINCL: Protocol not available

I can disable it, but that would also disable it for all Debian users
that use 1.3 or 2.0 kernels (which support IP_HDRINCL).

Thanks,

Peter

-- 
 Peter Tobias                                EMail:
 Fachhochschule Ostfriesland                 [email-masked]
 Fachbereich Elektrotechnik und Informatik   [email-masked]
 Constantiaplatz 4, 26723 Emden, Germany     [email-masked]

---

From: Miquel van Smoorenburg <[email-masked]>
Date: Wed, 19 Jun 1996 00:59:53 +0200 (MET DST)

> that use 1.3 or 2.0 kernels (which support IP_HDRINCL).

Debian 1.1 is *not* guaranteed to work with 1.2.13. This was decided
during development of Debian 1.1 as not to cripple new features.

It really is a shame both kernels are not totally compatible, but
most people will use 2.0....

Mike.
-- 
  Miquel van    | Cistron Internet Services   --    Alphen aan den Rijn.
  Smoorenburg,  | mailto:[email-masked]          http://www.cistron.nl/
[email-masked] | Tel: +31-172-419445 (Voice) 430979 (Fax) 442580 (Data)

---

From: Mark Eichin <[email-masked]>
Date: 19 Jun 1996 01:46:17 -0400

Wouldn't it be easier to do something like I did with BIND -- detect
the "protocol not available" (ENOPROTOOPT?) and don't use the feature,
instead of calling it an error...

---

From: [email-masked]
Date: Wed, 19 Jun 1996 17:44:38 +0000 (GMT)

> >>>>> Michael Shields writes: 
>  
> > Package: netstd Version: 2.05-1 
>  
> Who said that? We are running 2.0.x as _STABLE_ kernel release ... 

Bruce Perens said a few days ago that you could probably upgrade to 1.1
without 2.0.  It's not so much work -- yesterday I upgraded
daedalus.crosslink.net to 1.1 while keeping my 1.2 kernel, and as far as
I can tell only traceroute broke.  I've already sent in patches for that
that preserve the new functionality while remaining
backwards-compatible.
-- 
Shields, CrossLink.

---

From: Dominik Kubla <[email-masked]>
Date: Wed, 19 Jun 1996 15:35:02 +0200

Dominik

---

From: [email-masked]
Date: Wed, 19 Jun 1996 06:39:58 +0000 (GMT)

> instead of calling it an error...  

That was my thought.  These patches should do it.

--- traceroute-4.4BSD/traceroute.c	Sun Jan 28 22:47:27 1996
+++ traceroute.c	Wed Jun 19 06:36:15 1996
@@ -310,6 +310,9 @@
 	struct protoent *pe;
 	struct sockaddr_in from, *to;
 	int ch, i, on, probe, seq, tos, ttl;
+#ifdef IP_HDRINCL
+	int hdrincl_works = 1;
+#endif
 
 	on = 1;
 	seq = tos = 0;
@@ -454,8 +457,12 @@
 #ifdef IP_HDRINCL
 	if (setsockopt(sndsock, IPPROTO_IP, IP_HDRINCL, (char *)&on,
 		       sizeof(on)) < 0) {
-		perror("traceroute: IP_HDRINCL");
-		exit(6);
+		if (errno == ENOPROTOOPT) {
+			hdrincl_works = 0;
+		} else {
+			perror("traceroute: IP_HDRINCL");
+			exit(6);
+		}
 	}
 #endif IP_HDRINCL
 	if (options & SO_DEBUG)
@@ -475,7 +482,7 @@
 		}
 		outpacket->ip.ip_src = from.sin_addr;
 #ifndef IP_HDRINCL
-		if (bind(sndsock, (struct sockaddr *)&from, sizeof(from)) < 0) {
+		if (hdrincl_works && bind(sndsock, (struct sockaddr *)&from, sizeof(from)) < 0) {
 			perror ("traceroute: bind:");
 			exit (1);
 		}
-- 
Shields, CrossLink.