diff options
author | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-22 17:14:17 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-22 17:14:17 -0500 |
commit | f2a67a576959025549a3b6a884bdd21f4dc107da (patch) | |
tree | 5b678611c437190a76efb0cf34dc4624c99d2829 | |
parent | 719d34027e1a186e46a3952e8a24bf91ecc33837 (diff) | |
parent | 5c668704b7fa5a4ebf21a490ddfbd6dc2e01fc97 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
[UDP]: Fix reversed logic in udp_get_port().
[IPV6]: Dumb typo in generic csum_ipv6_magic()
[SCTP]: make 2 functions static
[SCTP]: Fix typo adaption -> adaptation as per the latest API draft.
[SCTP]: Don't export include/linux/sctp.h to userspace.
[TCP]: Fix ambiguity in the `before' relation.
[ATM] drivers/atm/fore200e.c: Cleanups.
[ATM]: Remove dead ATM_TNETA1570 option.
NetLabel: correctly fill in unused CIPSOv4 level and category mappings
NetLabel: perform input validation earlier on CIPSOv4 DOI add ops
-rw-r--r-- | drivers/atm/Kconfig | 4 | ||||
-rw-r--r-- | drivers/atm/fore200e.c | 166 | ||||
-rw-r--r-- | include/linux/Kbuild | 1 | ||||
-rw-r--r-- | include/linux/sctp.h | 10 | ||||
-rw-r--r-- | include/net/ip6_checksum.h | 2 | ||||
-rw-r--r-- | include/net/sctp/sctp.h | 2 | ||||
-rw-r--r-- | include/net/sctp/structs.h | 8 | ||||
-rw-r--r-- | include/net/sctp/ulpevent.h | 2 | ||||
-rw-r--r-- | include/net/sctp/user.h | 28 | ||||
-rw-r--r-- | include/net/tcp.h | 9 | ||||
-rw-r--r-- | net/ipv4/udp.c | 13 | ||||
-rw-r--r-- | net/netlabel/netlabel_cipso_v4.c | 37 | ||||
-rw-r--r-- | net/sctp/ipv6.c | 4 | ||||
-rw-r--r-- | net/sctp/protocol.c | 4 | ||||
-rw-r--r-- | net/sctp/sm_make_chunk.c | 24 | ||||
-rw-r--r-- | net/sctp/sm_statefuns.c | 32 | ||||
-rw-r--r-- | net/sctp/socket.c | 34 | ||||
-rw-r--r-- | net/sctp/ulpevent.c | 20 |
18 files changed, 188 insertions, 212 deletions
diff --git a/drivers/atm/Kconfig b/drivers/atm/Kconfig index 2ddd76fdbc43..33687454eb32 100644 --- a/drivers/atm/Kconfig +++ b/drivers/atm/Kconfig | |||
@@ -167,10 +167,6 @@ config ATM_ZATM_DEBUG | |||
167 | Note that extended debugging may create certain race conditions | 167 | Note that extended debugging may create certain race conditions |
168 | itself. Enable this ONLY if you suspect problems with the driver. | 168 | itself. Enable this ONLY if you suspect problems with the driver. |
169 | 169 | ||
170 | # bool 'Rolfs TI TNETA1570' CONFIG_ATM_TNETA1570 y | ||
171 | # if [ "$CONFIG_ATM_TNETA1570" = "y" ]; then | ||
172 | # bool ' Enable extended debugging' CONFIG_ATM_TNETA1570_DEBUG n | ||
173 | # fi | ||
174 | config ATM_NICSTAR | 170 | config ATM_NICSTAR |
175 | tristate "IDT 77201 (NICStAR) (ForeRunnerLE)" | 171 | tristate "IDT 77201 (NICStAR) (ForeRunnerLE)" |
176 | depends on PCI && ATM && !64BIT | 172 | depends on PCI && ATM && !64BIT |
diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c index 3a7b21ff30a5..4aeb3d062ff6 100644 --- a/drivers/atm/fore200e.c +++ b/drivers/atm/fore200e.c | |||
@@ -172,25 +172,6 @@ fore200e_irq_itoa(int irq) | |||
172 | } | 172 | } |
173 | 173 | ||
174 | 174 | ||
175 | static void* | ||
176 | fore200e_kmalloc(int size, gfp_t flags) | ||
177 | { | ||
178 | void *chunk = kzalloc(size, flags); | ||
179 | |||
180 | if (!chunk) | ||
181 | printk(FORE200E "kmalloc() failed, requested size = %d, flags = 0x%x\n", size, flags); | ||
182 | |||
183 | return chunk; | ||
184 | } | ||
185 | |||
186 | |||
187 | static void | ||
188 | fore200e_kfree(void* chunk) | ||
189 | { | ||
190 | kfree(chunk); | ||
191 | } | ||
192 | |||
193 | |||
194 | /* allocate and align a chunk of memory intended to hold the data behing exchanged | 175 | /* allocate and align a chunk of memory intended to hold the data behing exchanged |
195 | between the driver and the adapter (using streaming DVMA) */ | 176 | between the driver and the adapter (using streaming DVMA) */ |
196 | 177 | ||
@@ -206,7 +187,7 @@ fore200e_chunk_alloc(struct fore200e* fore200e, struct chunk* chunk, int size, i | |||
206 | chunk->align_size = size; | 187 | chunk->align_size = size; |
207 | chunk->direction = direction; | 188 | chunk->direction = direction; |
208 | 189 | ||
209 | chunk->alloc_addr = fore200e_kmalloc(chunk->alloc_size, GFP_KERNEL | GFP_DMA); | 190 | chunk->alloc_addr = kzalloc(chunk->alloc_size, GFP_KERNEL | GFP_DMA); |
210 | if (chunk->alloc_addr == NULL) | 191 | if (chunk->alloc_addr == NULL) |
211 | return -ENOMEM; | 192 | return -ENOMEM; |
212 | 193 | ||
@@ -228,7 +209,7 @@ fore200e_chunk_free(struct fore200e* fore200e, struct chunk* chunk) | |||
228 | { | 209 | { |
229 | fore200e->bus->dma_unmap(fore200e, chunk->dma_addr, chunk->dma_size, chunk->direction); | 210 | fore200e->bus->dma_unmap(fore200e, chunk->dma_addr, chunk->dma_size, chunk->direction); |
230 | 211 | ||
231 | fore200e_kfree(chunk->alloc_addr); | 212 | kfree(chunk->alloc_addr); |
232 | } | 213 | } |
233 | 214 | ||
234 | 215 | ||
@@ -882,7 +863,7 @@ fore200e_sba_detect(const struct fore200e_bus* bus, int index) | |||
882 | return NULL; | 863 | return NULL; |
883 | } | 864 | } |
884 | 865 | ||
885 | fore200e = fore200e_kmalloc(sizeof(struct fore200e), GFP_KERNEL); | 866 | fore200e = kzalloc(sizeof(struct fore200e), GFP_KERNEL); |
886 | if (fore200e == NULL) | 867 | if (fore200e == NULL) |
887 | return NULL; | 868 | return NULL; |
888 | 869 | ||
@@ -1505,7 +1486,7 @@ fore200e_open(struct atm_vcc *vcc) | |||
1505 | 1486 | ||
1506 | spin_unlock_irqrestore(&fore200e->q_lock, flags); | 1487 | spin_unlock_irqrestore(&fore200e->q_lock, flags); |
1507 | 1488 | ||
1508 | fore200e_vcc = fore200e_kmalloc(sizeof(struct fore200e_vcc), GFP_ATOMIC); | 1489 | fore200e_vcc = kzalloc(sizeof(struct fore200e_vcc), GFP_ATOMIC); |
1509 | if (fore200e_vcc == NULL) { | 1490 | if (fore200e_vcc == NULL) { |
1510 | vc_map->vcc = NULL; | 1491 | vc_map->vcc = NULL; |
1511 | return -ENOMEM; | 1492 | return -ENOMEM; |
@@ -1526,7 +1507,7 @@ fore200e_open(struct atm_vcc *vcc) | |||
1526 | if (fore200e->available_cell_rate < vcc->qos.txtp.max_pcr) { | 1507 | if (fore200e->available_cell_rate < vcc->qos.txtp.max_pcr) { |
1527 | up(&fore200e->rate_sf); | 1508 | up(&fore200e->rate_sf); |
1528 | 1509 | ||
1529 | fore200e_kfree(fore200e_vcc); | 1510 | kfree(fore200e_vcc); |
1530 | vc_map->vcc = NULL; | 1511 | vc_map->vcc = NULL; |
1531 | return -EAGAIN; | 1512 | return -EAGAIN; |
1532 | } | 1513 | } |
@@ -1554,7 +1535,7 @@ fore200e_open(struct atm_vcc *vcc) | |||
1554 | 1535 | ||
1555 | fore200e->available_cell_rate += vcc->qos.txtp.max_pcr; | 1536 | fore200e->available_cell_rate += vcc->qos.txtp.max_pcr; |
1556 | 1537 | ||
1557 | fore200e_kfree(fore200e_vcc); | 1538 | kfree(fore200e_vcc); |
1558 | return -EINVAL; | 1539 | return -EINVAL; |
1559 | } | 1540 | } |
1560 | 1541 | ||
@@ -1630,7 +1611,7 @@ fore200e_close(struct atm_vcc* vcc) | |||
1630 | clear_bit(ATM_VF_PARTIAL,&vcc->flags); | 1611 | clear_bit(ATM_VF_PARTIAL,&vcc->flags); |
1631 | 1612 | ||
1632 | ASSERT(fore200e_vcc); | 1613 | ASSERT(fore200e_vcc); |
1633 | fore200e_kfree(fore200e_vcc); | 1614 | kfree(fore200e_vcc); |
1634 | } | 1615 | } |
1635 | 1616 | ||
1636 | 1617 | ||
@@ -1831,7 +1812,7 @@ fore200e_getstats(struct fore200e* fore200e) | |||
1831 | u32 stats_dma_addr; | 1812 | u32 stats_dma_addr; |
1832 | 1813 | ||
1833 | if (fore200e->stats == NULL) { | 1814 | if (fore200e->stats == NULL) { |
1834 | fore200e->stats = fore200e_kmalloc(sizeof(struct stats), GFP_KERNEL | GFP_DMA); | 1815 | fore200e->stats = kzalloc(sizeof(struct stats), GFP_KERNEL | GFP_DMA); |
1835 | if (fore200e->stats == NULL) | 1816 | if (fore200e->stats == NULL) |
1836 | return -ENOMEM; | 1817 | return -ENOMEM; |
1837 | } | 1818 | } |
@@ -2002,17 +1983,6 @@ fore200e_setloop(struct fore200e* fore200e, int loop_mode) | |||
2002 | } | 1983 | } |
2003 | 1984 | ||
2004 | 1985 | ||
2005 | static inline unsigned int | ||
2006 | fore200e_swap(unsigned int in) | ||
2007 | { | ||
2008 | #if defined(__LITTLE_ENDIAN) | ||
2009 | return swab32(in); | ||
2010 | #else | ||
2011 | return in; | ||
2012 | #endif | ||
2013 | } | ||
2014 | |||
2015 | |||
2016 | static int | 1986 | static int |
2017 | fore200e_fetch_stats(struct fore200e* fore200e, struct sonet_stats __user *arg) | 1987 | fore200e_fetch_stats(struct fore200e* fore200e, struct sonet_stats __user *arg) |
2018 | { | 1988 | { |
@@ -2021,19 +1991,19 @@ fore200e_fetch_stats(struct fore200e* fore200e, struct sonet_stats __user *arg) | |||
2021 | if (fore200e_getstats(fore200e) < 0) | 1991 | if (fore200e_getstats(fore200e) < 0) |
2022 | return -EIO; | 1992 | return -EIO; |
2023 | 1993 | ||
2024 | tmp.section_bip = fore200e_swap(fore200e->stats->oc3.section_bip8_errors); | 1994 | tmp.section_bip = cpu_to_be32(fore200e->stats->oc3.section_bip8_errors); |
2025 | tmp.line_bip = fore200e_swap(fore200e->stats->oc3.line_bip24_errors); | 1995 | tmp.line_bip = cpu_to_be32(fore200e->stats->oc3.line_bip24_errors); |
2026 | tmp.path_bip = fore200e_swap(fore200e->stats->oc3.path_bip8_errors); | 1996 | tmp.path_bip = cpu_to_be32(fore200e->stats->oc3.path_bip8_errors); |
2027 | tmp.line_febe = fore200e_swap(fore200e->stats->oc3.line_febe_errors); | 1997 | tmp.line_febe = cpu_to_be32(fore200e->stats->oc3.line_febe_errors); |
2028 | tmp.path_febe = fore200e_swap(fore200e->stats->oc3.path_febe_errors); | 1998 | tmp.path_febe = cpu_to_be32(fore200e->stats->oc3.path_febe_errors); |
2029 | tmp.corr_hcs = fore200e_swap(fore200e->stats->oc3.corr_hcs_errors); | 1999 | tmp.corr_hcs = cpu_to_be32(fore200e->stats->oc3.corr_hcs_errors); |
2030 | tmp.uncorr_hcs = fore200e_swap(fore200e->stats->oc3.ucorr_hcs_errors); | 2000 | tmp.uncorr_hcs = cpu_to_be32(fore200e->stats->oc3.ucorr_hcs_errors); |
2031 | tmp.tx_cells = fore200e_swap(fore200e->stats->aal0.cells_transmitted) + | 2001 | tmp.tx_cells = cpu_to_be32(fore200e->stats->aal0.cells_transmitted) + |
2032 | fore200e_swap(fore200e->stats->aal34.cells_transmitted) + | 2002 | cpu_to_be32(fore200e->stats->aal34.cells_transmitted) + |
2033 | fore200e_swap(fore200e->stats->aal5.cells_transmitted); | 2003 | cpu_to_be32(fore200e->stats->aal5.cells_transmitted); |
2034 | tmp.rx_cells = fore200e_swap(fore200e->stats->aal0.cells_received) + | 2004 | tmp.rx_cells = cpu_to_be32(fore200e->stats->aal0.cells_received) + |
2035 | fore200e_swap(fore200e->stats->aal34.cells_received) + | 2005 | cpu_to_be32(fore200e->stats->aal34.cells_received) + |
2036 | fore200e_swap(fore200e->stats->aal5.cells_received); | 2006 | cpu_to_be32(fore200e->stats->aal5.cells_received); |
2037 | 2007 | ||
2038 | if (arg) | 2008 | if (arg) |
2039 | return copy_to_user(arg, &tmp, sizeof(struct sonet_stats)) ? -EFAULT : 0; | 2009 | return copy_to_user(arg, &tmp, sizeof(struct sonet_stats)) ? -EFAULT : 0; |
@@ -2146,7 +2116,7 @@ fore200e_irq_request(struct fore200e* fore200e) | |||
2146 | static int __devinit | 2116 | static int __devinit |
2147 | fore200e_get_esi(struct fore200e* fore200e) | 2117 | fore200e_get_esi(struct fore200e* fore200e) |
2148 | { | 2118 | { |
2149 | struct prom_data* prom = fore200e_kmalloc(sizeof(struct prom_data), GFP_KERNEL | GFP_DMA); | 2119 | struct prom_data* prom = kzalloc(sizeof(struct prom_data), GFP_KERNEL | GFP_DMA); |
2150 | int ok, i; | 2120 | int ok, i; |
2151 | 2121 | ||
2152 | if (!prom) | 2122 | if (!prom) |
@@ -2154,7 +2124,7 @@ fore200e_get_esi(struct fore200e* fore200e) | |||
2154 | 2124 | ||
2155 | ok = fore200e->bus->prom_read(fore200e, prom); | 2125 | ok = fore200e->bus->prom_read(fore200e, prom); |
2156 | if (ok < 0) { | 2126 | if (ok < 0) { |
2157 | fore200e_kfree(prom); | 2127 | kfree(prom); |
2158 | return -EBUSY; | 2128 | return -EBUSY; |
2159 | } | 2129 | } |
2160 | 2130 | ||
@@ -2169,7 +2139,7 @@ fore200e_get_esi(struct fore200e* fore200e) | |||
2169 | fore200e->esi[ i ] = fore200e->atm_dev->esi[ i ] = prom->mac_addr[ i + 2 ]; | 2139 | fore200e->esi[ i ] = fore200e->atm_dev->esi[ i ] = prom->mac_addr[ i + 2 ]; |
2170 | } | 2140 | } |
2171 | 2141 | ||
2172 | fore200e_kfree(prom); | 2142 | kfree(prom); |
2173 | 2143 | ||
2174 | return 0; | 2144 | return 0; |
2175 | } | 2145 | } |
@@ -2194,7 +2164,7 @@ fore200e_alloc_rx_buf(struct fore200e* fore200e) | |||
2194 | DPRINTK(2, "rx buffers %d / %d are being allocated\n", scheme, magn); | 2164 | DPRINTK(2, "rx buffers %d / %d are being allocated\n", scheme, magn); |
2195 | 2165 | ||
2196 | /* allocate the array of receive buffers */ | 2166 | /* allocate the array of receive buffers */ |
2197 | buffer = bsq->buffer = fore200e_kmalloc(nbr * sizeof(struct buffer), GFP_KERNEL); | 2167 | buffer = bsq->buffer = kzalloc(nbr * sizeof(struct buffer), GFP_KERNEL); |
2198 | 2168 | ||
2199 | if (buffer == NULL) | 2169 | if (buffer == NULL) |
2200 | return -ENOMEM; | 2170 | return -ENOMEM; |
@@ -2217,7 +2187,7 @@ fore200e_alloc_rx_buf(struct fore200e* fore200e) | |||
2217 | 2187 | ||
2218 | while (i > 0) | 2188 | while (i > 0) |
2219 | fore200e_chunk_free(fore200e, &buffer[ --i ].data); | 2189 | fore200e_chunk_free(fore200e, &buffer[ --i ].data); |
2220 | fore200e_kfree(buffer); | 2190 | kfree(buffer); |
2221 | 2191 | ||
2222 | return -ENOMEM; | 2192 | return -ENOMEM; |
2223 | } | 2193 | } |
@@ -2736,7 +2706,7 @@ fore200e_pca_detect(struct pci_dev *pci_dev, const struct pci_device_id *pci_ent | |||
2736 | goto out; | 2706 | goto out; |
2737 | } | 2707 | } |
2738 | 2708 | ||
2739 | fore200e = fore200e_kmalloc(sizeof(struct fore200e), GFP_KERNEL); | 2709 | fore200e = kzalloc(sizeof(struct fore200e), GFP_KERNEL); |
2740 | if (fore200e == NULL) { | 2710 | if (fore200e == NULL) { |
2741 | err = -ENOMEM; | 2711 | err = -ENOMEM; |
2742 | goto out_disable; | 2712 | goto out_disable; |
@@ -2999,8 +2969,8 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page) | |||
2999 | " 4b5b:\n" | 2969 | " 4b5b:\n" |
3000 | " crc_header_errors:\t\t%10u\n" | 2970 | " crc_header_errors:\t\t%10u\n" |
3001 | " framing_errors:\t\t%10u\n", | 2971 | " framing_errors:\t\t%10u\n", |
3002 | fore200e_swap(fore200e->stats->phy.crc_header_errors), | 2972 | cpu_to_be32(fore200e->stats->phy.crc_header_errors), |
3003 | fore200e_swap(fore200e->stats->phy.framing_errors)); | 2973 | cpu_to_be32(fore200e->stats->phy.framing_errors)); |
3004 | 2974 | ||
3005 | if (!left--) | 2975 | if (!left--) |
3006 | return sprintf(page, "\n" | 2976 | return sprintf(page, "\n" |
@@ -3012,13 +2982,13 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page) | |||
3012 | " path_febe_errors:\t\t%10u\n" | 2982 | " path_febe_errors:\t\t%10u\n" |
3013 | " corr_hcs_errors:\t\t%10u\n" | 2983 | " corr_hcs_errors:\t\t%10u\n" |
3014 | " ucorr_hcs_errors:\t\t%10u\n", | 2984 | " ucorr_hcs_errors:\t\t%10u\n", |
3015 | fore200e_swap(fore200e->stats->oc3.section_bip8_errors), | 2985 | cpu_to_be32(fore200e->stats->oc3.section_bip8_errors), |
3016 | fore200e_swap(fore200e->stats->oc3.path_bip8_errors), | 2986 | cpu_to_be32(fore200e->stats->oc3.path_bip8_errors), |
3017 | fore200e_swap(fore200e->stats->oc3.line_bip24_errors), | 2987 | cpu_to_be32(fore200e->stats->oc3.line_bip24_errors), |
3018 | fore200e_swap(fore200e->stats->oc3.line_febe_errors), | 2988 | cpu_to_be32(fore200e->stats->oc3.line_febe_errors), |
3019 | fore200e_swap(fore200e->stats->oc3.path_febe_errors), | 2989 | cpu_to_be32(fore200e->stats->oc3.path_febe_errors), |
3020 | fore200e_swap(fore200e->stats->oc3.corr_hcs_errors), | 2990 | cpu_to_be32(fore200e->stats->oc3.corr_hcs_errors), |
3021 | fore200e_swap(fore200e->stats->oc3.ucorr_hcs_errors)); | 2991 | cpu_to_be32(fore200e->stats->oc3.ucorr_hcs_errors)); |
3022 | 2992 | ||
3023 | if (!left--) | 2993 | if (!left--) |
3024 | return sprintf(page,"\n" | 2994 | return sprintf(page,"\n" |
@@ -3029,12 +2999,12 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page) | |||
3029 | " vpi no conn:\t\t%10u\n" | 2999 | " vpi no conn:\t\t%10u\n" |
3030 | " vci out of range:\t\t%10u\n" | 3000 | " vci out of range:\t\t%10u\n" |
3031 | " vci no conn:\t\t%10u\n", | 3001 | " vci no conn:\t\t%10u\n", |
3032 | fore200e_swap(fore200e->stats->atm.cells_transmitted), | 3002 | cpu_to_be32(fore200e->stats->atm.cells_transmitted), |
3033 | fore200e_swap(fore200e->stats->atm.cells_received), | 3003 | cpu_to_be32(fore200e->stats->atm.cells_received), |
3034 | fore200e_swap(fore200e->stats->atm.vpi_bad_range), | 3004 | cpu_to_be32(fore200e->stats->atm.vpi_bad_range), |
3035 | fore200e_swap(fore200e->stats->atm.vpi_no_conn), | 3005 | cpu_to_be32(fore200e->stats->atm.vpi_no_conn), |
3036 | fore200e_swap(fore200e->stats->atm.vci_bad_range), | 3006 | cpu_to_be32(fore200e->stats->atm.vci_bad_range), |
3037 | fore200e_swap(fore200e->stats->atm.vci_no_conn)); | 3007 | cpu_to_be32(fore200e->stats->atm.vci_no_conn)); |
3038 | 3008 | ||
3039 | if (!left--) | 3009 | if (!left--) |
3040 | return sprintf(page,"\n" | 3010 | return sprintf(page,"\n" |
@@ -3042,9 +3012,9 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page) | |||
3042 | " TX:\t\t\t%10u\n" | 3012 | " TX:\t\t\t%10u\n" |
3043 | " RX:\t\t\t%10u\n" | 3013 | " RX:\t\t\t%10u\n" |
3044 | " dropped:\t\t\t%10u\n", | 3014 | " dropped:\t\t\t%10u\n", |
3045 | fore200e_swap(fore200e->stats->aal0.cells_transmitted), | 3015 | cpu_to_be32(fore200e->stats->aal0.cells_transmitted), |
3046 | fore200e_swap(fore200e->stats->aal0.cells_received), | 3016 | cpu_to_be32(fore200e->stats->aal0.cells_received), |
3047 | fore200e_swap(fore200e->stats->aal0.cells_dropped)); | 3017 | cpu_to_be32(fore200e->stats->aal0.cells_dropped)); |
3048 | 3018 | ||
3049 | if (!left--) | 3019 | if (!left--) |
3050 | return sprintf(page,"\n" | 3020 | return sprintf(page,"\n" |
@@ -3060,15 +3030,15 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page) | |||
3060 | " RX:\t\t\t%10u\n" | 3030 | " RX:\t\t\t%10u\n" |
3061 | " dropped:\t\t\t%10u\n" | 3031 | " dropped:\t\t\t%10u\n" |
3062 | " protocol errors:\t\t%10u\n", | 3032 | " protocol errors:\t\t%10u\n", |
3063 | fore200e_swap(fore200e->stats->aal34.cells_transmitted), | 3033 | cpu_to_be32(fore200e->stats->aal34.cells_transmitted), |
3064 | fore200e_swap(fore200e->stats->aal34.cells_received), | 3034 | cpu_to_be32(fore200e->stats->aal34.cells_received), |
3065 | fore200e_swap(fore200e->stats->aal34.cells_dropped), | 3035 | cpu_to_be32(fore200e->stats->aal34.cells_dropped), |
3066 | fore200e_swap(fore200e->stats->aal34.cells_crc_errors), | 3036 | cpu_to_be32(fore200e->stats->aal34.cells_crc_errors), |
3067 | fore200e_swap(fore200e->stats->aal34.cells_protocol_errors), | 3037 | cpu_to_be32(fore200e->stats->aal34.cells_protocol_errors), |
3068 | fore200e_swap(fore200e->stats->aal34.cspdus_transmitted), | 3038 | cpu_to_be32(fore200e->stats->aal34.cspdus_transmitted), |
3069 | fore200e_swap(fore200e->stats->aal34.cspdus_received), | 3039 | cpu_to_be32(fore200e->stats->aal34.cspdus_received), |
3070 | fore200e_swap(fore200e->stats->aal34.cspdus_dropped), | 3040 | cpu_to_be32(fore200e->stats->aal34.cspdus_dropped), |
3071 | fore200e_swap(fore200e->stats->aal34.cspdus_protocol_errors)); | 3041 | cpu_to_be32(fore200e->stats->aal34.cspdus_protocol_errors)); |
3072 | 3042 | ||
3073 | if (!left--) | 3043 | if (!left--) |
3074 | return sprintf(page,"\n" | 3044 | return sprintf(page,"\n" |
@@ -3084,15 +3054,15 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page) | |||
3084 | " dropped:\t\t\t%10u\n" | 3054 | " dropped:\t\t\t%10u\n" |
3085 | " CRC errors:\t\t%10u\n" | 3055 | " CRC errors:\t\t%10u\n" |
3086 | " protocol errors:\t\t%10u\n", | 3056 | " protocol errors:\t\t%10u\n", |
3087 | fore200e_swap(fore200e->stats->aal5.cells_transmitted), | 3057 | cpu_to_be32(fore200e->stats->aal5.cells_transmitted), |
3088 | fore200e_swap(fore200e->stats->aal5.cells_received), | 3058 | cpu_to_be32(fore200e->stats->aal5.cells_received), |
3089 | fore200e_swap(fore200e->stats->aal5.cells_dropped), | 3059 | cpu_to_be32(fore200e->stats->aal5.cells_dropped), |
3090 | fore200e_swap(fore200e->stats->aal5.congestion_experienced), | 3060 | cpu_to_be32(fore200e->stats->aal5.congestion_experienced), |
3091 | fore200e_swap(fore200e->stats->aal5.cspdus_transmitted), | 3061 | cpu_to_be32(fore200e->stats->aal5.cspdus_transmitted), |
3092 | fore200e_swap(fore200e->stats->aal5.cspdus_received), | 3062 | cpu_to_be32(fore200e->stats->aal5.cspdus_received), |
3093 | fore200e_swap(fore200e->stats->aal5.cspdus_dropped), | 3063 | cpu_to_be32(fore200e->stats->aal5.cspdus_dropped), |
3094 | fore200e_swap(fore200e->stats->aal5.cspdus_crc_errors), | 3064 | cpu_to_be32(fore200e->stats->aal5.cspdus_crc_errors), |
3095 | fore200e_swap(fore200e->stats->aal5.cspdus_protocol_errors)); | 3065 | cpu_to_be32(fore200e->stats->aal5.cspdus_protocol_errors)); |
3096 | 3066 | ||
3097 | if (!left--) | 3067 | if (!left--) |
3098 | return sprintf(page,"\n" | 3068 | return sprintf(page,"\n" |
@@ -3103,11 +3073,11 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page) | |||
3103 | " large b2:\t\t\t%10u\n" | 3073 | " large b2:\t\t\t%10u\n" |
3104 | " RX PDUs:\t\t\t%10u\n" | 3074 | " RX PDUs:\t\t\t%10u\n" |
3105 | " TX PDUs:\t\t\t%10lu\n", | 3075 | " TX PDUs:\t\t\t%10lu\n", |
3106 | fore200e_swap(fore200e->stats->aux.small_b1_failed), | 3076 | cpu_to_be32(fore200e->stats->aux.small_b1_failed), |
3107 | fore200e_swap(fore200e->stats->aux.large_b1_failed), | 3077 | cpu_to_be32(fore200e->stats->aux.large_b1_failed), |
3108 | fore200e_swap(fore200e->stats->aux.small_b2_failed), | 3078 | cpu_to_be32(fore200e->stats->aux.small_b2_failed), |
3109 | fore200e_swap(fore200e->stats->aux.large_b2_failed), | 3079 | cpu_to_be32(fore200e->stats->aux.large_b2_failed), |
3110 | fore200e_swap(fore200e->stats->aux.rpd_alloc_failed), | 3080 | cpu_to_be32(fore200e->stats->aux.rpd_alloc_failed), |
3111 | fore200e->tx_sat); | 3081 | fore200e->tx_sat); |
3112 | 3082 | ||
3113 | if (!left--) | 3083 | if (!left--) |
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 68dd42b9bac7..862e483cce8a 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -137,7 +137,6 @@ header-y += radeonfb.h | |||
137 | header-y += raw.h | 137 | header-y += raw.h |
138 | header-y += resource.h | 138 | header-y += resource.h |
139 | header-y += rose.h | 139 | header-y += rose.h |
140 | header-y += sctp.h | ||
141 | header-y += smbno.h | 140 | header-y += smbno.h |
142 | header-y += snmp.h | 141 | header-y += snmp.h |
143 | header-y += sockios.h | 142 | header-y += sockios.h |
diff --git a/include/linux/sctp.h b/include/linux/sctp.h index 35108fe7a686..d4f86560bfff 100644 --- a/include/linux/sctp.h +++ b/include/linux/sctp.h | |||
@@ -180,7 +180,7 @@ typedef enum { | |||
180 | SCTP_PARAM_ERR_CAUSE = __constant_htons(0xc003), | 180 | SCTP_PARAM_ERR_CAUSE = __constant_htons(0xc003), |
181 | SCTP_PARAM_SET_PRIMARY = __constant_htons(0xc004), | 181 | SCTP_PARAM_SET_PRIMARY = __constant_htons(0xc004), |
182 | SCTP_PARAM_SUCCESS_REPORT = __constant_htons(0xc005), | 182 | SCTP_PARAM_SUCCESS_REPORT = __constant_htons(0xc005), |
183 | SCTP_PARAM_ADAPTION_LAYER_IND = __constant_htons(0xc006), | 183 | SCTP_PARAM_ADAPTATION_LAYER_IND = __constant_htons(0xc006), |
184 | 184 | ||
185 | } sctp_param_t; /* enum */ | 185 | } sctp_param_t; /* enum */ |
186 | 186 | ||
@@ -281,11 +281,11 @@ typedef struct sctp_ecn_capable_param { | |||
281 | sctp_paramhdr_t param_hdr; | 281 | sctp_paramhdr_t param_hdr; |
282 | } __attribute__((packed)) sctp_ecn_capable_param_t; | 282 | } __attribute__((packed)) sctp_ecn_capable_param_t; |
283 | 283 | ||
284 | /* ADDIP Section 3.2.6 Adaption Layer Indication */ | 284 | /* ADDIP Section 3.2.6 Adaptation Layer Indication */ |
285 | typedef struct sctp_adaption_ind_param { | 285 | typedef struct sctp_adaptation_ind_param { |
286 | struct sctp_paramhdr param_hdr; | 286 | struct sctp_paramhdr param_hdr; |
287 | __be32 adaption_ind; | 287 | __be32 adaptation_ind; |
288 | } __attribute__((packed)) sctp_adaption_ind_param_t; | 288 | } __attribute__((packed)) sctp_adaptation_ind_param_t; |
289 | 289 | ||
290 | /* RFC 2960. Section 3.3.3 Initiation Acknowledgement (INIT ACK) (2): | 290 | /* RFC 2960. Section 3.3.3 Initiation Acknowledgement (INIT ACK) (2): |
291 | * The INIT ACK chunk is used to acknowledge the initiation of an SCTP | 291 | * The INIT ACK chunk is used to acknowledge the initiation of an SCTP |
diff --git a/include/net/ip6_checksum.h b/include/net/ip6_checksum.h index 68e2b32cf1d6..bc1b0fda2b04 100644 --- a/include/net/ip6_checksum.h +++ b/include/net/ip6_checksum.h | |||
@@ -87,7 +87,7 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr, | |||
87 | carry = (sum < uproto); | 87 | carry = (sum < uproto); |
88 | sum += carry; | 88 | sum += carry; |
89 | 89 | ||
90 | return csum_fold((__force __wsum)csum); | 90 | return csum_fold((__force __wsum)sum); |
91 | } | 91 | } |
92 | 92 | ||
93 | #endif | 93 | #endif |
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index c818f87122af..28af68059521 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -128,8 +128,6 @@ extern int sctp_copy_local_addr_list(struct sctp_bind_addr *, | |||
128 | int flags); | 128 | int flags); |
129 | extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family); | 129 | extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family); |
130 | extern int sctp_register_pf(struct sctp_pf *, sa_family_t); | 130 | extern int sctp_register_pf(struct sctp_pf *, sa_family_t); |
131 | int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev, | ||
132 | void *ptr); | ||
133 | 131 | ||
134 | /* | 132 | /* |
135 | * sctp/socket.c | 133 | * sctp/socket.c |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 8d7f26d684e5..31a8e88f1a74 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -306,7 +306,7 @@ struct sctp_sock { | |||
306 | __u8 disable_fragments; | 306 | __u8 disable_fragments; |
307 | __u8 pd_mode; | 307 | __u8 pd_mode; |
308 | __u8 v4mapped; | 308 | __u8 v4mapped; |
309 | __u32 adaption_ind; | 309 | __u32 adaptation_ind; |
310 | 310 | ||
311 | /* Receive to here while partial delivery is in effect. */ | 311 | /* Receive to here while partial delivery is in effect. */ |
312 | struct sk_buff_head pd_lobby; | 312 | struct sk_buff_head pd_lobby; |
@@ -388,7 +388,7 @@ struct sctp_cookie { | |||
388 | /* Padding for future use */ | 388 | /* Padding for future use */ |
389 | __u8 padding; | 389 | __u8 padding; |
390 | 390 | ||
391 | __u32 adaption_ind; | 391 | __u32 adaptation_ind; |
392 | 392 | ||
393 | 393 | ||
394 | /* This is a shim for my peer's INIT packet, followed by | 394 | /* This is a shim for my peer's INIT packet, followed by |
@@ -431,7 +431,7 @@ union sctp_params { | |||
431 | struct sctp_ipv4addr_param *v4; | 431 | struct sctp_ipv4addr_param *v4; |
432 | struct sctp_ipv6addr_param *v6; | 432 | struct sctp_ipv6addr_param *v6; |
433 | union sctp_addr_param *addr; | 433 | union sctp_addr_param *addr; |
434 | struct sctp_adaption_ind_param *aind; | 434 | struct sctp_adaptation_ind_param *aind; |
435 | }; | 435 | }; |
436 | 436 | ||
437 | /* RFC 2960. Section 3.3.5 Heartbeat. | 437 | /* RFC 2960. Section 3.3.5 Heartbeat. |
@@ -1483,7 +1483,7 @@ struct sctp_association { | |||
1483 | __u8 asconf_capable; /* Does peer support ADDIP? */ | 1483 | __u8 asconf_capable; /* Does peer support ADDIP? */ |
1484 | __u8 prsctp_capable; /* Can peer do PR-SCTP? */ | 1484 | __u8 prsctp_capable; /* Can peer do PR-SCTP? */ |
1485 | 1485 | ||
1486 | __u32 adaption_ind; /* Adaption Code point. */ | 1486 | __u32 adaptation_ind; /* Adaptation Code point. */ |
1487 | 1487 | ||
1488 | /* This mask is used to disable sending the ASCONF chunk | 1488 | /* This mask is used to disable sending the ASCONF chunk |
1489 | * with specified parameter to peer. | 1489 | * with specified parameter to peer. |
diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h index 1a4ddc1ec7d2..2923e3d31a08 100644 --- a/include/net/sctp/ulpevent.h +++ b/include/net/sctp/ulpevent.h | |||
@@ -120,7 +120,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_pdapi( | |||
120 | const struct sctp_association *asoc, | 120 | const struct sctp_association *asoc, |
121 | __u32 indication, gfp_t gfp); | 121 | __u32 indication, gfp_t gfp); |
122 | 122 | ||
123 | struct sctp_ulpevent *sctp_ulpevent_make_adaption_indication( | 123 | struct sctp_ulpevent *sctp_ulpevent_make_adaptation_indication( |
124 | const struct sctp_association *asoc, gfp_t gfp); | 124 | const struct sctp_association *asoc, gfp_t gfp); |
125 | 125 | ||
126 | struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc, | 126 | struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc, |
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h index 9e4a39fd129d..67a30eb2b3a4 100644 --- a/include/net/sctp/user.h +++ b/include/net/sctp/user.h | |||
@@ -75,8 +75,8 @@ enum sctp_optname { | |||
75 | #define SCTP_SET_PEER_PRIMARY_ADDR SCTP_SET_PEER_PRIMARY_ADDR | 75 | #define SCTP_SET_PEER_PRIMARY_ADDR SCTP_SET_PEER_PRIMARY_ADDR |
76 | SCTP_PRIMARY_ADDR, | 76 | SCTP_PRIMARY_ADDR, |
77 | #define SCTP_PRIMARY_ADDR SCTP_PRIMARY_ADDR | 77 | #define SCTP_PRIMARY_ADDR SCTP_PRIMARY_ADDR |
78 | SCTP_ADAPTION_LAYER, | 78 | SCTP_ADAPTATION_LAYER, |
79 | #define SCTP_ADAPTION_LAYER SCTP_ADAPTION_LAYER | 79 | #define SCTP_ADAPTATION_LAYER SCTP_ADAPTATION_LAYER |
80 | SCTP_DISABLE_FRAGMENTS, | 80 | SCTP_DISABLE_FRAGMENTS, |
81 | #define SCTP_DISABLE_FRAGMENTS SCTP_DISABLE_FRAGMENTS | 81 | #define SCTP_DISABLE_FRAGMENTS SCTP_DISABLE_FRAGMENTS |
82 | SCTP_PEER_ADDR_PARAMS, | 82 | SCTP_PEER_ADDR_PARAMS, |
@@ -331,17 +331,17 @@ struct sctp_shutdown_event { | |||
331 | }; | 331 | }; |
332 | 332 | ||
333 | /* | 333 | /* |
334 | * 5.3.1.6 SCTP_ADAPTION_INDICATION | 334 | * 5.3.1.6 SCTP_ADAPTATION_INDICATION |
335 | * | 335 | * |
336 | * When a peer sends a Adaption Layer Indication parameter , SCTP | 336 | * When a peer sends a Adaptation Layer Indication parameter , SCTP |
337 | * delivers this notification to inform the application | 337 | * delivers this notification to inform the application |
338 | * that of the peers requested adaption layer. | 338 | * that of the peers requested adaptation layer. |
339 | */ | 339 | */ |
340 | struct sctp_adaption_event { | 340 | struct sctp_adaptation_event { |
341 | __u16 sai_type; | 341 | __u16 sai_type; |
342 | __u16 sai_flags; | 342 | __u16 sai_flags; |
343 | __u32 sai_length; | 343 | __u32 sai_length; |
344 | __u32 sai_adaption_ind; | 344 | __u32 sai_adaptation_ind; |
345 | sctp_assoc_t sai_assoc_id; | 345 | sctp_assoc_t sai_assoc_id; |
346 | }; | 346 | }; |
347 | 347 | ||
@@ -374,7 +374,7 @@ struct sctp_event_subscribe { | |||
374 | __u8 sctp_peer_error_event; | 374 | __u8 sctp_peer_error_event; |
375 | __u8 sctp_shutdown_event; | 375 | __u8 sctp_shutdown_event; |
376 | __u8 sctp_partial_delivery_event; | 376 | __u8 sctp_partial_delivery_event; |
377 | __u8 sctp_adaption_layer_event; | 377 | __u8 sctp_adaptation_layer_event; |
378 | }; | 378 | }; |
379 | 379 | ||
380 | /* | 380 | /* |
@@ -395,7 +395,7 @@ union sctp_notification { | |||
395 | struct sctp_remote_error sn_remote_error; | 395 | struct sctp_remote_error sn_remote_error; |
396 | struct sctp_send_failed sn_send_failed; | 396 | struct sctp_send_failed sn_send_failed; |
397 | struct sctp_shutdown_event sn_shutdown_event; | 397 | struct sctp_shutdown_event sn_shutdown_event; |
398 | struct sctp_adaption_event sn_adaption_event; | 398 | struct sctp_adaptation_event sn_adaptation_event; |
399 | struct sctp_pdapi_event sn_pdapi_event; | 399 | struct sctp_pdapi_event sn_pdapi_event; |
400 | }; | 400 | }; |
401 | 401 | ||
@@ -412,7 +412,7 @@ enum sctp_sn_type { | |||
412 | SCTP_REMOTE_ERROR, | 412 | SCTP_REMOTE_ERROR, |
413 | SCTP_SHUTDOWN_EVENT, | 413 | SCTP_SHUTDOWN_EVENT, |
414 | SCTP_PARTIAL_DELIVERY_EVENT, | 414 | SCTP_PARTIAL_DELIVERY_EVENT, |
415 | SCTP_ADAPTION_INDICATION, | 415 | SCTP_ADAPTATION_INDICATION, |
416 | }; | 416 | }; |
417 | 417 | ||
418 | /* Notification error codes used to fill up the error fields in some | 418 | /* Notification error codes used to fill up the error fields in some |
@@ -488,13 +488,13 @@ struct sctp_prim { | |||
488 | } __attribute__((packed, aligned(4))); | 488 | } __attribute__((packed, aligned(4))); |
489 | 489 | ||
490 | /* | 490 | /* |
491 | * 7.1.11 Set Adaption Layer Indicator (SCTP_ADAPTION_LAYER) | 491 | * 7.1.11 Set Adaptation Layer Indicator (SCTP_ADAPTATION_LAYER) |
492 | * | 492 | * |
493 | * Requests that the local endpoint set the specified Adaption Layer | 493 | * Requests that the local endpoint set the specified Adaptation Layer |
494 | * Indication parameter for all future INIT and INIT-ACK exchanges. | 494 | * Indication parameter for all future INIT and INIT-ACK exchanges. |
495 | */ | 495 | */ |
496 | struct sctp_setadaption { | 496 | struct sctp_setadaptation { |
497 | __u32 ssb_adaption_ind; | 497 | __u32 ssb_adaptation_ind; |
498 | }; | 498 | }; |
499 | 499 | ||
500 | /* | 500 | /* |
diff --git a/include/net/tcp.h b/include/net/tcp.h index c99774f15eba..b7d8317f22ac 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -242,14 +242,9 @@ extern int tcp_memory_pressure; | |||
242 | 242 | ||
243 | static inline int before(__u32 seq1, __u32 seq2) | 243 | static inline int before(__u32 seq1, __u32 seq2) |
244 | { | 244 | { |
245 | return (__s32)(seq1-seq2) < 0; | 245 | return (__s32)(seq2-seq1) > 0; |
246 | } | 246 | } |
247 | 247 | #define after(seq2, seq1) before(seq1, seq2) | |
248 | static inline int after(__u32 seq1, __u32 seq2) | ||
249 | { | ||
250 | return (__s32)(seq2-seq1) < 0; | ||
251 | } | ||
252 | |||
253 | 248 | ||
254 | /* is s2<=s1<=s3 ? */ | 249 | /* is s2<=s1<=s3 ? */ |
255 | static inline int between(__u32 seq1, __u32 seq2, __u32 seq3) | 250 | static inline int between(__u32 seq1, __u32 seq2, __u32 seq3) |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 035915fc9ed3..cfff930f2baf 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -165,11 +165,14 @@ int __udp_lib_get_port(struct sock *sk, unsigned short snum, | |||
165 | goto gotit; | 165 | goto gotit; |
166 | } | 166 | } |
167 | size = 0; | 167 | size = 0; |
168 | sk_for_each(sk2, node, head) | 168 | sk_for_each(sk2, node, head) { |
169 | if (++size < best_size_so_far) { | 169 | if (++size >= best_size_so_far) |
170 | best_size_so_far = size; | 170 | goto next; |
171 | best = result; | 171 | } |
172 | } | 172 | best_size_so_far = size; |
173 | best = result; | ||
174 | next: | ||
175 | ; | ||
173 | } | 176 | } |
174 | result = best; | 177 | result = best; |
175 | for(i = 0; i < (1 << 16) / UDP_HTABLE_SIZE; i++, result += UDP_HTABLE_SIZE) { | 178 | for(i = 0; i < (1 << 16) / UDP_HTABLE_SIZE; i++, result += UDP_HTABLE_SIZE) { |
diff --git a/net/netlabel/netlabel_cipso_v4.c b/net/netlabel/netlabel_cipso_v4.c index 743b05734a49..4afc75f9e377 100644 --- a/net/netlabel/netlabel_cipso_v4.c +++ b/net/netlabel/netlabel_cipso_v4.c | |||
@@ -162,6 +162,7 @@ static int netlbl_cipsov4_add_std(struct genl_info *info) | |||
162 | struct nlattr *nla_b; | 162 | struct nlattr *nla_b; |
163 | int nla_a_rem; | 163 | int nla_a_rem; |
164 | int nla_b_rem; | 164 | int nla_b_rem; |
165 | u32 iter; | ||
165 | 166 | ||
166 | if (!info->attrs[NLBL_CIPSOV4_A_TAGLST] || | 167 | if (!info->attrs[NLBL_CIPSOV4_A_TAGLST] || |
167 | !info->attrs[NLBL_CIPSOV4_A_MLSLVLLST]) | 168 | !info->attrs[NLBL_CIPSOV4_A_MLSLVLLST]) |
@@ -185,20 +186,31 @@ static int netlbl_cipsov4_add_std(struct genl_info *info) | |||
185 | ret_val = netlbl_cipsov4_add_common(info, doi_def); | 186 | ret_val = netlbl_cipsov4_add_common(info, doi_def); |
186 | if (ret_val != 0) | 187 | if (ret_val != 0) |
187 | goto add_std_failure; | 188 | goto add_std_failure; |
189 | ret_val = -EINVAL; | ||
188 | 190 | ||
189 | nla_for_each_nested(nla_a, | 191 | nla_for_each_nested(nla_a, |
190 | info->attrs[NLBL_CIPSOV4_A_MLSLVLLST], | 192 | info->attrs[NLBL_CIPSOV4_A_MLSLVLLST], |
191 | nla_a_rem) | 193 | nla_a_rem) |
192 | if (nla_a->nla_type == NLBL_CIPSOV4_A_MLSLVL) { | 194 | if (nla_a->nla_type == NLBL_CIPSOV4_A_MLSLVL) { |
195 | if (nla_validate_nested(nla_a, | ||
196 | NLBL_CIPSOV4_A_MAX, | ||
197 | netlbl_cipsov4_genl_policy) != 0) | ||
198 | goto add_std_failure; | ||
193 | nla_for_each_nested(nla_b, nla_a, nla_b_rem) | 199 | nla_for_each_nested(nla_b, nla_a, nla_b_rem) |
194 | switch (nla_b->nla_type) { | 200 | switch (nla_b->nla_type) { |
195 | case NLBL_CIPSOV4_A_MLSLVLLOC: | 201 | case NLBL_CIPSOV4_A_MLSLVLLOC: |
202 | if (nla_get_u32(nla_b) > | ||
203 | CIPSO_V4_MAX_LOC_LVLS) | ||
204 | goto add_std_failure; | ||
196 | if (nla_get_u32(nla_b) >= | 205 | if (nla_get_u32(nla_b) >= |
197 | doi_def->map.std->lvl.local_size) | 206 | doi_def->map.std->lvl.local_size) |
198 | doi_def->map.std->lvl.local_size = | 207 | doi_def->map.std->lvl.local_size = |
199 | nla_get_u32(nla_b) + 1; | 208 | nla_get_u32(nla_b) + 1; |
200 | break; | 209 | break; |
201 | case NLBL_CIPSOV4_A_MLSLVLREM: | 210 | case NLBL_CIPSOV4_A_MLSLVLREM: |
211 | if (nla_get_u32(nla_b) > | ||
212 | CIPSO_V4_MAX_REM_LVLS) | ||
213 | goto add_std_failure; | ||
202 | if (nla_get_u32(nla_b) >= | 214 | if (nla_get_u32(nla_b) >= |
203 | doi_def->map.std->lvl.cipso_size) | 215 | doi_def->map.std->lvl.cipso_size) |
204 | doi_def->map.std->lvl.cipso_size = | 216 | doi_def->map.std->lvl.cipso_size = |
@@ -206,9 +218,6 @@ static int netlbl_cipsov4_add_std(struct genl_info *info) | |||
206 | break; | 218 | break; |
207 | } | 219 | } |
208 | } | 220 | } |
209 | if (doi_def->map.std->lvl.local_size > CIPSO_V4_MAX_LOC_LVLS || | ||
210 | doi_def->map.std->lvl.cipso_size > CIPSO_V4_MAX_REM_LVLS) | ||
211 | goto add_std_failure; | ||
212 | doi_def->map.std->lvl.local = kcalloc(doi_def->map.std->lvl.local_size, | 221 | doi_def->map.std->lvl.local = kcalloc(doi_def->map.std->lvl.local_size, |
213 | sizeof(u32), | 222 | sizeof(u32), |
214 | GFP_KERNEL); | 223 | GFP_KERNEL); |
@@ -223,6 +232,10 @@ static int netlbl_cipsov4_add_std(struct genl_info *info) | |||
223 | ret_val = -ENOMEM; | 232 | ret_val = -ENOMEM; |
224 | goto add_std_failure; | 233 | goto add_std_failure; |
225 | } | 234 | } |
235 | for (iter = 0; iter < doi_def->map.std->lvl.local_size; iter++) | ||
236 | doi_def->map.std->lvl.local[iter] = CIPSO_V4_INV_LVL; | ||
237 | for (iter = 0; iter < doi_def->map.std->lvl.cipso_size; iter++) | ||
238 | doi_def->map.std->lvl.cipso[iter] = CIPSO_V4_INV_LVL; | ||
226 | nla_for_each_nested(nla_a, | 239 | nla_for_each_nested(nla_a, |
227 | info->attrs[NLBL_CIPSOV4_A_MLSLVLLST], | 240 | info->attrs[NLBL_CIPSOV4_A_MLSLVLLST], |
228 | nla_a_rem) | 241 | nla_a_rem) |
@@ -230,11 +243,6 @@ static int netlbl_cipsov4_add_std(struct genl_info *info) | |||
230 | struct nlattr *lvl_loc; | 243 | struct nlattr *lvl_loc; |
231 | struct nlattr *lvl_rem; | 244 | struct nlattr *lvl_rem; |
232 | 245 | ||
233 | if (nla_validate_nested(nla_a, | ||
234 | NLBL_CIPSOV4_A_MAX, | ||
235 | netlbl_cipsov4_genl_policy) != 0) | ||
236 | goto add_std_failure; | ||
237 | |||
238 | lvl_loc = nla_find_nested(nla_a, | 246 | lvl_loc = nla_find_nested(nla_a, |
239 | NLBL_CIPSOV4_A_MLSLVLLOC); | 247 | NLBL_CIPSOV4_A_MLSLVLLOC); |
240 | lvl_rem = nla_find_nested(nla_a, | 248 | lvl_rem = nla_find_nested(nla_a, |
@@ -264,12 +272,18 @@ static int netlbl_cipsov4_add_std(struct genl_info *info) | |||
264 | nla_for_each_nested(nla_b, nla_a, nla_b_rem) | 272 | nla_for_each_nested(nla_b, nla_a, nla_b_rem) |
265 | switch (nla_b->nla_type) { | 273 | switch (nla_b->nla_type) { |
266 | case NLBL_CIPSOV4_A_MLSCATLOC: | 274 | case NLBL_CIPSOV4_A_MLSCATLOC: |
275 | if (nla_get_u32(nla_b) > | ||
276 | CIPSO_V4_MAX_LOC_CATS) | ||
277 | goto add_std_failure; | ||
267 | if (nla_get_u32(nla_b) >= | 278 | if (nla_get_u32(nla_b) >= |
268 | doi_def->map.std->cat.local_size) | 279 | doi_def->map.std->cat.local_size) |
269 | doi_def->map.std->cat.local_size = | 280 | doi_def->map.std->cat.local_size = |
270 | nla_get_u32(nla_b) + 1; | 281 | nla_get_u32(nla_b) + 1; |
271 | break; | 282 | break; |
272 | case NLBL_CIPSOV4_A_MLSCATREM: | 283 | case NLBL_CIPSOV4_A_MLSCATREM: |
284 | if (nla_get_u32(nla_b) > | ||
285 | CIPSO_V4_MAX_REM_CATS) | ||
286 | goto add_std_failure; | ||
273 | if (nla_get_u32(nla_b) >= | 287 | if (nla_get_u32(nla_b) >= |
274 | doi_def->map.std->cat.cipso_size) | 288 | doi_def->map.std->cat.cipso_size) |
275 | doi_def->map.std->cat.cipso_size = | 289 | doi_def->map.std->cat.cipso_size = |
@@ -277,9 +291,6 @@ static int netlbl_cipsov4_add_std(struct genl_info *info) | |||
277 | break; | 291 | break; |
278 | } | 292 | } |
279 | } | 293 | } |
280 | if (doi_def->map.std->cat.local_size > CIPSO_V4_MAX_LOC_CATS || | ||
281 | doi_def->map.std->cat.cipso_size > CIPSO_V4_MAX_REM_CATS) | ||
282 | goto add_std_failure; | ||
283 | doi_def->map.std->cat.local = kcalloc( | 294 | doi_def->map.std->cat.local = kcalloc( |
284 | doi_def->map.std->cat.local_size, | 295 | doi_def->map.std->cat.local_size, |
285 | sizeof(u32), | 296 | sizeof(u32), |
@@ -296,6 +307,10 @@ static int netlbl_cipsov4_add_std(struct genl_info *info) | |||
296 | ret_val = -ENOMEM; | 307 | ret_val = -ENOMEM; |
297 | goto add_std_failure; | 308 | goto add_std_failure; |
298 | } | 309 | } |
310 | for (iter = 0; iter < doi_def->map.std->cat.local_size; iter++) | ||
311 | doi_def->map.std->cat.local[iter] = CIPSO_V4_INV_CAT; | ||
312 | for (iter = 0; iter < doi_def->map.std->cat.cipso_size; iter++) | ||
313 | doi_def->map.std->cat.cipso[iter] = CIPSO_V4_INV_CAT; | ||
299 | nla_for_each_nested(nla_a, | 314 | nla_for_each_nested(nla_a, |
300 | info->attrs[NLBL_CIPSOV4_A_MLSCATLST], | 315 | info->attrs[NLBL_CIPSOV4_A_MLSCATLST], |
301 | nla_a_rem) | 316 | nla_a_rem) |
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c index d8d36dee5ab6..ef36be073a13 100644 --- a/net/sctp/ipv6.c +++ b/net/sctp/ipv6.c | |||
@@ -79,8 +79,8 @@ | |||
79 | #include <asm/uaccess.h> | 79 | #include <asm/uaccess.h> |
80 | 80 | ||
81 | /* Event handler for inet6 address addition/deletion events. */ | 81 | /* Event handler for inet6 address addition/deletion events. */ |
82 | int sctp_inet6addr_event(struct notifier_block *this, unsigned long ev, | 82 | static int sctp_inet6addr_event(struct notifier_block *this, unsigned long ev, |
83 | void *ptr) | 83 | void *ptr) |
84 | { | 84 | { |
85 | struct inet6_ifaddr *ifa = (struct inet6_ifaddr *)ptr; | 85 | struct inet6_ifaddr *ifa = (struct inet6_ifaddr *)ptr; |
86 | struct sctp_sockaddr_entry *addr; | 86 | struct sctp_sockaddr_entry *addr; |
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 3a3db56729ce..225f39b5d595 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
@@ -601,8 +601,8 @@ static void sctp_v4_seq_dump_addr(struct seq_file *seq, union sctp_addr *addr) | |||
601 | } | 601 | } |
602 | 602 | ||
603 | /* Event handler for inet address addition/deletion events. */ | 603 | /* Event handler for inet address addition/deletion events. */ |
604 | int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev, | 604 | static int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev, |
605 | void *ptr) | 605 | void *ptr) |
606 | { | 606 | { |
607 | struct in_ifaddr *ifa = (struct in_ifaddr *)ptr; | 607 | struct in_ifaddr *ifa = (struct in_ifaddr *)ptr; |
608 | struct sctp_sockaddr_entry *addr; | 608 | struct sctp_sockaddr_entry *addr; |
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index 30927d3a597f..f0bbe36799cf 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c | |||
@@ -184,7 +184,7 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc, | |||
184 | struct sctp_sock *sp; | 184 | struct sctp_sock *sp; |
185 | sctp_supported_addrs_param_t sat; | 185 | sctp_supported_addrs_param_t sat; |
186 | __be16 types[2]; | 186 | __be16 types[2]; |
187 | sctp_adaption_ind_param_t aiparam; | 187 | sctp_adaptation_ind_param_t aiparam; |
188 | 188 | ||
189 | /* RFC 2960 3.3.2 Initiation (INIT) (1) | 189 | /* RFC 2960 3.3.2 Initiation (INIT) (1) |
190 | * | 190 | * |
@@ -249,9 +249,9 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc, | |||
249 | sctp_addto_chunk(retval, sizeof(ecap_param), &ecap_param); | 249 | sctp_addto_chunk(retval, sizeof(ecap_param), &ecap_param); |
250 | if (sctp_prsctp_enable) | 250 | if (sctp_prsctp_enable) |
251 | sctp_addto_chunk(retval, sizeof(prsctp_param), &prsctp_param); | 251 | sctp_addto_chunk(retval, sizeof(prsctp_param), &prsctp_param); |
252 | aiparam.param_hdr.type = SCTP_PARAM_ADAPTION_LAYER_IND; | 252 | aiparam.param_hdr.type = SCTP_PARAM_ADAPTATION_LAYER_IND; |
253 | aiparam.param_hdr.length = htons(sizeof(aiparam)); | 253 | aiparam.param_hdr.length = htons(sizeof(aiparam)); |
254 | aiparam.adaption_ind = htonl(sp->adaption_ind); | 254 | aiparam.adaptation_ind = htonl(sp->adaptation_ind); |
255 | sctp_addto_chunk(retval, sizeof(aiparam), &aiparam); | 255 | sctp_addto_chunk(retval, sizeof(aiparam), &aiparam); |
256 | nodata: | 256 | nodata: |
257 | kfree(addrs.v); | 257 | kfree(addrs.v); |
@@ -269,7 +269,7 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc, | |||
269 | sctp_cookie_param_t *cookie; | 269 | sctp_cookie_param_t *cookie; |
270 | int cookie_len; | 270 | int cookie_len; |
271 | size_t chunksize; | 271 | size_t chunksize; |
272 | sctp_adaption_ind_param_t aiparam; | 272 | sctp_adaptation_ind_param_t aiparam; |
273 | 273 | ||
274 | retval = NULL; | 274 | retval = NULL; |
275 | 275 | ||
@@ -323,9 +323,9 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc, | |||
323 | if (asoc->peer.prsctp_capable) | 323 | if (asoc->peer.prsctp_capable) |
324 | sctp_addto_chunk(retval, sizeof(prsctp_param), &prsctp_param); | 324 | sctp_addto_chunk(retval, sizeof(prsctp_param), &prsctp_param); |
325 | 325 | ||
326 | aiparam.param_hdr.type = SCTP_PARAM_ADAPTION_LAYER_IND; | 326 | aiparam.param_hdr.type = SCTP_PARAM_ADAPTATION_LAYER_IND; |
327 | aiparam.param_hdr.length = htons(sizeof(aiparam)); | 327 | aiparam.param_hdr.length = htons(sizeof(aiparam)); |
328 | aiparam.adaption_ind = htonl(sctp_sk(asoc->base.sk)->adaption_ind); | 328 | aiparam.adaptation_ind = htonl(sctp_sk(asoc->base.sk)->adaptation_ind); |
329 | sctp_addto_chunk(retval, sizeof(aiparam), &aiparam); | 329 | sctp_addto_chunk(retval, sizeof(aiparam), &aiparam); |
330 | 330 | ||
331 | /* We need to remove the const qualifier at this point. */ | 331 | /* We need to remove the const qualifier at this point. */ |
@@ -1300,8 +1300,8 @@ static sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep, | |||
1300 | /* Remember PR-SCTP capability. */ | 1300 | /* Remember PR-SCTP capability. */ |
1301 | cookie->c.prsctp_capable = asoc->peer.prsctp_capable; | 1301 | cookie->c.prsctp_capable = asoc->peer.prsctp_capable; |
1302 | 1302 | ||
1303 | /* Save adaption indication in the cookie. */ | 1303 | /* Save adaptation indication in the cookie. */ |
1304 | cookie->c.adaption_ind = asoc->peer.adaption_ind; | 1304 | cookie->c.adaptation_ind = asoc->peer.adaptation_ind; |
1305 | 1305 | ||
1306 | /* Set an expiration time for the cookie. */ | 1306 | /* Set an expiration time for the cookie. */ |
1307 | do_gettimeofday(&cookie->c.expiration); | 1307 | do_gettimeofday(&cookie->c.expiration); |
@@ -1512,7 +1512,7 @@ no_hmac: | |||
1512 | retval->addip_serial = retval->c.initial_tsn; | 1512 | retval->addip_serial = retval->c.initial_tsn; |
1513 | retval->adv_peer_ack_point = retval->ctsn_ack_point; | 1513 | retval->adv_peer_ack_point = retval->ctsn_ack_point; |
1514 | retval->peer.prsctp_capable = retval->c.prsctp_capable; | 1514 | retval->peer.prsctp_capable = retval->c.prsctp_capable; |
1515 | retval->peer.adaption_ind = retval->c.adaption_ind; | 1515 | retval->peer.adaptation_ind = retval->c.adaptation_ind; |
1516 | 1516 | ||
1517 | /* The INIT stuff will be done by the side effects. */ | 1517 | /* The INIT stuff will be done by the side effects. */ |
1518 | return retval; | 1518 | return retval; |
@@ -1743,7 +1743,7 @@ static int sctp_verify_param(const struct sctp_association *asoc, | |||
1743 | case SCTP_PARAM_HEARTBEAT_INFO: | 1743 | case SCTP_PARAM_HEARTBEAT_INFO: |
1744 | case SCTP_PARAM_UNRECOGNIZED_PARAMETERS: | 1744 | case SCTP_PARAM_UNRECOGNIZED_PARAMETERS: |
1745 | case SCTP_PARAM_ECN_CAPABLE: | 1745 | case SCTP_PARAM_ECN_CAPABLE: |
1746 | case SCTP_PARAM_ADAPTION_LAYER_IND: | 1746 | case SCTP_PARAM_ADAPTATION_LAYER_IND: |
1747 | break; | 1747 | break; |
1748 | 1748 | ||
1749 | case SCTP_PARAM_HOST_NAME_ADDRESS: | 1749 | case SCTP_PARAM_HOST_NAME_ADDRESS: |
@@ -2098,8 +2098,8 @@ static int sctp_process_param(struct sctp_association *asoc, | |||
2098 | asoc->peer.ecn_capable = 1; | 2098 | asoc->peer.ecn_capable = 1; |
2099 | break; | 2099 | break; |
2100 | 2100 | ||
2101 | case SCTP_PARAM_ADAPTION_LAYER_IND: | 2101 | case SCTP_PARAM_ADAPTATION_LAYER_IND: |
2102 | asoc->peer.adaption_ind = param.aind->adaption_ind; | 2102 | asoc->peer.adaptation_ind = param.aind->adaptation_ind; |
2103 | break; | 2103 | break; |
2104 | 2104 | ||
2105 | case SCTP_PARAM_FWD_TSN_SUPPORT: | 2105 | case SCTP_PARAM_FWD_TSN_SUPPORT: |
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 27cc444aaf11..aa51d190bfb2 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c | |||
@@ -688,12 +688,12 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(const struct sctp_endpoint *ep, | |||
688 | goto nomem_ev; | 688 | goto nomem_ev; |
689 | 689 | ||
690 | /* Sockets API Draft Section 5.3.1.6 | 690 | /* Sockets API Draft Section 5.3.1.6 |
691 | * When a peer sends a Adaption Layer Indication parameter , SCTP | 691 | * When a peer sends a Adaptation Layer Indication parameter , SCTP |
692 | * delivers this notification to inform the application that of the | 692 | * delivers this notification to inform the application that of the |
693 | * peers requested adaption layer. | 693 | * peers requested adaptation layer. |
694 | */ | 694 | */ |
695 | if (new_asoc->peer.adaption_ind) { | 695 | if (new_asoc->peer.adaptation_ind) { |
696 | ai_ev = sctp_ulpevent_make_adaption_indication(new_asoc, | 696 | ai_ev = sctp_ulpevent_make_adaptation_indication(new_asoc, |
697 | GFP_ATOMIC); | 697 | GFP_ATOMIC); |
698 | if (!ai_ev) | 698 | if (!ai_ev) |
699 | goto nomem_aiev; | 699 | goto nomem_aiev; |
@@ -820,12 +820,12 @@ sctp_disposition_t sctp_sf_do_5_1E_ca(const struct sctp_endpoint *ep, | |||
820 | sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, SCTP_ULPEVENT(ev)); | 820 | sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, SCTP_ULPEVENT(ev)); |
821 | 821 | ||
822 | /* Sockets API Draft Section 5.3.1.6 | 822 | /* Sockets API Draft Section 5.3.1.6 |
823 | * When a peer sends a Adaption Layer Indication parameter , SCTP | 823 | * When a peer sends a Adaptation Layer Indication parameter , SCTP |
824 | * delivers this notification to inform the application that of the | 824 | * delivers this notification to inform the application that of the |
825 | * peers requested adaption layer. | 825 | * peers requested adaptation layer. |
826 | */ | 826 | */ |
827 | if (asoc->peer.adaption_ind) { | 827 | if (asoc->peer.adaptation_ind) { |
828 | ev = sctp_ulpevent_make_adaption_indication(asoc, GFP_ATOMIC); | 828 | ev = sctp_ulpevent_make_adaptation_indication(asoc, GFP_ATOMIC); |
829 | if (!ev) | 829 | if (!ev) |
830 | goto nomem; | 830 | goto nomem; |
831 | 831 | ||
@@ -1698,12 +1698,12 @@ static sctp_disposition_t sctp_sf_do_dupcook_b(const struct sctp_endpoint *ep, | |||
1698 | sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, SCTP_ULPEVENT(ev)); | 1698 | sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, SCTP_ULPEVENT(ev)); |
1699 | 1699 | ||
1700 | /* Sockets API Draft Section 5.3.1.6 | 1700 | /* Sockets API Draft Section 5.3.1.6 |
1701 | * When a peer sends a Adaption Layer Indication parameter , SCTP | 1701 | * When a peer sends a Adaptation Layer Indication parameter , SCTP |
1702 | * delivers this notification to inform the application that of the | 1702 | * delivers this notification to inform the application that of the |
1703 | * peers requested adaption layer. | 1703 | * peers requested adaptation layer. |
1704 | */ | 1704 | */ |
1705 | if (asoc->peer.adaption_ind) { | 1705 | if (asoc->peer.adaptation_ind) { |
1706 | ev = sctp_ulpevent_make_adaption_indication(asoc, GFP_ATOMIC); | 1706 | ev = sctp_ulpevent_make_adaptation_indication(asoc, GFP_ATOMIC); |
1707 | if (!ev) | 1707 | if (!ev) |
1708 | goto nomem_ev; | 1708 | goto nomem_ev; |
1709 | 1709 | ||
@@ -1791,12 +1791,12 @@ static sctp_disposition_t sctp_sf_do_dupcook_d(const struct sctp_endpoint *ep, | |||
1791 | goto nomem; | 1791 | goto nomem; |
1792 | 1792 | ||
1793 | /* Sockets API Draft Section 5.3.1.6 | 1793 | /* Sockets API Draft Section 5.3.1.6 |
1794 | * When a peer sends a Adaption Layer Indication parameter, | 1794 | * When a peer sends a Adaptation Layer Indication parameter, |
1795 | * SCTP delivers this notification to inform the application | 1795 | * SCTP delivers this notification to inform the application |
1796 | * that of the peers requested adaption layer. | 1796 | * that of the peers requested adaptation layer. |
1797 | */ | 1797 | */ |
1798 | if (asoc->peer.adaption_ind) { | 1798 | if (asoc->peer.adaptation_ind) { |
1799 | ai_ev = sctp_ulpevent_make_adaption_indication(asoc, | 1799 | ai_ev = sctp_ulpevent_make_adaptation_indication(asoc, |
1800 | GFP_ATOMIC); | 1800 | GFP_ATOMIC); |
1801 | if (!ai_ev) | 1801 | if (!ai_ev) |
1802 | goto nomem; | 1802 | goto nomem; |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index bdd8bd428b64..388d0fb1a377 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -2731,17 +2731,17 @@ static int sctp_setsockopt_peer_primary_addr(struct sock *sk, char __user *optva | |||
2731 | return err; | 2731 | return err; |
2732 | } | 2732 | } |
2733 | 2733 | ||
2734 | static int sctp_setsockopt_adaption_layer(struct sock *sk, char __user *optval, | 2734 | static int sctp_setsockopt_adaptation_layer(struct sock *sk, char __user *optval, |
2735 | int optlen) | 2735 | int optlen) |
2736 | { | 2736 | { |
2737 | struct sctp_setadaption adaption; | 2737 | struct sctp_setadaptation adaptation; |
2738 | 2738 | ||
2739 | if (optlen != sizeof(struct sctp_setadaption)) | 2739 | if (optlen != sizeof(struct sctp_setadaptation)) |
2740 | return -EINVAL; | 2740 | return -EINVAL; |
2741 | if (copy_from_user(&adaption, optval, optlen)) | 2741 | if (copy_from_user(&adaptation, optval, optlen)) |
2742 | return -EFAULT; | 2742 | return -EFAULT; |
2743 | 2743 | ||
2744 | sctp_sk(sk)->adaption_ind = adaption.ssb_adaption_ind; | 2744 | sctp_sk(sk)->adaptation_ind = adaptation.ssb_adaptation_ind; |
2745 | 2745 | ||
2746 | return 0; | 2746 | return 0; |
2747 | } | 2747 | } |
@@ -2894,8 +2894,8 @@ SCTP_STATIC int sctp_setsockopt(struct sock *sk, int level, int optname, | |||
2894 | case SCTP_MAXSEG: | 2894 | case SCTP_MAXSEG: |
2895 | retval = sctp_setsockopt_maxseg(sk, optval, optlen); | 2895 | retval = sctp_setsockopt_maxseg(sk, optval, optlen); |
2896 | break; | 2896 | break; |
2897 | case SCTP_ADAPTION_LAYER: | 2897 | case SCTP_ADAPTATION_LAYER: |
2898 | retval = sctp_setsockopt_adaption_layer(sk, optval, optlen); | 2898 | retval = sctp_setsockopt_adaptation_layer(sk, optval, optlen); |
2899 | break; | 2899 | break; |
2900 | case SCTP_CONTEXT: | 2900 | case SCTP_CONTEXT: |
2901 | retval = sctp_setsockopt_context(sk, optval, optlen); | 2901 | retval = sctp_setsockopt_context(sk, optval, optlen); |
@@ -3123,7 +3123,7 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk) | |||
3123 | /* User specified fragmentation limit. */ | 3123 | /* User specified fragmentation limit. */ |
3124 | sp->user_frag = 0; | 3124 | sp->user_frag = 0; |
3125 | 3125 | ||
3126 | sp->adaption_ind = 0; | 3126 | sp->adaptation_ind = 0; |
3127 | 3127 | ||
3128 | sp->pf = sctp_get_pf_specific(sk->sk_family); | 3128 | sp->pf = sctp_get_pf_specific(sk->sk_family); |
3129 | 3129 | ||
@@ -4210,21 +4210,21 @@ static int sctp_getsockopt_primary_addr(struct sock *sk, int len, | |||
4210 | } | 4210 | } |
4211 | 4211 | ||
4212 | /* | 4212 | /* |
4213 | * 7.1.11 Set Adaption Layer Indicator (SCTP_ADAPTION_LAYER) | 4213 | * 7.1.11 Set Adaptation Layer Indicator (SCTP_ADAPTATION_LAYER) |
4214 | * | 4214 | * |
4215 | * Requests that the local endpoint set the specified Adaption Layer | 4215 | * Requests that the local endpoint set the specified Adaptation Layer |
4216 | * Indication parameter for all future INIT and INIT-ACK exchanges. | 4216 | * Indication parameter for all future INIT and INIT-ACK exchanges. |
4217 | */ | 4217 | */ |
4218 | static int sctp_getsockopt_adaption_layer(struct sock *sk, int len, | 4218 | static int sctp_getsockopt_adaptation_layer(struct sock *sk, int len, |
4219 | char __user *optval, int __user *optlen) | 4219 | char __user *optval, int __user *optlen) |
4220 | { | 4220 | { |
4221 | struct sctp_setadaption adaption; | 4221 | struct sctp_setadaptation adaptation; |
4222 | 4222 | ||
4223 | if (len != sizeof(struct sctp_setadaption)) | 4223 | if (len != sizeof(struct sctp_setadaptation)) |
4224 | return -EINVAL; | 4224 | return -EINVAL; |
4225 | 4225 | ||
4226 | adaption.ssb_adaption_ind = sctp_sk(sk)->adaption_ind; | 4226 | adaptation.ssb_adaptation_ind = sctp_sk(sk)->adaptation_ind; |
4227 | if (copy_to_user(optval, &adaption, len)) | 4227 | if (copy_to_user(optval, &adaptation, len)) |
4228 | return -EFAULT; | 4228 | return -EFAULT; |
4229 | 4229 | ||
4230 | return 0; | 4230 | return 0; |
@@ -4635,8 +4635,8 @@ SCTP_STATIC int sctp_getsockopt(struct sock *sk, int level, int optname, | |||
4635 | retval = sctp_getsockopt_peer_addr_info(sk, len, optval, | 4635 | retval = sctp_getsockopt_peer_addr_info(sk, len, optval, |
4636 | optlen); | 4636 | optlen); |
4637 | break; | 4637 | break; |
4638 | case SCTP_ADAPTION_LAYER: | 4638 | case SCTP_ADAPTATION_LAYER: |
4639 | retval = sctp_getsockopt_adaption_layer(sk, len, optval, | 4639 | retval = sctp_getsockopt_adaptation_layer(sk, len, optval, |
4640 | optlen); | 4640 | optlen); |
4641 | break; | 4641 | break; |
4642 | case SCTP_CONTEXT: | 4642 | case SCTP_CONTEXT: |
diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c index 93ac63b055ba..445e07a7ac4b 100644 --- a/net/sctp/ulpevent.c +++ b/net/sctp/ulpevent.c | |||
@@ -609,31 +609,31 @@ fail: | |||
609 | return NULL; | 609 | return NULL; |
610 | } | 610 | } |
611 | 611 | ||
612 | /* Create and initialize a SCTP_ADAPTION_INDICATION notification. | 612 | /* Create and initialize a SCTP_ADAPTATION_INDICATION notification. |
613 | * | 613 | * |
614 | * Socket Extensions for SCTP | 614 | * Socket Extensions for SCTP |
615 | * 5.3.1.6 SCTP_ADAPTION_INDICATION | 615 | * 5.3.1.6 SCTP_ADAPTATION_INDICATION |
616 | */ | 616 | */ |
617 | struct sctp_ulpevent *sctp_ulpevent_make_adaption_indication( | 617 | struct sctp_ulpevent *sctp_ulpevent_make_adaptation_indication( |
618 | const struct sctp_association *asoc, gfp_t gfp) | 618 | const struct sctp_association *asoc, gfp_t gfp) |
619 | { | 619 | { |
620 | struct sctp_ulpevent *event; | 620 | struct sctp_ulpevent *event; |
621 | struct sctp_adaption_event *sai; | 621 | struct sctp_adaptation_event *sai; |
622 | struct sk_buff *skb; | 622 | struct sk_buff *skb; |
623 | 623 | ||
624 | event = sctp_ulpevent_new(sizeof(struct sctp_adaption_event), | 624 | event = sctp_ulpevent_new(sizeof(struct sctp_adaptation_event), |
625 | MSG_NOTIFICATION, gfp); | 625 | MSG_NOTIFICATION, gfp); |
626 | if (!event) | 626 | if (!event) |
627 | goto fail; | 627 | goto fail; |
628 | 628 | ||
629 | skb = sctp_event2skb(event); | 629 | skb = sctp_event2skb(event); |
630 | sai = (struct sctp_adaption_event *) | 630 | sai = (struct sctp_adaptation_event *) |
631 | skb_put(skb, sizeof(struct sctp_adaption_event)); | 631 | skb_put(skb, sizeof(struct sctp_adaptation_event)); |
632 | 632 | ||
633 | sai->sai_type = SCTP_ADAPTION_INDICATION; | 633 | sai->sai_type = SCTP_ADAPTATION_INDICATION; |
634 | sai->sai_flags = 0; | 634 | sai->sai_flags = 0; |
635 | sai->sai_length = sizeof(struct sctp_adaption_event); | 635 | sai->sai_length = sizeof(struct sctp_adaptation_event); |
636 | sai->sai_adaption_ind = asoc->peer.adaption_ind; | 636 | sai->sai_adaptation_ind = asoc->peer.adaptation_ind; |
637 | sctp_ulpevent_set_owner(event, asoc); | 637 | sctp_ulpevent_set_owner(event, asoc); |
638 | sai->sai_assoc_id = sctp_assoc2id(asoc); | 638 | sai->sai_assoc_id = sctp_assoc2id(asoc); |
639 | 639 | ||