Loading net/ipv6/ip6_input.c +12 −14 Original line number Original line Diff line number Diff line Loading @@ -262,21 +262,23 @@ int ip6_mc_input(struct sk_buff *skb) * is for MLD (0x0000). * is for MLD (0x0000). */ */ if ((ptr[2] | ptr[3]) == 0) { if ((ptr[2] | ptr[3]) == 0) { deliver = 0; if (!ipv6_ext_hdr(nexthdr)) { if (!ipv6_ext_hdr(nexthdr)) { /* BUG */ /* BUG */ goto discard; goto out; } } offset = ipv6_skip_exthdr(skb, sizeof(*hdr), offset = ipv6_skip_exthdr(skb, sizeof(*hdr), &nexthdr); &nexthdr); if (offset < 0) if (offset < 0) goto discard; goto out; if (nexthdr != IPPROTO_ICMPV6) if (nexthdr != IPPROTO_ICMPV6) goto discard; goto out; if (!pskb_may_pull(skb, (skb_network_header(skb) + if (!pskb_may_pull(skb, (skb_network_header(skb) + offset + 1 - skb->data))) offset + 1 - skb->data))) goto discard; goto out; icmp6 = (struct icmp6hdr *)(skb_network_header(skb) + offset); icmp6 = (struct icmp6hdr *)(skb_network_header(skb) + offset); Loading @@ -285,12 +287,9 @@ int ip6_mc_input(struct sk_buff *skb) case ICMPV6_MGM_REPORT: case ICMPV6_MGM_REPORT: case ICMPV6_MGM_REDUCTION: case ICMPV6_MGM_REDUCTION: case ICMPV6_MLD2_REPORT: case ICMPV6_MLD2_REPORT: deliver = 1; break; break; default: /* Bogus */ goto discard; } } deliver = 1; goto out; goto out; } } /* unknown RA - process it normally */ /* unknown RA - process it normally */ Loading @@ -308,15 +307,14 @@ int ip6_mc_input(struct sk_buff *skb) ip6_mr_input(skb2); ip6_mr_input(skb2); } } } } #endif out: out: if (likely(deliver)) { #endif if (likely(deliver)) ip6_input(skb); ip6_input(skb); return 0; else { } discard: /* discard */ /* discard */ kfree_skb(skb); kfree_skb(skb); } return 0; return 0; } } Loading
net/ipv6/ip6_input.c +12 −14 Original line number Original line Diff line number Diff line Loading @@ -262,21 +262,23 @@ int ip6_mc_input(struct sk_buff *skb) * is for MLD (0x0000). * is for MLD (0x0000). */ */ if ((ptr[2] | ptr[3]) == 0) { if ((ptr[2] | ptr[3]) == 0) { deliver = 0; if (!ipv6_ext_hdr(nexthdr)) { if (!ipv6_ext_hdr(nexthdr)) { /* BUG */ /* BUG */ goto discard; goto out; } } offset = ipv6_skip_exthdr(skb, sizeof(*hdr), offset = ipv6_skip_exthdr(skb, sizeof(*hdr), &nexthdr); &nexthdr); if (offset < 0) if (offset < 0) goto discard; goto out; if (nexthdr != IPPROTO_ICMPV6) if (nexthdr != IPPROTO_ICMPV6) goto discard; goto out; if (!pskb_may_pull(skb, (skb_network_header(skb) + if (!pskb_may_pull(skb, (skb_network_header(skb) + offset + 1 - skb->data))) offset + 1 - skb->data))) goto discard; goto out; icmp6 = (struct icmp6hdr *)(skb_network_header(skb) + offset); icmp6 = (struct icmp6hdr *)(skb_network_header(skb) + offset); Loading @@ -285,12 +287,9 @@ int ip6_mc_input(struct sk_buff *skb) case ICMPV6_MGM_REPORT: case ICMPV6_MGM_REPORT: case ICMPV6_MGM_REDUCTION: case ICMPV6_MGM_REDUCTION: case ICMPV6_MLD2_REPORT: case ICMPV6_MLD2_REPORT: deliver = 1; break; break; default: /* Bogus */ goto discard; } } deliver = 1; goto out; goto out; } } /* unknown RA - process it normally */ /* unknown RA - process it normally */ Loading @@ -308,15 +307,14 @@ int ip6_mc_input(struct sk_buff *skb) ip6_mr_input(skb2); ip6_mr_input(skb2); } } } } #endif out: out: if (likely(deliver)) { #endif if (likely(deliver)) ip6_input(skb); ip6_input(skb); return 0; else { } discard: /* discard */ /* discard */ kfree_skb(skb); kfree_skb(skb); } return 0; return 0; } }