WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: traceroute doesn't work in release 12  (Read 2413 times)

Offline FlyingDutchman

  • Newbie
  • *
  • Posts: 31
traceroute doesn't work in release 12
« on: March 06, 2021, 04:23:50 AM »
Hi,

In release 12, whenever I try to traceroute, to any destination, I get an error:
command:
Code: [Select]
$ traceroute 8.8.8.8 response:
Code: [Select]
traceroute: NO OPT x!

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 10149
Re: traceroute doesn't work in release 12
« Reply #1 on: March 06, 2021, 05:00:24 AM »
Hi FlyingDutchman
Are you sure that wasn't  !X ? According to the man page:
Quote
!X (communication administratively prohibited)
Found here:
https://linux.die.net/man/8/traceroute

But from that terse description, I don't know who's prohibiting it.

You could see if using  sudo  solves your problem. You could also try using either:
Code: [Select]
traceroute -I 8.8.8.8or:
Code: [Select]
traceroute -T 8.8.8.8

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 13805
Re: traceroute doesn't work in release 12
« Reply #2 on: March 06, 2021, 05:50:57 AM »
Are you using traceroute from busybox or the inetutils or traceroute extensions?

Offline FlyingDutchman

  • Newbie
  • *
  • Posts: 31
Re: traceroute doesn't work in release 12
« Reply #3 on: March 06, 2021, 09:14:05 AM »
Hi @Rich and @Juanito,

I double checked and the error is
Code: [Select]
traceroute: NO OPT x! including the capitals. I couldn't find anything on Google that matches this error.

I tested with -I and -T option, but these are ignored as these options are not supported. I also tested with and without sudo, with the same result.

I'm using the busybox version, traceroute --help returns:
BusyBox v1.33.0 (2021-01-17 14:53:59 UTC) multi-call binary.

I very briefly tried to find the source code of BusyBox to do a text search for the error and find out what triggers it. I'll put some more effort in it, as it doesn't seem to be a very obvious issue.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10660
Re: traceroute doesn't work in release 12
« Reply #4 on: March 06, 2021, 09:33:04 AM »
commit f3a55b306ed3 looks relevant
"traceroute: fix option parsing"
The only barriers that can stop you are the ones you create yourself.

Offline FlyingDutchman

  • Newbie
  • *
  • Posts: 31
Re: traceroute doesn't work in release 12
« Reply #5 on: March 06, 2021, 11:06:52 AM »
I found the "NO OPT" message in the source files. file libbb/getopt32.c, line 473. For some reason I keep getting "Internal server error" if I try to paste the code on this forum, so here's the link:

https://git.busybox.net/busybox/tree/libbb/getopt32.c?h=1_33_stable

As far as I understand C (which is not far at all....), @curaga I think you are right and this is related to the commit you found.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 13805
Re: traceroute doesn't work in release 12
« Reply #6 on: March 06, 2021, 11:34:48 PM »

Offline FlyingDutchman

  • Newbie
  • *
  • Posts: 31
Re: traceroute doesn't work in release 12
« Reply #7 on: March 07, 2021, 12:59:59 PM »
I downloaded the Busybox source code, applied the existing patches and the new patch and compiled on a release 11 VM according to instructions. I then squashed it into a .tcz and added the package to a release 12 VM. As a package, it doesn't overwrite the busybox installation from the root file system, I had to manually swap the busybox and busybox.suid binaries from the root fs with the ones from the package.

And it works! traceroute works fine with this patch.

BTW: for applying patches I saw that some get applied with -Np0 flags, others with -Np1 flags. I gambled on -Np1 and it works, but what does this flag actually do?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 13805
Re: traceroute doesn't work in release 12
« Reply #8 on: March 07, 2021, 09:07:59 PM »
Assuming the file to be patched is subdir1/subdir2/subdir3/file:

p0 means use the full path to the file to be patched
p1 means use subdir2/subdir3/file

N means if the file looks like it has been patched already, don't automatically reverse it.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10660
Re: traceroute doesn't work in release 12
« Reply #9 on: March 07, 2021, 11:06:00 PM »
Reported it to busybox, for a future 1.33.1 release.
The only barriers that can stop you are the ones you create yourself.