Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 300610
b: refs/heads/master
c: c1412fc
h: refs/heads/master
v: v3
  • Loading branch information
Eldad Zack authored and David S. Miller committed Apr 12, 2012
1 parent 87c8208 commit 6779467
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 46ba5b23c32667821b748b4e0b74667e750621cd
refs/heads/master: c1412fce7eccae62b4de22494f6ab3ff8a90c0c6
16 changes: 16 additions & 0 deletions trunk/net/ipv6/exthdrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,29 @@ static int ip6_parse_tlv(struct tlvtype_proc *procs, struct sk_buff *skb)

while (len > 0) {
int optlen = nh[off + 1] + 2;
int i;

switch (nh[off]) {
case IPV6_TLV_PAD0:
optlen = 1;
break;

case IPV6_TLV_PADN:
/* RFC 2460 states that the purpose of PadN is
* to align the containing header to multiples
* of 8. 7 is therefore the highest valid value.
* See also RFC 4942, Section 2.1.9.5.
*/
if (optlen > 7)
goto bad;
/* RFC 4942 recommends receiving hosts to
* actively check PadN payload to contain
* only zeroes.
*/
for (i = 2; i < optlen; i++) {
if (nh[off + i] != 0)
goto bad;
}
break;

default: /* Other TLV code so scan list */
Expand Down

0 comments on commit 6779467

Please sign in to comment.