···17681768 case XCVR_MII: case XCVR_NWAY:17691769 {17701770 ok = 1;17711771- spin_lock_bh(&vp->lock);17711771+ /* Interrupts are already disabled */17721772+ spin_lock(&vp->lock);17721773 vortex_check_media(dev, 0);17731773- spin_unlock_bh(&vp->lock);17741774+ spin_unlock(&vp->lock);17741775 }17751776 break;17761777 default: /* Other media types handled by Tx timeouts. */
···7272 struct b43_wldev *dev = led->dev;7373 bool radio_enabled;74747575+ if (unlikely(b43_status(dev) < B43_STAT_INITIALIZED))7676+ return;7777+7578 /* Checking the radio-enabled status here is slightly racy,7679 * but we want to avoid the locking overhead and we don't care7780 * whether the LED has the wrong state for a second. */
+8-4
drivers/net/wireless/b43/main.c
···2976297629772977 if (unlikely(skb->len < 2 + 2 + 6)) {29782978 /* Too short, this can't be a valid frame. */29792979- dev_kfree_skb_any(skb);29802980- return NETDEV_TX_OK;29792979+ goto drop_packet;29812980 }29822981 B43_WARN_ON(skb_shinfo(skb)->nr_frags);29832982 if (unlikely(!dev))29842984- return NETDEV_TX_BUSY;29832983+ goto drop_packet;2985298429862985 /* Transmissions on seperate queues can run concurrently. */29872986 read_lock_irqsave(&wl->tx_lock, flags);···29962997 read_unlock_irqrestore(&wl->tx_lock, flags);2997299829982999 if (unlikely(err))29992999- return NETDEV_TX_BUSY;30003000+ goto drop_packet;30013001+ return NETDEV_TX_OK;30023002+30033003+drop_packet:30043004+ /* We can not transmit this packet. Drop it. */30053005+ dev_kfree_skb_any(skb);30003006 return NETDEV_TX_OK;30013007}30023008
···276276 cancel_delayed_work(&priv->scan_check);277277278278 IWL_DEBUG_INFO("Scan pass on %sGHz took %dms\n",279279- (priv->scan_bands == 2) ? "2.4" : "5.2",279279+ (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ)) ?280280+ "2.4" : "5.2",280281 jiffies_to_msecs(elapsed_jiffies281282 (priv->scan_pass_start, jiffies)));282283283283- /* Remove this scanned band from the list284284- * of pending bands to scan */285285- priv->scan_bands--;284284+ /* Remove this scanned band from the list of pending285285+ * bands to scan, band G precedes A in order of scanning286286+ * as seen in iwl_bg_request_scan */287287+ if (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ))288288+ priv->scan_bands &= ~BIT(IEEE80211_BAND_2GHZ);289289+ else if (priv->scan_bands & BIT(IEEE80211_BAND_5GHZ))290290+ priv->scan_bands &= ~BIT(IEEE80211_BAND_5GHZ);286291287292 /* If a request to abort was given, or the scan did not succeed288293 * then we reset the scan state machine and terminate,···297292 clear_bit(STATUS_SCAN_ABORTING, &priv->status);298293 } else {299294 /* If there are more bands on this scan pass reschedule */300300- if (priv->scan_bands > 0)295295+ if (priv->scan_bands)301296 goto reschedule;302297 }303298···394389395390 ch_info = iwl_get_channel_info(priv, band, scan_ch->channel);396391 if (!is_channel_valid(ch_info)) {397397- IWL_DEBUG_SCAN("Channel %d is INVALID for this SKU.\n",392392+ IWL_DEBUG_SCAN("Channel %d is INVALID for this band.\n",398393 scan_ch->channel);399394 continue;400395 }···470465 }471466472467 IWL_DEBUG_INFO("Starting scan...\n");473473- priv->scan_bands = 2;468468+ if (priv->cfg->sku & IWL_SKU_G)469469+ priv->scan_bands |= BIT(IEEE80211_BAND_2GHZ);470470+ if (priv->cfg->sku & IWL_SKU_A)471471+ priv->scan_bands |= BIT(IEEE80211_BAND_5GHZ);474472 set_bit(STATUS_SCANNING, &priv->status);475473 priv->scan_start = jiffies;476474 priv->scan_pass_start = priv->scan_start;···811803 scan->tx_cmd.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE;812804813805814814- switch (priv->scan_bands) {815815- case 2:806806+ if (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ)) {816807 band = IEEE80211_BAND_2GHZ;817808 scan->flags = RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK;818809 tx_ant = iwl_scan_tx_ant(priv, band);···825818 tx_ant |826819 RATE_MCS_CCK_MSK);827820 scan->good_CRC_th = 0;828828- break;829829-830830- case 1:821821+ } else if (priv->scan_bands & BIT(IEEE80211_BAND_5GHZ)) {831822 band = IEEE80211_BAND_5GHZ;832823 tx_ant = iwl_scan_tx_ant(priv, band);833824 scan->tx_cmd.rate_n_flags =···838833 * MIMO is not used here, but value is required */839834 if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_4965)840835 rx_chain = 0x6;841841-842842- break;843843- default:836836+ } else {844837 IWL_WARNING("Invalid scan band count\n");845838 goto done;846839 }
+18-15
drivers/net/wireless/iwlwifi/iwl3945-base.c
···22172217 }2218221822192219 IWL_DEBUG_INFO("Starting scan...\n");22202220- priv->scan_bands = 2;22202220+ if (priv->cfg->sku & IWL_SKU_G)22212221+ priv->scan_bands |= BIT(IEEE80211_BAND_2GHZ);22222222+ if (priv->cfg->sku & IWL_SKU_A)22232223+ priv->scan_bands |= BIT(IEEE80211_BAND_5GHZ);22212224 set_bit(STATUS_SCANNING, &priv->status);22222225 priv->scan_start = jiffies;22232226 priv->scan_pass_start = priv->scan_start;···33453342 cancel_delayed_work(&priv->scan_check);3346334333473344 IWL_DEBUG_INFO("Scan pass on %sGHz took %dms\n",33483348- (priv->scan_bands == 2) ? "2.4" : "5.2",33453345+ (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ)) ?33463346+ "2.4" : "5.2",33493347 jiffies_to_msecs(elapsed_jiffies33503348 (priv->scan_pass_start, jiffies)));3351334933523352- /* Remove this scanned band from the list33533353- * of pending bands to scan */33543354- priv->scan_bands--;33503350+ /* Remove this scanned band from the list of pending33513351+ * bands to scan, band G precedes A in order of scanning33523352+ * as seen in iwl3945_bg_request_scan */33533353+ if (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ))33543354+ priv->scan_bands &= ~BIT(IEEE80211_BAND_2GHZ);33553355+ else if (priv->scan_bands & BIT(IEEE80211_BAND_5GHZ))33563356+ priv->scan_bands &= ~BIT(IEEE80211_BAND_5GHZ);3355335733563358 /* If a request to abort was given, or the scan did not succeed33573359 * then we reset the scan state machine and terminate,···4969496149704962 ch_info = iwl3945_get_channel_info(priv, band, scan_ch->channel);49714963 if (!is_channel_valid(ch_info)) {49724972- IWL_DEBUG_SCAN("Channel %d is INVALID for this SKU.\n",49644964+ IWL_DEBUG_SCAN("Channel %d is INVALID for this band.\n",49734965 scan_ch->channel);49744966 continue;49754967 }···6324631663256317 /* flags + rate selection */6326631863276327- switch (priv->scan_bands) {63286328- case 2:63196319+ if (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ)) {63296320 scan->flags = RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK;63306321 scan->tx_cmd.rate = IWL_RATE_1M_PLCP;63316322 scan->good_CRC_th = 0;63326323 band = IEEE80211_BAND_2GHZ;63336333- break;63346334-63356335- case 1:63246324+ } else if (priv->scan_bands & BIT(IEEE80211_BAND_5GHZ)) {63366325 scan->tx_cmd.rate = IWL_RATE_6M_PLCP;63376326 scan->good_CRC_th = IWL_GOOD_CRC_TH;63386327 band = IEEE80211_BAND_5GHZ;63396339- break;63406340-63416341- default:63286328+ } else {63426329 IWL_WARNING("Invalid scan band count\n");63436330 goto done;63446331 }···67736770 ch_info = iwl3945_get_channel_info(priv, conf->channel->band,67746771 conf->channel->hw_value);67756772 if (!is_channel_valid(ch_info)) {67766776- IWL_DEBUG_SCAN("Channel %d [%d] is INVALID for this SKU.\n",67736773+ IWL_DEBUG_SCAN("Channel %d [%d] is INVALID for this band.\n",67776774 conf->channel->hw_value, conf->channel->band);67786775 IWL_DEBUG_MAC80211("leave - invalid channel\n");67796776 spin_unlock_irqrestore(&priv->lock, flags);
···74747575 rt2x00lib_reset_link_tuner(rt2x00dev);76767777- queue_delayed_work(rt2x00dev->hw->workqueue,7777+ queue_delayed_work(rt2x00dev->workqueue,7878 &rt2x00dev->link.work, LINK_TUNE_INTERVAL);7979}8080···136136{137137 if (!__test_and_clear_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags))138138 return;139139-140140- /*141141- * Stop all scheduled work.142142- */143143- if (work_pending(&rt2x00dev->intf_work))144144- cancel_work_sync(&rt2x00dev->intf_work);145145- if (work_pending(&rt2x00dev->filter_work))146146- cancel_work_sync(&rt2x00dev->filter_work);147139148140 /*149141 * Stop the TX queues.···392400 * Increase tuner counter, and reschedule the next link tuner run.393401 */394402 rt2x00dev->link.count++;395395- queue_delayed_work(rt2x00dev->hw->workqueue, &rt2x00dev->link.work,396396- LINK_TUNE_INTERVAL);403403+ queue_delayed_work(rt2x00dev->workqueue,404404+ &rt2x00dev->link.work, LINK_TUNE_INTERVAL);397405}398406399407static void rt2x00lib_packetfilter_scheduled(struct work_struct *work)···426434427435 spin_unlock(&intf->lock);428436437437+ /*438438+ * It is possible the radio was disabled while the work had been439439+ * scheduled. If that happens we should return here immediately,440440+ * note that in the spinlock protected area above the delayed_flags441441+ * have been cleared correctly.442442+ */443443+ if (!test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags))444444+ return;445445+429446 if (delayed_flags & DELAYED_UPDATE_BEACON) {430447 skb = ieee80211_beacon_get(rt2x00dev->hw, vif);431448 if (skb &&···443442 }444443445444 if (delayed_flags & DELAYED_CONFIG_ERP)446446- rt2x00lib_config_erp(rt2x00dev, intf, &intf->conf);445445+ rt2x00lib_config_erp(rt2x00dev, intf, &conf);447446448447 if (delayed_flags & DELAYED_LED_ASSOC)449448 rt2x00leds_led_assoc(rt2x00dev, !!rt2x00dev->intf_associated);···489488 rt2x00lib_beacondone_iter,490489 rt2x00dev);491490492492- queue_work(rt2x00dev->hw->workqueue, &rt2x00dev->intf_work);491491+ queue_work(rt2x00dev->workqueue, &rt2x00dev->intf_work);493492}494493EXPORT_SYMBOL_GPL(rt2x00lib_beacondone);495494···10041003 /*10051004 * Initialize configuration work.10061005 */10061006+ rt2x00dev->workqueue = create_singlethread_workqueue("rt2x00lib");10071007+ if (!rt2x00dev->workqueue)10081008+ goto exit;10091009+10071010 INIT_WORK(&rt2x00dev->intf_work, rt2x00lib_intf_scheduled);10081011 INIT_WORK(&rt2x00dev->filter_work, rt2x00lib_packetfilter_scheduled);10091012 INIT_DELAYED_WORK(&rt2x00dev->link.work, rt2x00lib_link_tuner);···10661061 rt2x00debug_deregister(rt2x00dev);10671062 rt2x00rfkill_free(rt2x00dev);10681063 rt2x00leds_unregister(rt2x00dev);10641064+10651065+ /*10661066+ * Stop all queued work. Note that most tasks will already be halted10671067+ * during rt2x00lib_disable_radio() and rt2x00lib_uninitialize().10681068+ */10691069+ flush_workqueue(rt2x00dev->workqueue);10701070+ destroy_workqueue(rt2x00dev->workqueue);1069107110701072 /*10711073 * Free ieee80211_hw memory.
···134134 * Wait until the BBP becomes ready.135135 */136136 reg = rt73usb_bbp_check(rt2x00dev);137137- if (rt2x00_get_field32(reg, PHY_CSR3_BUSY)) {138138- ERROR(rt2x00dev, "PHY_CSR3 register busy. Write failed.\n");139139- mutex_unlock(&rt2x00dev->usb_cache_mutex);140140- return;141141- }137137+ if (rt2x00_get_field32(reg, PHY_CSR3_BUSY))138138+ goto exit_fail;142139143140 /*144141 * Write the data into the BBP.···148151149152 rt73usb_register_write_lock(rt2x00dev, PHY_CSR3, reg);150153 mutex_unlock(&rt2x00dev->usb_cache_mutex);154154+155155+ return;156156+157157+exit_fail:158158+ mutex_unlock(&rt2x00dev->usb_cache_mutex);159159+160160+ ERROR(rt2x00dev, "PHY_CSR3 register busy. Write failed.\n");151161}152162153163static void rt73usb_bbp_read(struct rt2x00_dev *rt2x00dev,···168164 * Wait until the BBP becomes ready.169165 */170166 reg = rt73usb_bbp_check(rt2x00dev);171171- if (rt2x00_get_field32(reg, PHY_CSR3_BUSY)) {172172- ERROR(rt2x00dev, "PHY_CSR3 register busy. Read failed.\n");173173- mutex_unlock(&rt2x00dev->usb_cache_mutex);174174- return;175175- }167167+ if (rt2x00_get_field32(reg, PHY_CSR3_BUSY))168168+ goto exit_fail;176169177170 /*178171 * Write the request into the BBP.···185184 * Wait until the BBP becomes ready.186185 */187186 reg = rt73usb_bbp_check(rt2x00dev);188188- if (rt2x00_get_field32(reg, PHY_CSR3_BUSY)) {189189- ERROR(rt2x00dev, "PHY_CSR3 register busy. Read failed.\n");190190- *value = 0xff;191191- return;192192- }187187+ if (rt2x00_get_field32(reg, PHY_CSR3_BUSY))188188+ goto exit_fail;193189194190 *value = rt2x00_get_field32(reg, PHY_CSR3_VALUE);195191 mutex_unlock(&rt2x00dev->usb_cache_mutex);192192+193193+ return;194194+195195+exit_fail:196196+ mutex_unlock(&rt2x00dev->usb_cache_mutex);197197+198198+ ERROR(rt2x00dev, "PHY_CSR3 register busy. Read failed.\n");199199+ *value = 0xff;196200}197201198202static void rt73usb_rf_write(struct rt2x00_dev *rt2x00dev,
+5-1
include/linux/inet_lro.h
···8484 from received packets and eth protocol8585 is still ETH_P_8021Q */86868787- u32 ip_summed; /* Set in non generated SKBs in page mode */8787+ /*8888+ * Set for generated SKBs that are not added to8989+ * the frag list in fragmented mode9090+ */9191+ u32 ip_summed;8892 u32 ip_summed_aggr; /* Set in aggregated SKBs: CHECKSUM_UNNECESSARY8993 * or CHECKSUM_NONE */9094
+4
include/linux/netdevice.h
···8888#define NETDEV_TX_BUSY 1 /* driver tx path was busy*/8989#define NETDEV_TX_LOCKED -1 /* driver tx lock was already taken */90909191+#ifdef __KERNEL__9292+9193/*9294 * Compute the worst case header length according to the protocols9395 * used.···115113#else116114#define MAX_HEADER (LL_MAX_HEADER + 48)117115#endif116116+117117+#endif /* __KERNEL__ */118118119119struct net_device_subqueue120120{
···9595#ifdef CONFIG_NET_NS9696extern void __put_net(struct net *net);97979898+static inline int net_alive(struct net *net)9999+{100100+ return net && atomic_read(&net->count);101101+}102102+98103static inline struct net *get_net(struct net *net)99104{100105 atomic_inc(&net->count);···130125 return net1 == net2;131126}132127#else128128+129129+static inline int net_alive(struct net *net)130130+{131131+ return 1;132132+}133133+133134static inline struct net *get_net(struct net *net)134135{135136 return net;
+5-1
net/core/dev.c
···2107210721082108 rcu_read_lock();2109210921102110+ /* Don't receive packets in an exiting network namespace */21112111+ if (!net_alive(dev_net(skb->dev)))21122112+ goto out;21132113+21102114#ifdef CONFIG_NET_CLS_ACT21112115 if (skb->tc_verd & TC_NCLS) {21122116 skb->tc_verd = CLR_TC_NCLS(skb->tc_verd);···30383034/**30393035 * dev_unicast_add - add a secondary unicast address30403036 * @dev: device30413041- * @addr: address to delete30373037+ * @addr: address to add30423038 * @alen: length of @addr30433039 *30443040 * Add a secondary unicast address to the device or increase
+3
net/core/net_namespace.c
···140140 struct pernet_operations *ops;141141 struct net *net;142142143143+ /* Be very certain incoming network packets will not find us */144144+ rcu_barrier();145145+143146 net = container_of(work, struct net, work);144147145148 mutex_lock(&net_mutex);
+12-5
net/core/skbuff.c
···12901290{12911291 unsigned int nr_pages = spd->nr_pages;12921292 unsigned int poff, plen, len, toff, tlen;12931293- int headlen, seg;12931293+ int headlen, seg, error = 0;1294129412951295 toff = *offset;12961296 tlen = *total_len;12971297- if (!tlen)12971297+ if (!tlen) {12981298+ error = 1;12981299 goto err;13001300+ }1299130113001302 /*13011303 * if the offset is greater than the linear part, go directly to···13391337 * just jump directly to update and return, no point13401338 * in going over fragments when the output is full.13411339 */13421342- if (spd_fill_page(spd, virt_to_page(p), plen, poff, skb))13401340+ error = spd_fill_page(spd, virt_to_page(p), plen, poff, skb);13411341+ if (error)13431342 goto done;1344134313451344 tlen -= plen;···13701367 if (!plen)13711368 break;1372136913731373- if (spd_fill_page(spd, f->page, plen, poff, skb))13701370+ error = spd_fill_page(spd, f->page, plen, poff, skb);13711371+ if (error)13741372 break;1375137313761374 tlen -= plen;···13841380 return 0;13851381 }13861382err:13871387- return 1;13831383+ /* update the offset to reflect the linear part skip, if any */13841384+ if (!error)13851385+ *offset = toff;13861386+ return error;13881387}1389138813901389/*
+11-5
net/ipv4/inet_fragment.c
···192192193193static struct inet_frag_queue *inet_frag_intern(struct netns_frags *nf,194194 struct inet_frag_queue *qp_in, struct inet_frags *f,195195- unsigned int hash, void *arg)195195+ void *arg)196196{197197 struct inet_frag_queue *qp;198198#ifdef CONFIG_SMP199199 struct hlist_node *n;200200#endif201201+ unsigned int hash;201202202203 write_lock(&f->lock);204204+ /*205205+ * While we stayed w/o the lock other CPU could update206206+ * the rnd seed, so we need to re-calculate the hash207207+ * chain. Fortunatelly the qp_in can be used to get one.208208+ */209209+ hash = f->hashfn(qp_in);203210#ifdef CONFIG_SMP204211 /* With SMP race we have to recheck hash table, because205212 * such entry could be created on other cpu, while we···254247}255248256249static struct inet_frag_queue *inet_frag_create(struct netns_frags *nf,257257- struct inet_frags *f, void *arg, unsigned int hash)250250+ struct inet_frags *f, void *arg)258251{259252 struct inet_frag_queue *q;260253···262255 if (q == NULL)263256 return NULL;264257265265- return inet_frag_intern(nf, q, f, hash, arg);258258+ return inet_frag_intern(nf, q, f, arg);266259}267260268261struct inet_frag_queue *inet_frag_find(struct netns_frags *nf,···271264 struct inet_frag_queue *q;272265 struct hlist_node *n;273266274274- read_lock(&f->lock);275267 hlist_for_each_entry(q, n, &f->hash[hash], list) {276268 if (q->net == nf && f->match(q, key)) {277269 atomic_inc(&q->refcnt);···280274 }281275 read_unlock(&f->lock);282276283283- return inet_frag_create(nf, f, key, hash);277277+ return inet_frag_create(nf, f, key);284278}285279EXPORT_SYMBOL(inet_frag_find);
+1-2
net/ipv4/inet_lro.c
···383383out2: /* send aggregated SKBs to stack */384384 lro_flush(lro_mgr, lro_desc);385385386386-out: /* Original SKB has to be posted to stack */387387- skb->ip_summed = lro_mgr->ip_summed;386386+out:388387 return 1;389388}390389
···100100 if (hdr->version != 6)101101 goto err;102102103103+ /*104104+ * RFC4291 2.5.3105105+ * A packet received on an interface with a destination address106106+ * of loopback must be dropped.107107+ */108108+ if (!(dev->flags & IFF_LOOPBACK) &&109109+ ipv6_addr_loopback(&hdr->daddr))110110+ goto err;111111+103112 skb->transport_header = skb->network_header + sizeof(*hdr);104113 IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr);105114
+7-4
net/ipv6/ipv6_sockglue.c
···343343 case IPV6_DSTOPTS:344344 {345345 struct ipv6_txoptions *opt;346346+347347+ /* remove any sticky options header with a zero option348348+ * length, per RFC3542.349349+ */346350 if (optlen == 0)347351 optval = NULL;352352+ else if (optlen < sizeof(struct ipv6_opt_hdr) ||353353+ optlen & 0x7 || optlen > 8 * 255)354354+ goto e_inval;348355349356 /* hop-by-hop / destination options are privileged option */350357 retv = -EPERM;351358 if (optname != IPV6_RTHDR && !capable(CAP_NET_RAW))352359 break;353353-354354- if (optlen < sizeof(struct ipv6_opt_hdr) ||355355- optlen & 0x7 || optlen > 8 * 255)356356- goto e_inval;357360358361 opt = ipv6_renew_options(sk, np->opt, optname,359362 (struct ipv6_opt_hdr __user *)optval,
···387387 if (!key)388388 return;389389390390+ if (!key->sdata) {391391+ /* The key has not been linked yet, simply free it392392+ * and don't Oops */393393+ if (key->conf.alg == ALG_CCMP)394394+ ieee80211_aes_key_free(key->u.ccmp.tfm);395395+ kfree(key);396396+ return;397397+ }398398+390399 spin_lock_irqsave(&key->sdata->local->key_lock, flags);391400 __ieee80211_key_free(key);392401 spin_unlock_irqrestore(&key->sdata->local->key_lock, flags);
+1-1
net/netlabel/netlabel_unlabeled.c
···15341534 }15351535 }15361536 list_for_each_entry_rcu(addr6, &iface->addr6_list, list) {15371537- if (addr6->valid || iter_addr6++ < skip_addr6)15371537+ if (!addr6->valid || iter_addr6++ < skip_addr6)15381538 continue;15391539 if (netlbl_unlabel_staticlist_gen(NLBL_UNLABEL_C_STATICLISTDEF,15401540 iface,
+4-3
net/netlink/attr.c
···132132 * @maxtype: maximum attribute type to be expected133133 * @head: head of attribute stream134134 * @len: length of attribute stream135135+ * @policy: validation policy135136 *136137 * Parses a stream of attributes and stores a pointer to each attribute in137138 * the tb array accessable via the attribute type. Attributes with a type···195194/**196195 * nla_strlcpy - Copy string attribute payload into a sized buffer197196 * @dst: where to copy the string to198198- * @src: attribute to copy the string from197197+ * @nla: attribute to copy the string from199198 * @dstsize: size of destination buffer200199 *201200 * Copies at most dstsize - 1 bytes into the destination buffer.···341340}342341343342/**344344- * nla_reserve - reserve room for attribute without header343343+ * nla_reserve_nohdr - reserve room for attribute without header345344 * @skb: socket buffer to reserve room on346346- * @len: length of attribute payload345345+ * @attrlen: length of attribute payload347346 *348347 * Reserves room for attribute payload without a header.349348 *
-11
net/sched/Kconfig
···106106 To compile this code as a module, choose M here: the107107 module will be called sch_prio.108108109109-config NET_SCH_RR110110- tristate "Multi Band Round Robin Queuing (RR)"111111- select NET_SCH_PRIO112112- ---help---113113- Say Y here if you want to use an n-band round robin packet114114- scheduler.115115-116116- The module uses sch_prio for its framework and is aliased as117117- sch_rr, so it will load sch_prio, although it is referred118118- to using sch_rr.119119-120109config NET_SCH_RED121110 tristate "Random Early Detection (RED)"122111 ---help---
···45124512 if (copy_from_user(&getaddrs, optval, len))45134513 return -EFAULT;4514451445154515- if (getaddrs.addr_num <= 0) return -EINVAL;45154515+ if (getaddrs.addr_num <= 0 ||45164516+ getaddrs.addr_num >= (INT_MAX / sizeof(union sctp_addr)))45174517+ return -EINVAL;45164518 /*45174519 * For UDP-style sockets, id specifies the association to query.45184520 * If the id field is set to the value '0' then the locally bound
+24-28
net/unix/af_unix.c
···485485static int unix_accept(struct socket *, struct socket *, int);486486static int unix_getname(struct socket *, struct sockaddr *, int *, int);487487static unsigned int unix_poll(struct file *, struct socket *, poll_table *);488488-static unsigned int unix_datagram_poll(struct file *, struct socket *,489489- poll_table *);488488+static unsigned int unix_dgram_poll(struct file *, struct socket *,489489+ poll_table *);490490static int unix_ioctl(struct socket *, unsigned int, unsigned long);491491static int unix_shutdown(struct socket *, int);492492static int unix_stream_sendmsg(struct kiocb *, struct socket *,···532532 .socketpair = unix_socketpair,533533 .accept = sock_no_accept,534534 .getname = unix_getname,535535- .poll = unix_datagram_poll,535535+ .poll = unix_dgram_poll,536536 .ioctl = unix_ioctl,537537 .listen = sock_no_listen,538538 .shutdown = unix_shutdown,···553553 .socketpair = unix_socketpair,554554 .accept = unix_accept,555555 .getname = unix_getname,556556- .poll = unix_datagram_poll,556556+ .poll = unix_dgram_poll,557557 .ioctl = unix_ioctl,558558 .listen = unix_listen,559559 .shutdown = unix_shutdown,···19921992 return mask;19931993}1994199419951995-static unsigned int unix_datagram_poll(struct file *file, struct socket *sock,19961996- poll_table *wait)19951995+static unsigned int unix_dgram_poll(struct file *file, struct socket *sock,19961996+ poll_table *wait)19971997{19981998- struct sock *sk = sock->sk, *peer;19991999- unsigned int mask;19981998+ struct sock *sk = sock->sk, *other;19991999+ unsigned int mask, writable;2000200020012001 poll_wait(file, sk->sk_sleep, wait);20022002-20032003- peer = unix_peer_get(sk);20042004- if (peer) {20052005- if (peer != sk) {20062006- /*20072007- * Writability of a connected socket additionally20082008- * depends on the state of the receive queue of the20092009- * peer.20102010- */20112011- poll_wait(file, &unix_sk(peer)->peer_wait, wait);20122012- } else {20132013- sock_put(peer);20142014- peer = NULL;20152015- }20162016- }20172017-20182002 mask = 0;2019200320202004 /* exceptional events? */···20242040 }2025204120262042 /* writable? */20272027- if (unix_writable(sk) && !(peer && unix_recvq_full(peer)))20432043+ writable = unix_writable(sk);20442044+ if (writable) {20452045+ other = unix_peer_get(sk);20462046+ if (other) {20472047+ if (unix_peer(other) != sk) {20482048+ poll_wait(file, &unix_sk(other)->peer_wait,20492049+ wait);20502050+ if (unix_recvq_full(other))20512051+ writable = 0;20522052+ }20532053+20542054+ sock_put(other);20552055+ }20562056+ }20572057+20582058+ if (writable)20282059 mask |= POLLOUT | POLLWRNORM | POLLWRBAND;20292060 else20302061 set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags);20312031-20322032- if (peer)20332033- sock_put(peer);2034206220352063 return mask;20362064}