• Chen Shen's avatar
    sctp: delete addr based on sin6_scope_id · 2ebda027
    Chen Shen authored
    sctp_inet6addr_event deletes 'addr' from 'local_addr_list' when setting
    netdev down, but it is possible to delete the incorrect entry (match
    the first one with the same ipaddr, but the different 'ifindex'), if
    there are some netdevs with the same 'local-link' ipaddr added already.
    It should delete the entry depending on 'sin6_addr' and 'sin6_scope_id'
    both. otherwise, the endpoint will call 'sctp_sf_ootb' if it can't find
    the according association when receives 'heartbeat', and finally will
    reply 'abort'.
    
    For example:
    1.when linux startup
    the entries in local_addr_list:
    ifindex:35 addr:fe80::40:43ff:fe80:0 (eths0.201)
    ifindex:36 addr:fe80::40:43ff:fe80:0 (eths0.209)
    ifindex:37 addr:fe80::40:43ff:fe80:0 (eths0.210)
    
    the route table:
    local fe80::40:43ff:fe80:0 dev eths0.201
    local fe80::40:43ff:fe80:0 dev eths0.209
    local fe80::40:43ff:fe80:0 dev eths0.210
    
    2.after 'ifconfig eths0.209 down'
    the entries in local_addr_list:
    ifindex:36 addr:fe80::40:43ff:fe80:0 (eths0.209)
    ifindex:37 addr:fe80::40:43ff:fe80:0 (eths0.210)
    
    the route table:
    local fe80::40:43ff:fe80:0 dev eths0.201
    local fe80::40:43ff:fe80:0 dev eths0.210
    
    3.asoc not found for src:[fe80::40:43ff:fe80:0]:37381 dst:[:1]:53335
    ::1->fe80::40:43ff:fe80:0 HEARTBEAT
    fe80::40:43ff:fe80:0->::1 ABORT
    Signed-off-by: default avatarChen Shen <peterchenshen@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    2ebda027
ipv6.c 31.7 KB