• Xin Long's avatar
    xfrm: allow to accept packets with ipv6 NEXTHDR_HOP in xfrm_input · afcaf61b
    Xin Long authored
    For beet mode, when it's ipv6 inner address with nexthdrs set,
    the packet format might be:
    
        ----------------------------------------------------
        | outer  |     | dest |     |      |  ESP    | ESP |
        | IP hdr | ESP | opts.| TCP | Data | Trailer | ICV |
        ----------------------------------------------------
    
    The nexthdr from ESP could be NEXTHDR_HOP(0), so it should
    continue processing the packet when nexthdr returns 0 in
    xfrm_input(). Otherwise, when ipv6 nexthdr is set, the
    packet will be dropped.
    
    I don't see any error cases that nexthdr may return 0. So
    fix it by removing the check for nexthdr == 0.
    
    Fixes: 1da177e4 ("Linux-2.6.12-rc2")
    Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
    Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
    afcaf61b
xfrm_input.c 18.8 KB