diff options
| -rw-r--r-- | MAINTAINERS | 6 | ||||
| -rw-r--r-- | drivers/dma/ioatdma.c | 18 | ||||
| -rw-r--r-- | drivers/isdn/i4l/isdn_bsdcomp.c | 5 | ||||
| -rw-r--r-- | drivers/isdn/i4l/isdn_common.c | 2 | ||||
| -rw-r--r-- | drivers/net/bsd_comp.c | 6 | ||||
| -rw-r--r-- | drivers/net/eql.c | 2 | ||||
| -rw-r--r-- | drivers/net/irda/kingsun-sir.c | 4 | ||||
| -rw-r--r-- | drivers/net/slip.c | 2 | ||||
| -rw-r--r-- | include/linux/Kbuild | 1 | ||||
| -rw-r--r-- | include/linux/if_pppol2tp.h | 4 | ||||
| -rw-r--r-- | net/8021q/vlan_dev.c | 12 | ||||
| -rw-r--r-- | net/bridge/br_netfilter.c | 12 | ||||
| -rw-r--r-- | net/core/dev_mcast.c | 14 | ||||
| -rw-r--r-- | net/core/neighbour.c | 3 | ||||
| -rw-r--r-- | net/ipv4/ah4.c | 2 | ||||
| -rw-r--r-- | net/ipv4/ip_sockglue.c | 4 | ||||
| -rw-r--r-- | net/ipv4/tcp_input.c | 10 | ||||
| -rw-r--r-- | net/ipv6/ipv6_sockglue.c | 4 |
18 files changed, 70 insertions, 41 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 10a6f57776b2..48ca8b47150d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -2661,6 +2661,12 @@ L: netdev@vger.kernel.org | |||
| 2661 | T: git kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6.git | 2661 | T: git kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6.git |
| 2662 | S: Maintained | 2662 | S: Maintained |
| 2663 | 2663 | ||
| 2664 | NETWORKING [LABELED] (NetLabel, CIPSO, Labeled IPsec, SECMARK) | ||
| 2665 | P: Paul Moore | ||
| 2666 | M: paul.moore@hp.com | ||
| 2667 | L: netdev@vger.kernel.org | ||
| 2668 | S: Maintained | ||
| 2669 | |||
| 2664 | NETWORKING [WIRELESS] | 2670 | NETWORKING [WIRELESS] |
| 2665 | P: John W. Linville | 2671 | P: John W. Linville |
| 2666 | M: linville@tuxdriver.com | 2672 | M: linville@tuxdriver.com |
diff --git a/drivers/dma/ioatdma.c b/drivers/dma/ioatdma.c index 2d1f17865b64..41b18c5a3141 100644 --- a/drivers/dma/ioatdma.c +++ b/drivers/dma/ioatdma.c | |||
| @@ -191,17 +191,12 @@ static int ioat_dma_alloc_chan_resources(struct dma_chan *chan) | |||
| 191 | int i; | 191 | int i; |
| 192 | LIST_HEAD(tmp_list); | 192 | LIST_HEAD(tmp_list); |
| 193 | 193 | ||
| 194 | /* | 194 | /* have we already been set up? */ |
| 195 | * In-use bit automatically set by reading chanctrl | 195 | if (!list_empty(&ioat_chan->free_desc)) |
| 196 | * If 0, we got it, if 1, someone else did | 196 | return INITIAL_IOAT_DESC_COUNT; |
| 197 | */ | ||
| 198 | chanctrl = readw(ioat_chan->reg_base + IOAT_CHANCTRL_OFFSET); | ||
| 199 | if (chanctrl & IOAT_CHANCTRL_CHANNEL_IN_USE) | ||
| 200 | return -EBUSY; | ||
| 201 | 197 | ||
| 202 | /* Setup register to interrupt and write completion status on error */ | 198 | /* Setup register to interrupt and write completion status on error */ |
| 203 | chanctrl = IOAT_CHANCTRL_CHANNEL_IN_USE | | 199 | chanctrl = IOAT_CHANCTRL_ERR_INT_EN | |
| 204 | IOAT_CHANCTRL_ERR_INT_EN | | ||
| 205 | IOAT_CHANCTRL_ANY_ERR_ABORT_EN | | 200 | IOAT_CHANCTRL_ANY_ERR_ABORT_EN | |
| 206 | IOAT_CHANCTRL_ERR_COMPLETION_EN; | 201 | IOAT_CHANCTRL_ERR_COMPLETION_EN; |
| 207 | writew(chanctrl, ioat_chan->reg_base + IOAT_CHANCTRL_OFFSET); | 202 | writew(chanctrl, ioat_chan->reg_base + IOAT_CHANCTRL_OFFSET); |
| @@ -282,11 +277,6 @@ static void ioat_dma_free_chan_resources(struct dma_chan *chan) | |||
| 282 | in_use_descs - 1); | 277 | in_use_descs - 1); |
| 283 | 278 | ||
| 284 | ioat_chan->last_completion = ioat_chan->completion_addr = 0; | 279 | ioat_chan->last_completion = ioat_chan->completion_addr = 0; |
| 285 | |||
| 286 | /* Tell hw the chan is free */ | ||
| 287 | chanctrl = readw(ioat_chan->reg_base + IOAT_CHANCTRL_OFFSET); | ||
| 288 | chanctrl &= ~IOAT_CHANCTRL_CHANNEL_IN_USE; | ||
| 289 | writew(chanctrl, ioat_chan->reg_base + IOAT_CHANCTRL_OFFSET); | ||
| 290 | } | 280 | } |
| 291 | 281 | ||
| 292 | static struct dma_async_tx_descriptor * | 282 | static struct dma_async_tx_descriptor * |
diff --git a/drivers/isdn/i4l/isdn_bsdcomp.c b/drivers/isdn/i4l/isdn_bsdcomp.c index 90a23795db7e..02d9918705dd 100644 --- a/drivers/isdn/i4l/isdn_bsdcomp.c +++ b/drivers/isdn/i4l/isdn_bsdcomp.c | |||
| @@ -341,7 +341,7 @@ static void *bsd_alloc (struct isdn_ppp_comp_data *data) | |||
| 341 | * Allocate space for the dictionary. This may be more than one page in | 341 | * Allocate space for the dictionary. This may be more than one page in |
| 342 | * length. | 342 | * length. |
| 343 | */ | 343 | */ |
| 344 | db->dict = (struct bsd_dict *) vmalloc (hsize * sizeof (struct bsd_dict)); | 344 | db->dict = vmalloc(hsize * sizeof(struct bsd_dict)); |
| 345 | if (!db->dict) { | 345 | if (!db->dict) { |
| 346 | bsd_free (db); | 346 | bsd_free (db); |
| 347 | return NULL; | 347 | return NULL; |
| @@ -354,8 +354,7 @@ static void *bsd_alloc (struct isdn_ppp_comp_data *data) | |||
| 354 | if (!decomp) | 354 | if (!decomp) |
| 355 | db->lens = NULL; | 355 | db->lens = NULL; |
| 356 | else { | 356 | else { |
| 357 | db->lens = (unsigned short *) vmalloc ((maxmaxcode + 1) * | 357 | db->lens = vmalloc((maxmaxcode + 1) * sizeof(db->lens[0])); |
| 358 | sizeof (db->lens[0])); | ||
| 359 | if (!db->lens) { | 358 | if (!db->lens) { |
| 360 | bsd_free (db); | 359 | bsd_free (db); |
| 361 | return (NULL); | 360 | return (NULL); |
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c index c97330b19877..ec5f4046412f 100644 --- a/drivers/isdn/i4l/isdn_common.c +++ b/drivers/isdn/i4l/isdn_common.c | |||
| @@ -2291,7 +2291,7 @@ static int __init isdn_init(void) | |||
| 2291 | int i; | 2291 | int i; |
| 2292 | char tmprev[50]; | 2292 | char tmprev[50]; |
| 2293 | 2293 | ||
| 2294 | if (!(dev = (isdn_dev *) vmalloc(sizeof(isdn_dev)))) { | 2294 | if (!(dev = vmalloc(sizeof(isdn_dev)))) { |
| 2295 | printk(KERN_WARNING "isdn: Could not allocate device-struct.\n"); | 2295 | printk(KERN_WARNING "isdn: Could not allocate device-struct.\n"); |
| 2296 | return -EIO; | 2296 | return -EIO; |
| 2297 | } | 2297 | } |
diff --git a/drivers/net/bsd_comp.c b/drivers/net/bsd_comp.c index 202d4a4ef751..88edb986691a 100644 --- a/drivers/net/bsd_comp.c +++ b/drivers/net/bsd_comp.c | |||
| @@ -406,8 +406,7 @@ static void *bsd_alloc (unsigned char *options, int opt_len, int decomp) | |||
| 406 | * Allocate space for the dictionary. This may be more than one page in | 406 | * Allocate space for the dictionary. This may be more than one page in |
| 407 | * length. | 407 | * length. |
| 408 | */ | 408 | */ |
| 409 | db->dict = (struct bsd_dict *) vmalloc (hsize * | 409 | db->dict = vmalloc(hsize * sizeof(struct bsd_dict)); |
| 410 | sizeof (struct bsd_dict)); | ||
| 411 | if (!db->dict) | 410 | if (!db->dict) |
| 412 | { | 411 | { |
| 413 | bsd_free (db); | 412 | bsd_free (db); |
| @@ -426,8 +425,7 @@ static void *bsd_alloc (unsigned char *options, int opt_len, int decomp) | |||
| 426 | */ | 425 | */ |
| 427 | else | 426 | else |
| 428 | { | 427 | { |
| 429 | db->lens = (unsigned short *) vmalloc ((maxmaxcode + 1) * | 428 | db->lens = vmalloc((maxmaxcode + 1) * sizeof(db->lens[0])); |
| 430 | sizeof (db->lens[0])); | ||
| 431 | if (!db->lens) | 429 | if (!db->lens) |
| 432 | { | 430 | { |
| 433 | bsd_free (db); | 431 | bsd_free (db); |
diff --git a/drivers/net/eql.c b/drivers/net/eql.c index a93700e5661a..102218c4a907 100644 --- a/drivers/net/eql.c +++ b/drivers/net/eql.c | |||
| @@ -391,7 +391,7 @@ static int __eql_insert_slave(slave_queue_t *queue, slave_t *slave) | |||
| 391 | slave_t *duplicate_slave = NULL; | 391 | slave_t *duplicate_slave = NULL; |
| 392 | 392 | ||
| 393 | duplicate_slave = __eql_find_slave_dev(queue, slave->dev); | 393 | duplicate_slave = __eql_find_slave_dev(queue, slave->dev); |
| 394 | if (duplicate_slave != 0) | 394 | if (duplicate_slave) |
| 395 | eql_kill_one_slave(queue, duplicate_slave); | 395 | eql_kill_one_slave(queue, duplicate_slave); |
| 396 | 396 | ||
| 397 | list_add(&slave->list, &queue->all_slaves); | 397 | list_add(&slave->list, &queue->all_slaves); |
diff --git a/drivers/net/irda/kingsun-sir.c b/drivers/net/irda/kingsun-sir.c index bdd5c979bead..4e5101a45c3c 100644 --- a/drivers/net/irda/kingsun-sir.c +++ b/drivers/net/irda/kingsun-sir.c | |||
| @@ -509,12 +509,12 @@ static int kingsun_probe(struct usb_interface *intf, | |||
| 509 | spin_lock_init(&kingsun->lock); | 509 | spin_lock_init(&kingsun->lock); |
| 510 | 510 | ||
| 511 | /* Allocate input buffer */ | 511 | /* Allocate input buffer */ |
| 512 | kingsun->in_buf = (__u8 *)kmalloc(kingsun->max_rx, GFP_KERNEL); | 512 | kingsun->in_buf = kmalloc(kingsun->max_rx, GFP_KERNEL); |
| 513 | if (!kingsun->in_buf) | 513 | if (!kingsun->in_buf) |
| 514 | goto free_mem; | 514 | goto free_mem; |
| 515 | 515 | ||
| 516 | /* Allocate output buffer */ | 516 | /* Allocate output buffer */ |
| 517 | kingsun->out_buf = (__u8 *)kmalloc(KINGSUN_FIFO_SIZE, GFP_KERNEL); | 517 | kingsun->out_buf = kmalloc(KINGSUN_FIFO_SIZE, GFP_KERNEL); |
| 518 | if (!kingsun->out_buf) | 518 | if (!kingsun->out_buf) |
| 519 | goto free_mem; | 519 | goto free_mem; |
| 520 | 520 | ||
diff --git a/drivers/net/slip.c b/drivers/net/slip.c index 65bd20fac820..3fd4735006f5 100644 --- a/drivers/net/slip.c +++ b/drivers/net/slip.c | |||
| @@ -957,7 +957,7 @@ slip_close(struct tty_struct *tty) | |||
| 957 | * STANDARD SLIP ENCAPSULATION * | 957 | * STANDARD SLIP ENCAPSULATION * |
| 958 | ************************************************************************/ | 958 | ************************************************************************/ |
| 959 | 959 | ||
| 960 | int | 960 | static int |
| 961 | slip_esc(unsigned char *s, unsigned char *d, int len) | 961 | slip_esc(unsigned char *s, unsigned char *d, int len) |
| 962 | { | 962 | { |
| 963 | unsigned char *ptr = d; | 963 | unsigned char *ptr = d; |
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index ad7f71a81b0a..818cc3a50e6b 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
| @@ -7,6 +7,7 @@ header-y += raid/ | |||
| 7 | header-y += spi/ | 7 | header-y += spi/ |
| 8 | header-y += sunrpc/ | 8 | header-y += sunrpc/ |
| 9 | header-y += tc_act/ | 9 | header-y += tc_act/ |
| 10 | header-y += tc_ematch/ | ||
| 10 | header-y += netfilter/ | 11 | header-y += netfilter/ |
| 11 | header-y += netfilter_arp/ | 12 | header-y += netfilter_arp/ |
| 12 | header-y += netfilter_bridge/ | 13 | header-y += netfilter_bridge/ |
diff --git a/include/linux/if_pppol2tp.h b/include/linux/if_pppol2tp.h index 516203b6fdeb..a7d6a2234b31 100644 --- a/include/linux/if_pppol2tp.h +++ b/include/linux/if_pppol2tp.h | |||
| @@ -32,8 +32,8 @@ struct pppol2tp_addr | |||
| 32 | 32 | ||
| 33 | struct sockaddr_in addr; /* IP address and port to send to */ | 33 | struct sockaddr_in addr; /* IP address and port to send to */ |
| 34 | 34 | ||
| 35 | __be16 s_tunnel, s_session; /* For matching incoming packets */ | 35 | __u16 s_tunnel, s_session; /* For matching incoming packets */ |
| 36 | __be16 d_tunnel, d_session; /* For sending outgoing packets */ | 36 | __u16 d_tunnel, d_session; /* For sending outgoing packets */ |
| 37 | }; | 37 | }; |
| 38 | 38 | ||
| 39 | /* Socket options: | 39 | /* Socket options: |
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 4bab322c9f8f..328759c32d61 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
| @@ -116,12 +116,22 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev, | |||
| 116 | struct packet_type* ptype, struct net_device *orig_dev) | 116 | struct packet_type* ptype, struct net_device *orig_dev) |
| 117 | { | 117 | { |
| 118 | unsigned char *rawp = NULL; | 118 | unsigned char *rawp = NULL; |
| 119 | struct vlan_hdr *vhdr = (struct vlan_hdr *)(skb->data); | 119 | struct vlan_hdr *vhdr; |
| 120 | unsigned short vid; | 120 | unsigned short vid; |
| 121 | struct net_device_stats *stats; | 121 | struct net_device_stats *stats; |
| 122 | unsigned short vlan_TCI; | 122 | unsigned short vlan_TCI; |
| 123 | __be16 proto; | 123 | __be16 proto; |
| 124 | 124 | ||
| 125 | if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) | ||
| 126 | return -1; | ||
| 127 | |||
| 128 | if (unlikely(!pskb_may_pull(skb, VLAN_HLEN))) { | ||
| 129 | kfree_skb(skb); | ||
| 130 | return -1; | ||
| 131 | } | ||
| 132 | |||
| 133 | vhdr = (struct vlan_hdr *)(skb->data); | ||
| 134 | |||
| 125 | /* vlan_TCI = ntohs(get_unaligned(&vhdr->h_vlan_TCI)); */ | 135 | /* vlan_TCI = ntohs(get_unaligned(&vhdr->h_vlan_TCI)); */ |
| 126 | vlan_TCI = ntohs(vhdr->h_vlan_TCI); | 136 | vlan_TCI = ntohs(vhdr->h_vlan_TCI); |
| 127 | 137 | ||
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c index fa779874b9dd..3ee2022928e3 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c | |||
| @@ -509,8 +509,14 @@ static unsigned int br_nf_pre_routing(unsigned int hook, struct sk_buff **pskb, | |||
| 509 | int (*okfn)(struct sk_buff *)) | 509 | int (*okfn)(struct sk_buff *)) |
| 510 | { | 510 | { |
| 511 | struct iphdr *iph; | 511 | struct iphdr *iph; |
| 512 | __u32 len; | ||
| 513 | struct sk_buff *skb = *pskb; | 512 | struct sk_buff *skb = *pskb; |
| 513 | __u32 len = nf_bridge_encap_header_len(skb); | ||
| 514 | |||
| 515 | if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) | ||
| 516 | return NF_STOLEN; | ||
| 517 | |||
| 518 | if (unlikely(!pskb_may_pull(skb, len))) | ||
| 519 | goto out; | ||
| 514 | 520 | ||
| 515 | if (skb->protocol == htons(ETH_P_IPV6) || IS_VLAN_IPV6(skb) || | 521 | if (skb->protocol == htons(ETH_P_IPV6) || IS_VLAN_IPV6(skb) || |
| 516 | IS_PPPOE_IPV6(skb)) { | 522 | IS_PPPOE_IPV6(skb)) { |
| @@ -518,8 +524,6 @@ static unsigned int br_nf_pre_routing(unsigned int hook, struct sk_buff **pskb, | |||
| 518 | if (!brnf_call_ip6tables) | 524 | if (!brnf_call_ip6tables) |
| 519 | return NF_ACCEPT; | 525 | return NF_ACCEPT; |
| 520 | #endif | 526 | #endif |
| 521 | if ((skb = skb_share_check(*pskb, GFP_ATOMIC)) == NULL) | ||
| 522 | goto out; | ||
| 523 | nf_bridge_pull_encap_header_rcsum(skb); | 527 | nf_bridge_pull_encap_header_rcsum(skb); |
| 524 | return br_nf_pre_routing_ipv6(hook, skb, in, out, okfn); | 528 | return br_nf_pre_routing_ipv6(hook, skb, in, out, okfn); |
| 525 | } | 529 | } |
| @@ -532,8 +536,6 @@ static unsigned int br_nf_pre_routing(unsigned int hook, struct sk_buff **pskb, | |||
| 532 | !IS_PPPOE_IP(skb)) | 536 | !IS_PPPOE_IP(skb)) |
| 533 | return NF_ACCEPT; | 537 | return NF_ACCEPT; |
| 534 | 538 | ||
| 535 | if ((skb = skb_share_check(*pskb, GFP_ATOMIC)) == NULL) | ||
| 536 | goto out; | ||
| 537 | nf_bridge_pull_encap_header_rcsum(skb); | 539 | nf_bridge_pull_encap_header_rcsum(skb); |
| 538 | 540 | ||
| 539 | if (!pskb_may_pull(skb, sizeof(struct iphdr))) | 541 | if (!pskb_may_pull(skb, sizeof(struct iphdr))) |
diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c index 99aece1aeccf..20330c572610 100644 --- a/net/core/dev_mcast.c +++ b/net/core/dev_mcast.c | |||
| @@ -116,11 +116,13 @@ int dev_mc_add(struct net_device *dev, void *addr, int alen, int glbl) | |||
| 116 | */ | 116 | */ |
| 117 | int dev_mc_sync(struct net_device *to, struct net_device *from) | 117 | int dev_mc_sync(struct net_device *to, struct net_device *from) |
| 118 | { | 118 | { |
| 119 | struct dev_addr_list *da; | 119 | struct dev_addr_list *da, *next; |
| 120 | int err = 0; | 120 | int err = 0; |
| 121 | 121 | ||
| 122 | netif_tx_lock_bh(to); | 122 | netif_tx_lock_bh(to); |
| 123 | for (da = from->mc_list; da != NULL; da = da->next) { | 123 | da = from->mc_list; |
| 124 | while (da != NULL) { | ||
| 125 | next = da->next; | ||
| 124 | if (!da->da_synced) { | 126 | if (!da->da_synced) { |
| 125 | err = __dev_addr_add(&to->mc_list, &to->mc_count, | 127 | err = __dev_addr_add(&to->mc_list, &to->mc_count, |
| 126 | da->da_addr, da->da_addrlen, 0); | 128 | da->da_addr, da->da_addrlen, 0); |
| @@ -134,6 +136,7 @@ int dev_mc_sync(struct net_device *to, struct net_device *from) | |||
| 134 | __dev_addr_delete(&from->mc_list, &from->mc_count, | 136 | __dev_addr_delete(&from->mc_list, &from->mc_count, |
| 135 | da->da_addr, da->da_addrlen, 0); | 137 | da->da_addr, da->da_addrlen, 0); |
| 136 | } | 138 | } |
| 139 | da = next; | ||
| 137 | } | 140 | } |
| 138 | if (!err) | 141 | if (!err) |
| 139 | __dev_set_rx_mode(to); | 142 | __dev_set_rx_mode(to); |
| @@ -156,12 +159,14 @@ EXPORT_SYMBOL(dev_mc_sync); | |||
| 156 | */ | 159 | */ |
| 157 | void dev_mc_unsync(struct net_device *to, struct net_device *from) | 160 | void dev_mc_unsync(struct net_device *to, struct net_device *from) |
| 158 | { | 161 | { |
| 159 | struct dev_addr_list *da; | 162 | struct dev_addr_list *da, *next; |
| 160 | 163 | ||
| 161 | netif_tx_lock_bh(from); | 164 | netif_tx_lock_bh(from); |
| 162 | netif_tx_lock_bh(to); | 165 | netif_tx_lock_bh(to); |
| 163 | 166 | ||
| 164 | for (da = from->mc_list; da != NULL; da = da->next) { | 167 | da = from->mc_list; |
| 168 | while (da != NULL) { | ||
| 169 | next = da->next; | ||
| 165 | if (!da->da_synced) | 170 | if (!da->da_synced) |
| 166 | continue; | 171 | continue; |
| 167 | __dev_addr_delete(&to->mc_list, &to->mc_count, | 172 | __dev_addr_delete(&to->mc_list, &to->mc_count, |
| @@ -169,6 +174,7 @@ void dev_mc_unsync(struct net_device *to, struct net_device *from) | |||
| 169 | da->da_synced = 0; | 174 | da->da_synced = 0; |
| 170 | __dev_addr_delete(&from->mc_list, &from->mc_count, | 175 | __dev_addr_delete(&from->mc_list, &from->mc_count, |
| 171 | da->da_addr, da->da_addrlen, 0); | 176 | da->da_addr, da->da_addrlen, 0); |
| 177 | da = next; | ||
| 172 | } | 178 | } |
| 173 | __dev_set_rx_mode(to); | 179 | __dev_set_rx_mode(to); |
| 174 | 180 | ||
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index ca2a1533138a..f7de8f24d8dd 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
| @@ -33,6 +33,7 @@ | |||
| 33 | #include <linux/rtnetlink.h> | 33 | #include <linux/rtnetlink.h> |
| 34 | #include <linux/random.h> | 34 | #include <linux/random.h> |
| 35 | #include <linux/string.h> | 35 | #include <linux/string.h> |
| 36 | #include <linux/log2.h> | ||
| 36 | 37 | ||
| 37 | #define NEIGH_DEBUG 1 | 38 | #define NEIGH_DEBUG 1 |
| 38 | 39 | ||
| @@ -311,7 +312,7 @@ static void neigh_hash_grow(struct neigh_table *tbl, unsigned long new_entries) | |||
| 311 | 312 | ||
| 312 | NEIGH_CACHE_STAT_INC(tbl, hash_grows); | 313 | NEIGH_CACHE_STAT_INC(tbl, hash_grows); |
| 313 | 314 | ||
| 314 | BUG_ON(new_entries & (new_entries - 1)); | 315 | BUG_ON(!is_power_of_2(new_entries)); |
| 315 | new_hash = neigh_hash_alloc(new_entries); | 316 | new_hash = neigh_hash_alloc(new_entries); |
| 316 | if (!new_hash) | 317 | if (!new_hash) |
| 317 | return; | 318 | return; |
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c index 7a23e59c374a..39f6211f1496 100644 --- a/net/ipv4/ah4.c +++ b/net/ipv4/ah4.c | |||
| @@ -46,7 +46,7 @@ static int ip_clear_mutable_options(struct iphdr *iph, __be32 *daddr) | |||
| 46 | memcpy(daddr, optptr+optlen-4, 4); | 46 | memcpy(daddr, optptr+optlen-4, 4); |
| 47 | /* Fall through */ | 47 | /* Fall through */ |
| 48 | default: | 48 | default: |
| 49 | memset(optptr+2, 0, optlen-2); | 49 | memset(optptr, 0, optlen); |
| 50 | } | 50 | } |
| 51 | l -= optlen; | 51 | l -= optlen; |
| 52 | optptr += optlen; | 52 | optptr += optlen; |
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 4d544573f48a..6b420aedcdcf 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c | |||
| @@ -625,6 +625,10 @@ static int do_ip_setsockopt(struct sock *sk, int level, | |||
| 625 | { | 625 | { |
| 626 | struct ip_mreqn mreq; | 626 | struct ip_mreqn mreq; |
| 627 | 627 | ||
| 628 | err = -EPROTO; | ||
| 629 | if (inet_sk(sk)->is_icsk) | ||
| 630 | break; | ||
| 631 | |||
| 628 | if (optlen < sizeof(struct ip_mreq)) | 632 | if (optlen < sizeof(struct ip_mreq)) |
| 629 | goto e_inval; | 633 | goto e_inval; |
| 630 | err = -EFAULT; | 634 | err = -EFAULT; |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index f030435e0eb4..9785df37a65f 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
| @@ -755,7 +755,15 @@ void tcp_update_metrics(struct sock *sk) | |||
| 755 | } | 755 | } |
| 756 | } | 756 | } |
| 757 | 757 | ||
| 758 | /* Numbers are taken from RFC2414. */ | 758 | /* Numbers are taken from RFC3390. |
| 759 | * | ||
| 760 | * John Heffner states: | ||
| 761 | * | ||
| 762 | * The RFC specifies a window of no more than 4380 bytes | ||
| 763 | * unless 2*MSS > 4380. Reading the pseudocode in the RFC | ||
| 764 | * is a bit misleading because they use a clamp at 4380 bytes | ||
| 765 | * rather than use a multiplier in the relevant range. | ||
| 766 | */ | ||
| 759 | __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst) | 767 | __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst) |
| 760 | { | 768 | { |
| 761 | __u32 cwnd = (dst ? dst_metric(dst, RTAX_INITCWND) : 0); | 769 | __u32 cwnd = (dst ? dst_metric(dst, RTAX_INITCWND) : 0); |
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 761a910f4f97..6b038aa72e88 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c | |||
| @@ -554,6 +554,10 @@ done: | |||
| 554 | { | 554 | { |
| 555 | struct ipv6_mreq mreq; | 555 | struct ipv6_mreq mreq; |
| 556 | 556 | ||
| 557 | retv = -EPROTO; | ||
| 558 | if (inet_sk(sk)->is_icsk) | ||
| 559 | break; | ||
| 560 | |||
| 557 | retv = -EFAULT; | 561 | retv = -EFAULT; |
| 558 | if (copy_from_user(&mreq, optval, sizeof(struct ipv6_mreq))) | 562 | if (copy_from_user(&mreq, optval, sizeof(struct ipv6_mreq))) |
| 559 | break; | 563 | break; |
