···228228 unsigned char answer_flags;229229 char answer_no_check;230230 int try_loading_module = 0;231231- int err = -ESOCKTNOSUPPORT;231231+ int err;232232233233 sock->state = SS_UNCONNECTED;234234235235 /* Look for the requested type/protocol pair. */236236 answer = NULL;237237lookup_protocol:238238+ err = -ESOCKTNOSUPPORT;238239 rcu_read_lock();239240 list_for_each_rcu(p, &inetsw[sock->type]) {240241 answer = list_entry(p, struct inet_protosw, list);···253252 if (IPPROTO_IP == answer->protocol)254253 break;255254 }255255+ err = -EPROTONOSUPPORT;256256 answer = NULL;257257 }258258···281279282280 err = -EPERM;283281 if (answer->capability > 0 && !capable(answer->capability))284284- goto out_rcu_unlock;285285- err = -EPROTONOSUPPORT;286286- if (!protocol)287282 goto out_rcu_unlock;288283289284 sock->ops = answer->ops;
+4-1
net/ipv4/igmp.c
···897897 /* Is it our report looped back? */898898 if (((struct rtable*)skb->dst)->fl.iif == 0)899899 break;900900- igmp_heard_report(in_dev, ih->group);900900+ /* don't rely on MC router hearing unicast reports */901901+ if (skb->pkt_type == PACKET_MULTICAST ||902902+ skb->pkt_type == PACKET_BROADCAST)903903+ igmp_heard_report(in_dev, ih->group);901904 break;902905 case IGMP_PIM:903906#ifdef CONFIG_IP_PIMSM_V1
+33-14
net/ipv6/af_inet6.c
···9292 struct proto *answer_prot;9393 unsigned char answer_flags;9494 char answer_no_check;9595- int rc;9595+ int try_loading_module = 0;9696+ int err;96979798 /* Look for the requested type/protocol pair. */9899 answer = NULL;100100+lookup_protocol:101101+ err = -ESOCKTNOSUPPORT;99102 rcu_read_lock();100103 list_for_each_rcu(p, &inetsw6[sock->type]) {101104 answer = list_entry(p, struct inet_protosw, list);···116113 if (IPPROTO_IP == answer->protocol)117114 break;118115 }116116+ err = -EPROTONOSUPPORT;119117 answer = NULL;120118 }121119122122- rc = -ESOCKTNOSUPPORT;123123- if (!answer)124124- goto out_rcu_unlock;125125- rc = -EPERM;120120+ if (!answer) {121121+ if (try_loading_module < 2) {122122+ rcu_read_unlock();123123+ /*124124+ * Be more specific, e.g. net-pf-10-proto-132-type-1125125+ * (net-pf-PF_INET6-proto-IPPROTO_SCTP-type-SOCK_STREAM)126126+ */127127+ if (++try_loading_module == 1)128128+ request_module("net-pf-%d-proto-%d-type-%d",129129+ PF_INET6, protocol, sock->type);130130+ /*131131+ * Fall back to generic, e.g. net-pf-10-proto-132132132+ * (net-pf-PF_INET6-proto-IPPROTO_SCTP)133133+ */134134+ else135135+ request_module("net-pf-%d-proto-%d",136136+ PF_INET6, protocol);137137+ goto lookup_protocol;138138+ } else139139+ goto out_rcu_unlock;140140+ }141141+142142+ err = -EPERM;126143 if (answer->capability > 0 && !capable(answer->capability))127127- goto out_rcu_unlock;128128- rc = -EPROTONOSUPPORT;129129- if (!protocol)130144 goto out_rcu_unlock;131145132146 sock->ops = answer->ops;133133-134147 answer_prot = answer->prot;135148 answer_no_check = answer->no_check;136149 answer_flags = answer->flags;···154135155136 BUG_TRAP(answer_prot->slab != NULL);156137157157- rc = -ENOBUFS;138138+ err = -ENOBUFS;158139 sk = sk_alloc(PF_INET6, GFP_KERNEL, answer_prot, 1);159140 if (sk == NULL)160141 goto out;161142162143 sock_init_data(sock, sk);163144164164- rc = 0;145145+ err = 0;165146 sk->sk_no_check = answer_no_check;166147 if (INET_PROTOSW_REUSE & answer_flags)167148 sk->sk_reuse = 1;···221202 sk->sk_prot->hash(sk);222203 }223204 if (sk->sk_prot->init) {224224- rc = sk->sk_prot->init(sk);225225- if (rc) {205205+ err = sk->sk_prot->init(sk);206206+ if (err) {226207 sk_common_release(sk);227208 goto out;228209 }229210 }230211out:231231- return rc;212212+ return err;232213out_rcu_unlock:233214 rcu_read_unlock();234215 goto out;
+5
net/ipv6/mcast.c
···12311231 if (skb->pkt_type == PACKET_LOOPBACK)12321232 return 0;1233123312341234+ /* send our report if the MC router may not have heard this report */12351235+ if (skb->pkt_type != PACKET_MULTICAST &&12361236+ skb->pkt_type != PACKET_BROADCAST)12371237+ return 0;12381238+12341239 if (!pskb_may_pull(skb, sizeof(struct in6_addr)))12351240 return -EINVAL;12361241
+5-5
net/sctp/socket.c
···47434743 struct sk_buff *skb;47444744 long timeo;4745474547464746- /* Caller is allowed not to check sk->sk_err before calling. */47474747- error = sock_error(sk);47484748- if (error)47494749- goto no_packet;47504750-47514746 timeo = sock_rcvtimeo(sk, noblock);4752474747534748 SCTP_DEBUG_PRINTK("Timeout: timeo: %ld, MAX: %ld.\n",···4768477347694774 if (skb)47704775 return skb;47764776+47774777+ /* Caller is allowed not to check sk->sk_err before calling. */47784778+ error = sock_error(sk);47794779+ if (error)47804780+ goto no_packet;4771478147724782 if (sk->sk_shutdown & RCV_SHUTDOWN)47734783 break;
+2-1
net/sctp/transport.c
···261261 * association's active path for getsockname().262262 */ 263263 if (asoc && (transport == asoc->peer.active_path))264264- af->to_sk_saddr(&transport->saddr, asoc->base.sk);264264+ opt->pf->af->to_sk_saddr(&transport->saddr,265265+ asoc->base.sk);265266 } else266267 transport->pmtu = SCTP_DEFAULT_MAXSEGMENT;267268}