Bug 247617 - Error when deleting ::1 from lo0
Summary: Error when deleting ::1 from lo0
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 12.1-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: Hiroki Sato
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-28 14:36 UTC by Markus Stoff
Modified: 2020-07-05 11:04 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Stoff 2020-06-28 14:36:46 UTC
The following error message is logged when deleting ::1/128 from lo0 without explicitly adding it to the interface:

  in6_purgeaddr: err=65, destination address delete failed

This message seems to be issued at /usr/src/sys/netinet6/in6.c, line 1311 (12.1-RELEASE).

It only happens with the implicitly generated ::1/128 address on the loopback interface. If ::1/128 has been assigned explicitly (see examples below), no message is logged. The issue applies to the host system (running the 12.1-RELEASE generic kernel) as well as vnet jails. Here is how to reproduce the issue:

On the host system:

  ifconfig lo0 inet6 ::1/128 delete   # after boot, error logged
  ifconfig lo0 inet6 ::1/128
  ifconfig lo0 inet6 ::1/128 delete   # no error logged

In a jail:

  # Reproducing the error
  jail -c -n failjail vnet persist
  jexec failjail ifconfig lo0 up
  jexec failjail ifconfig lo0 inet6 ::1/128 delete   # error logged
  jail -r failjail

  # Avoiding the error
  jail -c -n okjail vnet persist
  jexec okjail ifconfig lo0 inet6 ::1/128            # don't use 'up'
  jexec okjail ifconfig lo0 inet6 ::1/128 delete     # no error logged
  jail -r okjail
Comment 1 Markus Stoff 2020-06-28 15:03:26 UTC
(In reply to Markus Stoff from comment #0)

The issue can be mitigated by setting ::1/128 on the loopback interface via /etc/rc.conf:

  sysrc ifconfig_lo0_ipv6="inet6 ::1/128"
Comment 2 Hiroki Sato freebsd_committer 2020-06-28 19:05:43 UTC
Just for my curiosity, why do you need to remove ::1 on lo0?

The current FreeBSD does not support well removing ::1 when IPv6
is enabled in the kernel.
Comment 3 Markus Stoff 2020-07-05 11:04:47 UTC
(In reply to Hiroki Sato from comment #2)

I'm not doing this intentionally. The above is only a dumbed down way to reproduce the issue.

I'm using exec.stop = "/bin/sh /etc/rc.shutdown" with my jails, and this is where the message is being triggered.