Ping give socket error initially if IPv6 is disabled
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
iputils (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
With IpV6 enabled everything works well. However if you disable ipv6 by editing /etc/default/grub with the following entry
GRUB_CMDLINE_
then when you ping there is an initial socket error
ping localhost
ping: socket: Address family not supported by protocol
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.046 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.038 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.028 ms
64 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.028 ms
however ping -4 works
ping -4 localhost
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.032 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.029 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.021 ms
so it looks like ping is trying ipv6 first and not detecting that its disabled.
ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: iputils-ping 3:20210202-1build1
ProcVersionSign
Uname: Linux 5.13.0-19-generic x86_64
ApportVersion: 2.20.11-0ubuntu74
Architecture: amd64
CasperMD5CheckR
Date: Mon Jan 3 17:42:07 2022
InstallationDate: Installed on 2022-01-03 (0 days ago)
InstallationMedia: Ubuntu-Server 22.04 LTS "Jammy Jellyfish" - Alpha amd64 (20211029)
ProcEnviron:
TERM=xterm
PATH=(custom, no user)
LANG=en_GB.UTF-8
SHELL=/bin/bash
SourcePackage: iputils
UpgradeStatus: No upgrade log present (probably fresh install)