LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Allocate dst to localhost (/128) unicast IPv6 address is different between linux 2.6.35.9 and 4.19.183. (https://www.linuxquestions.org/questions/linux-networking-3/allocate-dst-to-localhost-128-unicast-ipv6-address-is-different-between-linux-2-6-35-9-and-4-19-183-a-4175735331/)

jithin 03-26-2024 07:51 AM

Allocate dst to localhost (/128) unicast IPv6 address is different between linux 2.6.35.9 and 4.19.183.
 
I am a newbie to linux kernel and working on a custom dataplane kernel module. While porting linux kernel from 2.6.35.9 to 4.19.183 i did observe a
difference in how kernel set out interface to localhost unicast IPv6 address.

On older linux kernel 2.6.35.9 localhost dst are mapped to lo "Loopback" outinterface. While on 4.19.183 localhost dst are mapped to "vlan_id".
This impacts how dataplane populates route table as "lo" value in RTA_OIF is compared to check if its localhost or not.

Dataplane only track main route table (RT_TABLE_LOCAL/RT_TABLE_MAIN). Dataplane extracts below attributes to build route table from kernel.
1) RTA_DST
2) RTA_OIF
3) RTA_GATEWAY
4) RTA_PREFSRC

IPv6 address is obtained successfully using SLAAC server.

Any help on this would be of great help. Could anyone please help me with this problem?

Please find below linux kernel route table output:

----------------
Linux 2.6.35.9:
----------------
route -A inet6
Kernel IPv6 routing table
Destination Next Hop Flags Metric Ref Use Iface
2004:10:1:1::/64 :: UA 256 11192 3 vlan101
fe80::/64 :: U 256 0 0 pkt0
fe80::/64 :: U 256 0 0 vlan101
::/0 fe80::b6c7:99ff:fedd:4532 UG 1024 0 0 vlan101
::1/128 :: U 0 57 1 lo
2004:10:1:1:7667:f7ff:fe9a:55c0/128 :: U 0 0 1 lo
fe80::7667:f7ff:fe9a:55c0/128 :: U 0 0 1 lo
fe80::7667:f7ff:fe9a:55c0/128 :: U 0 46721 1 lo
ff00::/8 :: U 256 0 0 pkt0
ff00::/8 :: U 256 0 0 vlan101



root # ip -6 a
1: lo: <LOOPBACK,UP,10000> mtu 16436
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: pkt0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qlen 1000
inet6 fe80::7667:f7ff:fe9a:55c0/64 scope link
valid_lft forever preferred_lft forever
7: vlan101@pkt0: <BROADCAST,MULTICAST,UP,10000> mtu 1500
inet6 2004:10:1:1:7667:f7ff:fe9a:55c0/64 scope global dynamic
valid_lft 2592000sec preferred_lft 604800sec
inet6 fe80::7667:f7ff:fe9a:55c0/64 scope link
valid_lft forever preferred_lft forever

Dataplane Route Table:
more dataplane/router6/routes
2004:10:1:1:7667:f7ff:fe9a:55c0/128 -> local on lo
2004:10:1:1:0:0:0:0/64 -> neighbor on vlan101
fe80:0:0:0:0:0:0:0/64 -> link local unicast
ff00:0:0:0:0:0:0:0/8 -> multicast
0:0:0:0:0:0:0:0/0 -> fe80:0:0:0:b6c7:99ff:fedd:4532 via vlan101



-------------------------------------
Linux 4.19.183
-------------------------------------
/root # route -A inet6
Kernel IPv6 routing table
Destination Next Hop Flags Metric Ref Use Iface
2005::/64 :: UA 256 0 243 vlan401
fe80::/64 :: U 256 0 1 eth0
fe80::/64 :: U 256 0 1 pkt0
fe80::/64 :: U 256 0 1 wl0
fe80::/64 :: U 256 0 1 vlan401
::/0 fe80::424a:388e:b4b9:bd79 UG 1024 0 1 vlan401
::1/128 :: U 0 0 4 lo
2005::b227:cfff:fe80:3740/128 :: U 0 0 2 vlan401
fe80::b227:cfff:fe80:3740/128 :: U 0 0 6 eth0
fe80::b227:cfff:fe80:3740/128 :: U 0 0 2 pkt0
fe80::b227:cfff:fe80:3740/128 :: U 0 0 6 vlan401
fe80::b227:cfff:fe80:3741/128 :: U 0 0 2 eth1
fe80::b227:cfff:fe80:3750/128 :: U 0 0 2 wl0
ff00::/8 :: U 256 0 1 vlan5
ff00::/8 :: U 256 0 5 vlan401
ff00::/8 :: U 256 0 1 eth0
ff00::/8 :: U 256 0 1 pkt0
ff00::/8 :: U 256 0 1 wl0


/root # ip -6 a
1: lo: <LOOPBACK,UP,10000> mtu 65536 qlen 1000
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
6: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1824 qlen 1000
inet6 fe80::b227:cfff:fe80:3740/64 scope link
valid_lft forever preferred_lft forever
7: eth1: <BROADCAST,MULTICAST,UP,10000> mtu 1824 qlen 1000
inet6 fe80::b227:cfff:fe80:3741/64 scope link
valid_lft forever preferred_lft forever
8: pkt0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qlen 1000
inet6 fe80::b227:cfff:fe80:3740/64 scope link
valid_lft forever preferred_lft forever
14: vlan401@pkt0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qlen 1000
inet6 2005::b227:cfff:fe80:3740/64 scope global dynamic
valid_lft 86397sec preferred_lft 14397sec
inet6 fe80::b227:cfff:fe80:3740/64 scope link
valid_lft forever preferred_lft forever



Dataplane Route Table:
more dataplane/router6/routes
2005:0:0:0:b227:cfff:fe80:3740/128 -> 0:0:0:0:0:0:0:0 via vlan401
2005:0:0:0:0:0:0:0/64 -> neighbor on vlan401
fe80:0:0:0:0:0:0:0/64 -> link local unicast
ff00:0:0:0:0:0:0:0/8 -> multicast
0:0:0:0:0:0:0:0/0 -> fe80:0:0:0:424a:388e:b4b9:bd79 via vlan401


All times are GMT -5. The time now is 04:43 AM.