Bug 254055 - route6d Issues
Summary: route6d Issues
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 12.2-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: Alexander V. Chernikov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-06 07:17 UTC by bc979
Modified: 2024-01-20 22:21 UTC (History)
2 users (show)

See Also:
linimon: mfc-stable13?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bc979 2021-03-06 07:17:35 UTC
1.  When using route6d with the -R argument, it creates the file, but does not add anything to it for either deletes of addresses or adds of addresses using ifconfig.

2.  Deleting an address using ifconfig does not result in the removal of that address from the RIPng distribution.

To recreate this problem, start route6d with the -R argument.  Monitor the RIP packets sent.  Then add a new address to some port using ifconfig.  For example,

ifconfig ue0 inet6 2001:600::205/64

The new address will be immediately included in the next RIPng packet.  However, there is nothing logged in the log file.

Then, delete that address using ifconfig.  For example

ifconfig ue0 inet6 2001:600::205/64 delete

That address will continue to be included in the RIPng packets although it has been removed from the ifconfig ue0 output.  Also, there is no entry in the log either.
Comment 1 bc979 2021-03-07 09:13:01 UTC
After much testing of the code, the problem is not in the logging directly, but the log is buffered and there is very little written to it.  Adding a fflush after each printf fixes the logging.  However, in the log, after each ADD/DELETE entry is an entry that says:

Can not write to rtsock: Operation not supported

I believe that is why I don't see the updates to the route table.  Although, ADD does work even though it shows the error.  I am not familiar with PF_ROUTE sockets so it will take me awhile to learn about those and what could be causing that problem.  Since I forgot to save a copy of the original route6d.c I'll have to wait till the next release to put together any patches.  I am going to add the fflush's.
Comment 2 bc979 2021-03-07 10:17:30 UTC
Here is the -D output from the command:  ifconfig ue0 inet6 2001:1010::205/64:

rtmsg:
f0 00 05 01 00 00 00 00 45 04 00 00 03 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 1c 1c 00 00 00 00 00 00 
20 01 10 10 00 00 00 00 00 00 00 00 00 00 02 05 
00 00 00 00 00 00 00 00 36 12 05 00 06 00 06 00 
3c 18 a0 44 76 5b 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 

rtsock: ADD (addrs=3)
f0 00 05 01 00 00 00 00 45 04 00 00 03 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 1c 1c 00 00 00 00 00 00 
20 01 10 10 00 00 00 00 00 00 00 00 00 00 02 05 
00 00 00 00 00 00 00 00 36 12 05 00 06 00 06 00 
3c 18 a0 44 76 5b 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 

rtsock: read routing table again
route: 2001:1010::205/128 flags UHS gw ::1 if lo0 sock 3
rtmsg:
8c 00 05 0c 34 00 00 00 04 00 00 00 05 00 00 00 
00 00 00 00 1c 1c 00 00 00 00 00 00 ff ff ff ff 
ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 38 12 05 00 06 03 06 00 75 65 30 3c 
18 a0 44 76 5b 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 1c 1c 00 00 
00 00 00 00 20 01 10 10 00 00 00 00 00 00 00 00 
00 00 02 05 00 00 00 00 00 00 00 00 
rtsock: NEWADDR (addrs=34)
8c 00 05 0c 34 00 00 00 04 00 00 00 05 00 00 00 
00 00 00 00 1c 1c 00 00 00 00 00 00 ff ff ff ff 
ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 38 12 05 00 06 03 06 00 75 65 30 3c 
18 a0 44 76 5b 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 1c 1c 00 00 
00 00 00 00 20 01 10 10 00 00 00 00 00 00 00 00 
00 00 02 05 00 00 00 00 00 00 00 00 
rtsock: reconfigure interfaces, refresh interface routes
found address 2001:1010::205/64
route: 2001:1010::/64: register route (ue0)
02:09:49: ADD: 2001:1010::/64 gw 2001:1010::205 [0] ifa fe80::3e18:a0ff:fe44:765b
Can not write to rtsock (addroute): Operation not supported
02:09:49: Send rtdump Request to ue0 (ff02::9)
02:09:49: Send(bge0): info(6) to ff02::9.521
    2001:1010::/64[1]
    2001:100::/64[1]
    2001:200::/64[1]
    2001:300::/64[1]
    2001:400::/64[1]
    2001:600::/64[1]
rtmsg:
f0 00 05 01 03 00 00 00 45 08 10 00 03 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 1c 1c 00 00 00 00 00 00 
20 01 10 10 00 00 00 00 00 00 00 00 00 00 02 05 
00 00 00 00 00 00 00 00 36 12 05 00 06 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 

rtsock: ADD (addrs=3)
f0 00 05 01 03 00 00 00 45 08 10 00 03 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 1c 1c 00 00 00 00 00 00 
20 01 10 10 00 00 00 00 00 00 00 00 00 00 02 05 
00 00 00 00 00 00 00 00 36 12 05 00 06 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 

rtsock: read routing table again
rtmsg:
e8 00 05 01 05 00 00 00 41 00 10 00 07 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 1c 1c 00 00 00 00 00 00 
20 01 10 10 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 10 12 05 00 06 00 00 00 
00 00 00 00 00 00 00 00 1c 1c 00 00 00 00 00 00 
ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 
rtsock: ADD (addrs=7)
e8 00 05 01 05 00 00 00 41 00 10 00 07 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 1c 1c 00 00 00 00 00 00 
20 01 10 10 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 10 12 05 00 06 00 00 00 
00 00 00 00 00 00 00 00 1c 1c 00 00 00 00 00 00 
ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 
rtsock: read routing table again
rtmsg:
f8 00 05 01 00 00 00 00 04 40 00 00 07 00 00 00 
20 0a 00 00 06 00 00 00 2d 00 00 00 00 00 00 00 
02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 1c 1c 00 00 00 00 00 00 
20 01 10 10 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 1c 1c 00 00 00 00 00 00 
20 01 10 10 00 00 00 00 00 00 00 00 00 00 02 05 
00 00 00 00 00 00 00 00 1c 1c 00 00 00 00 00 00 
ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00
Comment 3 bc979 2021-03-07 10:18:59 UTC
That test was run on 13.0-RC1.  I upgraded in hopes that might change something, but it did not.
Comment 4 Alexander V. Chernikov freebsd_committer freebsd_triage 2021-03-07 23:39:08 UTC
Is there any chance you could try running ‘route -n monitor’ and provide its output?
Comment 5 bc979 2021-03-07 23:46:21 UTC
ifconfig bge0 inet6 2001:120::205/64



backup# route -n monitor

got message of size 240 on Sun Mar  7 15:43:44 2021
RTM_ADD: Add Route: len 240, pid: 0, seq 0, errno 0, flags:<UP,HOST,DONE,LLINFO>
locks:  inits: 
sockaddrs: <DST,GATEWAY>
 2001:120::205 0.13.72.c3.18.f

got message of size 140 on Sun Mar  7 15:43:44 2021
RTM_NEWADDR: address being added to iface: len 140, metric 0, flags:<HOST>
sockaddrs: <NETMASK,IFP,IFA>
 ffff:ffff:ffff:ffff:: bge0:0.13.72.c3.18.f 2001:120::205

got message of size 240 on Sun Mar  7 15:43:44 2021
RTM_ADD: Add Route: len 240, pid: 0, seq 0, errno 0, flags:<UP,HOST,DONE,STATIC,PINNED>
locks:  inits: 
sockaddrs: <DST,GATEWAY>
 2001:120::205 link#1

got message of size 232 on Sun Mar  7 15:43:44 2021
RTM_ADD: Add Route: len 232, pid: 0, seq 0, errno 0, flags:<UP,DONE,PINNED>
locks:  inits: 
sockaddrs: <DST,GATEWAY,NETMASK>
 2001:120:: link#1 ffff:ffff:ffff:ffff::

got message of size 248 on Sun Mar  7 15:43:44 2021
RTM_ADD: Add Route: len 248, pid: 835, seq 4, errno 45, flags:<HOST,PROTO2>
locks:  inits: 
sockaddrs: <DST,GATEWAY,NETMASK>
 2001:120:: 2001:120::205 ffff:ffff:ffff:ffff::
Comment 6 Alexander V. Chernikov freebsd_committer freebsd_triage 2021-03-07 23:53:57 UTC
Okay, so route6d wants to add /64 network with RTF_HOST flag set and kernel refuses to do so, as this is inconsistent.
I’ll hopefully get to fix it in the next couple of days.
Comment 7 bc979 2021-03-08 00:27:52 UTC
Here is the result of the deletion of that route:

backup# ifconfig bge0 inet6 2001:120::205/64 delete

route -n monitor

got message of size 240 on Sun Mar  7 16:23:08 2021
RTM_DELETE: Delete Route: len 240, pid: 0, seq 0, errno 0, flags:<HOST,DONE,STATIC,PINNED>
locks:  inits: 
sockaddrs: <DST,GATEWAY>
 2001:120::205 link#1

got message of size 140 on Sun Mar  7 16:23:08 2021
RTM_DELADDR: address being removed from iface: len 140, metric 0, flags:
sockaddrs: <NETMASK,IFP,IFA>
 ffff:ffff:ffff:ffff:: bge0:0.13.72.c3.18.f 2001:120::205

got message of size 232 on Sun Mar  7 16:23:08 2021
RTM_DELETE: Delete Route: len 232, pid: 0, seq 0, errno 0, flags:<DONE,PINNED>
locks:  inits: 
sockaddrs: <DST,GATEWAY,NETMASK>
 2001:120:: link#1 ffff:ffff:ffff:ffff::

got message of size 248 on Sun Mar  7 16:25:11 2021
RTM_DELETE: Delete Route: len 248, pid: 835, seq 5, errno 3, flags:<UP,GATEWAY,HOST,PROTO2>
locks:  inits: 
sockaddrs: <DST,GATEWAY,NETMASK>
 2001:120::205 ::1 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff



The route is deleted from the if table, but route6d still advertises it:

backup# rip6query localhost
Response from ::1 len 84
	2001:120::/64 [1]
	fec1::/64 [1]
	fec2::/64 [1]
	fec3::/64 [1]
Comment 8 Alexander V. Chernikov freebsd_committer freebsd_triage 2021-04-23 22:01:32 UTC
Raised https://reviews.freebsd.org/D29958 .
I'll test & merge this to 13-S on the weekend.
Comment 9 Mark Linimon freebsd_committer freebsd_triage 2024-01-20 22:21:40 UTC
^Triage: to committer: was this ever merged to 13?