openwrt / openwrt/openwrt

[dhcpv6.script] Parsed ipv6 router advertisment insert from

Open
#18,359 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug release/19.07 Self Built Image target/ipq40xx
Dominant language
C
Stars
28.5k
Forks
13k
Avg merge
3d 1h
Merged PRs (30d)
160

Description

Describe the bug

Hello

I have an issue that the Ipv6 routes inserted into the routes seemed to be maleformed.
Check steps by steps to see advertisment information, following are the;

`$ ip -6 route`
$ ip -6 route
default from ddf8:e7c0:c40b::9aa via fe80::9683:c4ff:fe2f:8a75 dev eth0  metric 512
default from ddf8:e7c0:c40b::/64 via fe80::9683:c4ff:fe2f:8a75 dev eth0  metric 512
ddf8:e7c0:c40b::/64 dev eth0  metric 256
unreachable ddf8:e7c0:c40b::/64 dev lo  metric 2147483647  error -113
fd26:cfe2:578d::/64 dev br-lan  metric 1024
unreachable fd26:cfe2:578d::/48 dev lo  metric 2147483647  error -113
fd41:f700:4c32:1::/64 from ddf8:e7c0:c40b::9aa via fe80::9683:c4ff:fe2f:8a75 dev eth0  metric 512
fd41:f700:4c32:1::/64 from ddf8:e7c0:c40b::/64 via fe80::9683:c4ff:fe2f:8a75 dev eth0  metric 512
fe80::/64 dev eth0  metric 256
fe80::/64 dev br-lan  metric 256
fe80::/64 dev wlan0  metric 256
anycast ddf8:e7c0:c40b:: dev eth0  metric 0
anycast fd26:cfe2:578d:: dev br-lan  metric 0
anycast fe80:: dev br-lan  metric 0
anycast fe80:: dev eth0  metric 0
anycast fe80:: dev wlan0  metric 0
ff00::/8 dev br-lan  metric 256
ff00::/8 dev eth0  metric 256
ff00::/8 dev wlan0  metric 256
*/lib/netifd/dhcpv6.script* - `_proto_push_route`

Small dump of dhcpv6.script for proto_send_update "$INTERFACE"

"routes6" "::/0/fe80::9683:c4ff:fe2f:8a75/512/1799//ddf8:e7c0:c40b::9aa/128 
::/0/fe80::9683:c4ff:fe2f:8a75/512/1799//ddf8:e7c0:c40b:0:2a0:3ff:fe97:4fe/64 
ddf8:e7c0:c40b::/64//256/4294967295// 
fd41:f700:4c32:1::/64/fe80::9683:c4ff:fe2f:8a75/512/1527//ddf8:e7c0:c40b::9aa/128 
fd41:f700:4c32:1::/64/fe80::9683:c4ff:fe2f:8a75/512/1527//ddf8:e7c0:c40b:0:2a0:3ff:fe97:4fe/64" 
_proto_push_route
OpenWrt version

r11306-c4a6851c72

OpenWrt release

19.07.7

OpenWrt target/subtarget

ipq40xx/generic

Device

CustomDevice

Image kind

Self-built image

Steps to reproduce
  1. Receive ipv6 routes:
ICMPv6 Route Adv. Prefix
Frame 56134: 150 bytes on wire (1200 bits), 150 bytes captured (1200 bits) on interface \Device\NPF_{372832C4-F589-42C5-A11C-362EB3538936}, id 0
Ethernet II, Src: GLTechnologi_2f:8a:75 (94:83:c4:2f:8a:75), Dst: IPv6mcast_01 (33:33:00:00:00:01)
Internet Protocol Version 6, Src: fe80::9683:c4ff:fe2f:8a75, Dst: ff02::1
    0110 .... = Version: 6
    .... 0000 0000 .... .... .... .... .... = Traffic Class: 0x00 (DSCP: CS0, ECN: Not-ECT)
    .... 0001 1111 0101 0100 0001 = Flow Label: 0x1f541
    Payload Length: 96
    Next Header: ICMPv6 (58)
    Hop Limit: 255
    Source Address: fe80::9683:c4ff:fe2f:8a75
    Destination Address: ff02::1
    [Source SLAAC MAC: GLTechnologi_2f:8a:75 (94:83:c4:2f:8a:75)]
Internet Control Message Protocol v6
    Type: Router Advertisement (134)
    Code: 0
    Checksum: 0xbac2 [correct]
    [Checksum Status: Good]
    Cur hop limit: 64
    Flags: 0xc0, Managed address configuration, Other configuration, Prf (Default Router Preference): Medium
        1... .... = Managed address configuration: Set
        .1.. .... = Other configuration: Set
        ..0. .... = Home Agent: Not set
        ...0 0... = Prf (Default Router Preference): Medium (0)
        .... .0.. = ND Proxy: Not set
        .... ..0. = Reserved: 0
    Router lifetime (s): 1800
    Reachable time (ms): 0
    Retrans timer (ms): 0
    ICMPv6 Option (Source link-layer address : 94:83:c4:2f:8a:75)
        Type: Source link-layer address (1)
        Length: 1 (8 bytes)
        Link-layer address: GLTechnologi_2f:8a:75 (94:83:c4:2f:8a:75)
    ICMPv6 Option (MTU : 1500)
        Type: MTU (5)
        Length: 1 (8 bytes)
        Reserved
        MTU: 1500
    ICMPv6 Option (Prefix information : ddf8:e7c0:c40b::/64)
        Type: Prefix information (3)
        Length: 4 (32 bytes)
        Prefix Length: 64
        Flag: 0xc0, On-link flag(L), Autonomous address-configuration flag(A)
            1... .... = On-link flag(L): Set
            .1.. .... = Autonomous address-configuration flag(A): Set
            ..0. .... = Router address flag(R): Not set
            ...0 0000 = Reserved: 0
        Valid Lifetime: Infinity (4294967295) (49710 days, 6 hours, 28 minutes, 15 seconds)
        Preferred Lifetime: Infinity (4294967295) (49710 days, 6 hours, 28 minutes, 15 seconds)
        Reserved
        Prefix: ddf8:e7c0:c40b::
    ICMPv6 Option (Recursive DNS Server ddf8:e7c0:c40b::1)
        Type: Recursive DNS Server (25)
        Length: 3 (24 bytes)
        Reserved
        Lifetime: 1800 (30 minutes)
        Recursive DNS Servers: ddf8:e7c0:c40b::1
    ICMPv6 Option (Advertisement Interval : 600000)
        Type: Advertisement Interval (7)
        Length: 1 (8 bytes)
        Reserved
        Advertisement Interval: 600000

ICMPv6 Route Adv. Routes
Frame 56701: 94 bytes on wire (752 bits), 94 bytes captured (752 bits) on interface \Device\NPF_{372832C4-F589-42C5-A11C-362EB3538936}, id 0
Ethernet II, Src: GLTechnologi_2f:8a:75 (94:83:c4:2f:8a:75), Dst: IPv6mcast_01 (33:33:00:00:00:01)
Internet Protocol Version 6, Src: fe80::9683:c4ff:fe2f:8a75, Dst: ff02::1
    0110 .... = Version: 6
    .... 0000 0000 .... .... .... .... .... = Traffic Class: 0x00 (DSCP: CS0, ECN: Not-ECT)
    .... 0001 1111 0101 0100 0001 = Flow Label: 0x1f541
    Payload Length: 40
    Next Header: ICMPv6 (58)
    Hop Limit: 255
    Source Address: fe80::9683:c4ff:fe2f:8a75
    Destination Address: ff02::1
    [Source SLAAC MAC: GLTechnologi_2f:8a:75 (94:83:c4:2f:8a:75)]
Internet Control Message Protocol v6
    Type: Router Advertisement (134)
    Code: 0
    Checksum: 0x16a5 [correct]
    [Checksum Status: Good]
    Cur hop limit: 64
    Flags: 0xc0, Managed address configuration, Other configuration, Prf (Default Router Preference): Medium
        1... .... = Managed address configuration: Set
        .1.. .... = Other configuration: Set
        ..0. .... = Home Agent: Not set
        ...0 0... = Prf (Default Router Preference): Medium (0)
        .... .0.. = ND Proxy: Not set
        .... ..0. = Reserved: 0
    Router lifetime (s): 1800
    Reachable time (ms): 0
    Retrans timer (ms): 0
    ICMPv6 Option (RA Flags Extension)
        Type: RA Flags Extension (26)
        Length: 1 (8 bytes)
        Flags Expansion Option: 0x8000, Managed address configuration, Prf (Default Router Preference): Medium
            1... .... .... .... = Managed address configuration: Set
            .0.. .... .... .... = Other configuration: Not set
            ..0. .... .... .... = Home Agent: Not set
            ...0 0... .... .... = Prf (Default Router Preference): Medium (0)
            .... .0.. .... .... = Proxy: Not set
            .... ..0. 0000 0000 = Reserved: 0
        Reserved
    ICMPv6 Option (Route Information : Medium fd41:f700:4c32:1::/64)
        Type: Route Information (24)
        Length: 2 (16 bytes)
        Prefix Length: 64
        Flag: 0x00, Route Preference: Medium
            ...0 0... = Route Preference: Medium (0)
            000. .000 = Reserved: 0
        Route Lifetime: 1800 (30 minutes)
        Prefix: fd41:f700:4c32:1::
Actual behaviour

Permission denies fails, works when other routes are added manually, can not delete route entry.

$ ping fd41:f700:4c32:1::1
PING fd41:f700:4c32:1::1 (fd41:f700:4c32:1::1): 56 data bytes
ping: sendto: Permission denied
Expected behaviour

Timeout or response depending if device is available

$ ping fd41:f700:4c32:1::1
PING fd41:f700:4c32:1::1 (fd41:f700:4c32:1::1): 56 data bytes
...
Additional info

No response

Diffconfig

Terms
  • I am reporting an issue for OpenWrt, not an unsupported fork.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lib/netifd/dhcpv6.script at _proto_push_route and compare the serialized routes6 entries with the supplied Router Advertisement route and resulting ip -6 route output. Investigate why the inserted route causes Permission denied and cannot be deleted. Done means the advertised route is installed with usable behavior and can be removed normally.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.