Skip to content
  • Eldad Zack's avatar
    ipv6/exthdrs: strict Pad1 and PadN check · 9b905fe6
    Eldad Zack authored
    The following tightens the padding check from commit
    c1412fce
    
     :
    
    * Take into account combinations of consecutive Pad1 and PadN.
    
    * Catch the corner case of when only padding is present in the
      header, when the extention header length is 0 (i.e., 8 bytes).
      In this case, the header would have exactly 6 bytes of padding:
    
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    :  Next Header  : Hdr Ext Len=0 :                               :
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
    :                        Padding (Pad1 or PadN)                 :
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    
    Signed-off-by: default avatarEldad Zack <eldad@fogrefinery.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    9b905fe6