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

+188 -212
-4
drivers/atm/Kconfig
··· 167 167 Note that extended debugging may create certain race conditions 168 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 170 config ATM_NICSTAR 175 171 tristate "IDT 77201 (NICStAR) (ForeRunnerLE)" 176 172 depends on PCI && ATM && !64BIT
+68 -98
drivers/atm/fore200e.c
··· 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 175 /* allocate and align a chunk of memory intended to hold the data behing exchanged 195 176 between the driver and the adapter (using streaming DVMA) */ 196 177 ··· 187 206 chunk->align_size = size; 188 207 chunk->direction = direction; 189 208 190 - chunk->alloc_addr = fore200e_kmalloc(chunk->alloc_size, GFP_KERNEL | GFP_DMA); 209 + chunk->alloc_addr = kzalloc(chunk->alloc_size, GFP_KERNEL | GFP_DMA); 191 210 if (chunk->alloc_addr == NULL) 192 211 return -ENOMEM; 193 212 ··· 209 228 { 210 229 fore200e->bus->dma_unmap(fore200e, chunk->dma_addr, chunk->dma_size, chunk->direction); 211 230 212 - fore200e_kfree(chunk->alloc_addr); 231 + kfree(chunk->alloc_addr); 213 232 } 214 233 215 234 ··· 863 882 return NULL; 864 883 } 865 884 866 - fore200e = fore200e_kmalloc(sizeof(struct fore200e), GFP_KERNEL); 885 + fore200e = kzalloc(sizeof(struct fore200e), GFP_KERNEL); 867 886 if (fore200e == NULL) 868 887 return NULL; 869 888 ··· 1486 1505 1487 1506 spin_unlock_irqrestore(&fore200e->q_lock, flags); 1488 1507 1489 - fore200e_vcc = fore200e_kmalloc(sizeof(struct fore200e_vcc), GFP_ATOMIC); 1508 + fore200e_vcc = kzalloc(sizeof(struct fore200e_vcc), GFP_ATOMIC); 1490 1509 if (fore200e_vcc == NULL) { 1491 1510 vc_map->vcc = NULL; 1492 1511 return -ENOMEM; ··· 1507 1526 if (fore200e->available_cell_rate < vcc->qos.txtp.max_pcr) { 1508 1527 up(&fore200e->rate_sf); 1509 1528 1510 - fore200e_kfree(fore200e_vcc); 1529 + kfree(fore200e_vcc); 1511 1530 vc_map->vcc = NULL; 1512 1531 return -EAGAIN; 1513 1532 } ··· 1535 1554 1536 1555 fore200e->available_cell_rate += vcc->qos.txtp.max_pcr; 1537 1556 1538 - fore200e_kfree(fore200e_vcc); 1557 + kfree(fore200e_vcc); 1539 1558 return -EINVAL; 1540 1559 } 1541 1560 ··· 1611 1630 clear_bit(ATM_VF_PARTIAL,&vcc->flags); 1612 1631 1613 1632 ASSERT(fore200e_vcc); 1614 - fore200e_kfree(fore200e_vcc); 1633 + kfree(fore200e_vcc); 1615 1634 } 1616 1635 1617 1636 ··· 1812 1831 u32 stats_dma_addr; 1813 1832 1814 1833 if (fore200e->stats == NULL) { 1815 - fore200e->stats = fore200e_kmalloc(sizeof(struct stats), GFP_KERNEL | GFP_DMA); 1834 + fore200e->stats = kzalloc(sizeof(struct stats), GFP_KERNEL | GFP_DMA); 1816 1835 if (fore200e->stats == NULL) 1817 1836 return -ENOMEM; 1818 1837 } ··· 1983 2002 } 1984 2003 1985 2004 1986 - static inline unsigned int 1987 - fore200e_swap(unsigned int in) 1988 - { 1989 - #if defined(__LITTLE_ENDIAN) 1990 - return swab32(in); 1991 - #else 1992 - return in; 1993 - #endif 1994 - } 1995 - 1996 - 1997 2005 static int 1998 2006 fore200e_fetch_stats(struct fore200e* fore200e, struct sonet_stats __user *arg) 1999 2007 { ··· 1991 2021 if (fore200e_getstats(fore200e) < 0) 1992 2022 return -EIO; 1993 2023 1994 - tmp.section_bip = fore200e_swap(fore200e->stats->oc3.section_bip8_errors); 1995 - tmp.line_bip = fore200e_swap(fore200e->stats->oc3.line_bip24_errors); 1996 - tmp.path_bip = fore200e_swap(fore200e->stats->oc3.path_bip8_errors); 1997 - tmp.line_febe = fore200e_swap(fore200e->stats->oc3.line_febe_errors); 1998 - tmp.path_febe = fore200e_swap(fore200e->stats->oc3.path_febe_errors); 1999 - tmp.corr_hcs = fore200e_swap(fore200e->stats->oc3.corr_hcs_errors); 2000 - tmp.uncorr_hcs = fore200e_swap(fore200e->stats->oc3.ucorr_hcs_errors); 2001 - tmp.tx_cells = fore200e_swap(fore200e->stats->aal0.cells_transmitted) + 2002 - fore200e_swap(fore200e->stats->aal34.cells_transmitted) + 2003 - fore200e_swap(fore200e->stats->aal5.cells_transmitted); 2004 - tmp.rx_cells = fore200e_swap(fore200e->stats->aal0.cells_received) + 2005 - fore200e_swap(fore200e->stats->aal34.cells_received) + 2006 - fore200e_swap(fore200e->stats->aal5.cells_received); 2024 + tmp.section_bip = cpu_to_be32(fore200e->stats->oc3.section_bip8_errors); 2025 + tmp.line_bip = cpu_to_be32(fore200e->stats->oc3.line_bip24_errors); 2026 + tmp.path_bip = cpu_to_be32(fore200e->stats->oc3.path_bip8_errors); 2027 + tmp.line_febe = cpu_to_be32(fore200e->stats->oc3.line_febe_errors); 2028 + tmp.path_febe = cpu_to_be32(fore200e->stats->oc3.path_febe_errors); 2029 + tmp.corr_hcs = cpu_to_be32(fore200e->stats->oc3.corr_hcs_errors); 2030 + tmp.uncorr_hcs = cpu_to_be32(fore200e->stats->oc3.ucorr_hcs_errors); 2031 + tmp.tx_cells = cpu_to_be32(fore200e->stats->aal0.cells_transmitted) + 2032 + cpu_to_be32(fore200e->stats->aal34.cells_transmitted) + 2033 + cpu_to_be32(fore200e->stats->aal5.cells_transmitted); 2034 + tmp.rx_cells = cpu_to_be32(fore200e->stats->aal0.cells_received) + 2035 + cpu_to_be32(fore200e->stats->aal34.cells_received) + 2036 + cpu_to_be32(fore200e->stats->aal5.cells_received); 2007 2037 2008 2038 if (arg) 2009 2039 return copy_to_user(arg, &tmp, sizeof(struct sonet_stats)) ? -EFAULT : 0; ··· 2116 2146 static int __devinit 2117 2147 fore200e_get_esi(struct fore200e* fore200e) 2118 2148 { 2119 - struct prom_data* prom = fore200e_kmalloc(sizeof(struct prom_data), GFP_KERNEL | GFP_DMA); 2149 + struct prom_data* prom = kzalloc(sizeof(struct prom_data), GFP_KERNEL | GFP_DMA); 2120 2150 int ok, i; 2121 2151 2122 2152 if (!prom) ··· 2124 2154 2125 2155 ok = fore200e->bus->prom_read(fore200e, prom); 2126 2156 if (ok < 0) { 2127 - fore200e_kfree(prom); 2157 + kfree(prom); 2128 2158 return -EBUSY; 2129 2159 } 2130 2160 ··· 2139 2169 fore200e->esi[ i ] = fore200e->atm_dev->esi[ i ] = prom->mac_addr[ i + 2 ]; 2140 2170 } 2141 2171 2142 - fore200e_kfree(prom); 2172 + kfree(prom); 2143 2173 2144 2174 return 0; 2145 2175 } ··· 2164 2194 DPRINTK(2, "rx buffers %d / %d are being allocated\n", scheme, magn); 2165 2195 2166 2196 /* allocate the array of receive buffers */ 2167 - buffer = bsq->buffer = fore200e_kmalloc(nbr * sizeof(struct buffer), GFP_KERNEL); 2197 + buffer = bsq->buffer = kzalloc(nbr * sizeof(struct buffer), GFP_KERNEL); 2168 2198 2169 2199 if (buffer == NULL) 2170 2200 return -ENOMEM; ··· 2187 2217 2188 2218 while (i > 0) 2189 2219 fore200e_chunk_free(fore200e, &buffer[ --i ].data); 2190 - fore200e_kfree(buffer); 2220 + kfree(buffer); 2191 2221 2192 2222 return -ENOMEM; 2193 2223 } ··· 2706 2736 goto out; 2707 2737 } 2708 2738 2709 - fore200e = fore200e_kmalloc(sizeof(struct fore200e), GFP_KERNEL); 2739 + fore200e = kzalloc(sizeof(struct fore200e), GFP_KERNEL); 2710 2740 if (fore200e == NULL) { 2711 2741 err = -ENOMEM; 2712 2742 goto out_disable; ··· 2969 2999 " 4b5b:\n" 2970 3000 " crc_header_errors:\t\t%10u\n" 2971 3001 " framing_errors:\t\t%10u\n", 2972 - fore200e_swap(fore200e->stats->phy.crc_header_errors), 2973 - fore200e_swap(fore200e->stats->phy.framing_errors)); 3002 + cpu_to_be32(fore200e->stats->phy.crc_header_errors), 3003 + cpu_to_be32(fore200e->stats->phy.framing_errors)); 2974 3004 2975 3005 if (!left--) 2976 3006 return sprintf(page, "\n" ··· 2982 3012 " path_febe_errors:\t\t%10u\n" 2983 3013 " corr_hcs_errors:\t\t%10u\n" 2984 3014 " ucorr_hcs_errors:\t\t%10u\n", 2985 - fore200e_swap(fore200e->stats->oc3.section_bip8_errors), 2986 - fore200e_swap(fore200e->stats->oc3.path_bip8_errors), 2987 - fore200e_swap(fore200e->stats->oc3.line_bip24_errors), 2988 - fore200e_swap(fore200e->stats->oc3.line_febe_errors), 2989 - fore200e_swap(fore200e->stats->oc3.path_febe_errors), 2990 - fore200e_swap(fore200e->stats->oc3.corr_hcs_errors), 2991 - fore200e_swap(fore200e->stats->oc3.ucorr_hcs_errors)); 3015 + cpu_to_be32(fore200e->stats->oc3.section_bip8_errors), 3016 + cpu_to_be32(fore200e->stats->oc3.path_bip8_errors), 3017 + cpu_to_be32(fore200e->stats->oc3.line_bip24_errors), 3018 + cpu_to_be32(fore200e->stats->oc3.line_febe_errors), 3019 + cpu_to_be32(fore200e->stats->oc3.path_febe_errors), 3020 + cpu_to_be32(fore200e->stats->oc3.corr_hcs_errors), 3021 + cpu_to_be32(fore200e->stats->oc3.ucorr_hcs_errors)); 2992 3022 2993 3023 if (!left--) 2994 3024 return sprintf(page,"\n" ··· 2999 3029 " vpi no conn:\t\t%10u\n" 3000 3030 " vci out of range:\t\t%10u\n" 3001 3031 " vci no conn:\t\t%10u\n", 3002 - fore200e_swap(fore200e->stats->atm.cells_transmitted), 3003 - fore200e_swap(fore200e->stats->atm.cells_received), 3004 - fore200e_swap(fore200e->stats->atm.vpi_bad_range), 3005 - fore200e_swap(fore200e->stats->atm.vpi_no_conn), 3006 - fore200e_swap(fore200e->stats->atm.vci_bad_range), 3007 - fore200e_swap(fore200e->stats->atm.vci_no_conn)); 3032 + cpu_to_be32(fore200e->stats->atm.cells_transmitted), 3033 + cpu_to_be32(fore200e->stats->atm.cells_received), 3034 + cpu_to_be32(fore200e->stats->atm.vpi_bad_range), 3035 + cpu_to_be32(fore200e->stats->atm.vpi_no_conn), 3036 + cpu_to_be32(fore200e->stats->atm.vci_bad_range), 3037 + cpu_to_be32(fore200e->stats->atm.vci_no_conn)); 3008 3038 3009 3039 if (!left--) 3010 3040 return sprintf(page,"\n" ··· 3012 3042 " TX:\t\t\t%10u\n" 3013 3043 " RX:\t\t\t%10u\n" 3014 3044 " dropped:\t\t\t%10u\n", 3015 - fore200e_swap(fore200e->stats->aal0.cells_transmitted), 3016 - fore200e_swap(fore200e->stats->aal0.cells_received), 3017 - fore200e_swap(fore200e->stats->aal0.cells_dropped)); 3045 + cpu_to_be32(fore200e->stats->aal0.cells_transmitted), 3046 + cpu_to_be32(fore200e->stats->aal0.cells_received), 3047 + cpu_to_be32(fore200e->stats->aal0.cells_dropped)); 3018 3048 3019 3049 if (!left--) 3020 3050 return sprintf(page,"\n" ··· 3030 3060 " RX:\t\t\t%10u\n" 3031 3061 " dropped:\t\t\t%10u\n" 3032 3062 " protocol errors:\t\t%10u\n", 3033 - fore200e_swap(fore200e->stats->aal34.cells_transmitted), 3034 - fore200e_swap(fore200e->stats->aal34.cells_received), 3035 - fore200e_swap(fore200e->stats->aal34.cells_dropped), 3036 - fore200e_swap(fore200e->stats->aal34.cells_crc_errors), 3037 - fore200e_swap(fore200e->stats->aal34.cells_protocol_errors), 3038 - fore200e_swap(fore200e->stats->aal34.cspdus_transmitted), 3039 - fore200e_swap(fore200e->stats->aal34.cspdus_received), 3040 - fore200e_swap(fore200e->stats->aal34.cspdus_dropped), 3041 - fore200e_swap(fore200e->stats->aal34.cspdus_protocol_errors)); 3063 + cpu_to_be32(fore200e->stats->aal34.cells_transmitted), 3064 + cpu_to_be32(fore200e->stats->aal34.cells_received), 3065 + cpu_to_be32(fore200e->stats->aal34.cells_dropped), 3066 + cpu_to_be32(fore200e->stats->aal34.cells_crc_errors), 3067 + cpu_to_be32(fore200e->stats->aal34.cells_protocol_errors), 3068 + cpu_to_be32(fore200e->stats->aal34.cspdus_transmitted), 3069 + cpu_to_be32(fore200e->stats->aal34.cspdus_received), 3070 + cpu_to_be32(fore200e->stats->aal34.cspdus_dropped), 3071 + cpu_to_be32(fore200e->stats->aal34.cspdus_protocol_errors)); 3042 3072 3043 3073 if (!left--) 3044 3074 return sprintf(page,"\n" ··· 3054 3084 " dropped:\t\t\t%10u\n" 3055 3085 " CRC errors:\t\t%10u\n" 3056 3086 " protocol errors:\t\t%10u\n", 3057 - fore200e_swap(fore200e->stats->aal5.cells_transmitted), 3058 - fore200e_swap(fore200e->stats->aal5.cells_received), 3059 - fore200e_swap(fore200e->stats->aal5.cells_dropped), 3060 - fore200e_swap(fore200e->stats->aal5.congestion_experienced), 3061 - fore200e_swap(fore200e->stats->aal5.cspdus_transmitted), 3062 - fore200e_swap(fore200e->stats->aal5.cspdus_received), 3063 - fore200e_swap(fore200e->stats->aal5.cspdus_dropped), 3064 - fore200e_swap(fore200e->stats->aal5.cspdus_crc_errors), 3065 - fore200e_swap(fore200e->stats->aal5.cspdus_protocol_errors)); 3087 + cpu_to_be32(fore200e->stats->aal5.cells_transmitted), 3088 + cpu_to_be32(fore200e->stats->aal5.cells_received), 3089 + cpu_to_be32(fore200e->stats->aal5.cells_dropped), 3090 + cpu_to_be32(fore200e->stats->aal5.congestion_experienced), 3091 + cpu_to_be32(fore200e->stats->aal5.cspdus_transmitted), 3092 + cpu_to_be32(fore200e->stats->aal5.cspdus_received), 3093 + cpu_to_be32(fore200e->stats->aal5.cspdus_dropped), 3094 + cpu_to_be32(fore200e->stats->aal5.cspdus_crc_errors), 3095 + cpu_to_be32(fore200e->stats->aal5.cspdus_protocol_errors)); 3066 3096 3067 3097 if (!left--) 3068 3098 return sprintf(page,"\n" ··· 3073 3103 " large b2:\t\t\t%10u\n" 3074 3104 " RX PDUs:\t\t\t%10u\n" 3075 3105 " TX PDUs:\t\t\t%10lu\n", 3076 - fore200e_swap(fore200e->stats->aux.small_b1_failed), 3077 - fore200e_swap(fore200e->stats->aux.large_b1_failed), 3078 - fore200e_swap(fore200e->stats->aux.small_b2_failed), 3079 - fore200e_swap(fore200e->stats->aux.large_b2_failed), 3080 - fore200e_swap(fore200e->stats->aux.rpd_alloc_failed), 3106 + cpu_to_be32(fore200e->stats->aux.small_b1_failed), 3107 + cpu_to_be32(fore200e->stats->aux.large_b1_failed), 3108 + cpu_to_be32(fore200e->stats->aux.small_b2_failed), 3109 + cpu_to_be32(fore200e->stats->aux.large_b2_failed), 3110 + cpu_to_be32(fore200e->stats->aux.rpd_alloc_failed), 3081 3111 fore200e->tx_sat); 3082 3112 3083 3113 if (!left--)
-1
include/linux/Kbuild
··· 137 137 header-y += raw.h 138 138 header-y += resource.h 139 139 header-y += rose.h 140 - header-y += sctp.h 141 140 header-y += smbno.h 142 141 header-y += snmp.h 143 142 header-y += sockios.h
+5 -5
include/linux/sctp.h
··· 180 180 SCTP_PARAM_ERR_CAUSE = __constant_htons(0xc003), 181 181 SCTP_PARAM_SET_PRIMARY = __constant_htons(0xc004), 182 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 185 } sctp_param_t; /* enum */ 186 186 ··· 281 281 sctp_paramhdr_t param_hdr; 282 282 } __attribute__((packed)) sctp_ecn_capable_param_t; 283 283 284 - /* ADDIP Section 3.2.6 Adaption Layer Indication */ 285 - typedef struct sctp_adaption_ind_param { 284 + /* ADDIP Section 3.2.6 Adaptation Layer Indication */ 285 + typedef struct sctp_adaptation_ind_param { 286 286 struct sctp_paramhdr param_hdr; 287 - __be32 adaption_ind; 288 - } __attribute__((packed)) sctp_adaption_ind_param_t; 287 + __be32 adaptation_ind; 288 + } __attribute__((packed)) sctp_adaptation_ind_param_t; 289 289 290 290 /* RFC 2960. Section 3.3.3 Initiation Acknowledgement (INIT ACK) (2): 291 291 * The INIT ACK chunk is used to acknowledge the initiation of an SCTP
+1 -1
include/net/ip6_checksum.h
··· 87 87 carry = (sum < uproto); 88 88 sum += carry; 89 89 90 - return csum_fold((__force __wsum)csum); 90 + return csum_fold((__force __wsum)sum); 91 91 } 92 92 93 93 #endif
-2
include/net/sctp/sctp.h
··· 128 128 int flags); 129 129 extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family); 130 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 133 * sctp/socket.c
+4 -4
include/net/sctp/structs.h
··· 306 306 __u8 disable_fragments; 307 307 __u8 pd_mode; 308 308 __u8 v4mapped; 309 - __u32 adaption_ind; 309 + __u32 adaptation_ind; 310 310 311 311 /* Receive to here while partial delivery is in effect. */ 312 312 struct sk_buff_head pd_lobby; ··· 388 388 /* Padding for future use */ 389 389 __u8 padding; 390 390 391 - __u32 adaption_ind; 391 + __u32 adaptation_ind; 392 392 393 393 394 394 /* This is a shim for my peer's INIT packet, followed by ··· 431 431 struct sctp_ipv4addr_param *v4; 432 432 struct sctp_ipv6addr_param *v6; 433 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 437 /* RFC 2960. Section 3.3.5 Heartbeat. ··· 1483 1483 __u8 asconf_capable; /* Does peer support ADDIP? */ 1484 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 1488 /* This mask is used to disable sending the ASCONF chunk 1489 1489 * with specified parameter to peer.
+1 -1
include/net/sctp/ulpevent.h
··· 120 120 const struct sctp_association *asoc, 121 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 124 const struct sctp_association *asoc, gfp_t gfp); 125 125 126 126 struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc,
+14 -14
include/net/sctp/user.h
··· 75 75 #define SCTP_SET_PEER_PRIMARY_ADDR SCTP_SET_PEER_PRIMARY_ADDR 76 76 SCTP_PRIMARY_ADDR, 77 77 #define SCTP_PRIMARY_ADDR SCTP_PRIMARY_ADDR 78 - SCTP_ADAPTION_LAYER, 79 - #define SCTP_ADAPTION_LAYER SCTP_ADAPTION_LAYER 78 + SCTP_ADAPTATION_LAYER, 79 + #define SCTP_ADAPTATION_LAYER SCTP_ADAPTATION_LAYER 80 80 SCTP_DISABLE_FRAGMENTS, 81 81 #define SCTP_DISABLE_FRAGMENTS SCTP_DISABLE_FRAGMENTS 82 82 SCTP_PEER_ADDR_PARAMS, ··· 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 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 341 __u16 sai_type; 342 342 __u16 sai_flags; 343 343 __u32 sai_length; 344 - __u32 sai_adaption_ind; 344 + __u32 sai_adaptation_ind; 345 345 sctp_assoc_t sai_assoc_id; 346 346 }; 347 347 ··· 374 374 __u8 sctp_peer_error_event; 375 375 __u8 sctp_shutdown_event; 376 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 395 struct sctp_remote_error sn_remote_error; 396 396 struct sctp_send_failed sn_send_failed; 397 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 399 struct sctp_pdapi_event sn_pdapi_event; 400 400 }; 401 401 ··· 412 412 SCTP_REMOTE_ERROR, 413 413 SCTP_SHUTDOWN_EVENT, 414 414 SCTP_PARTIAL_DELIVERY_EVENT, 415 - SCTP_ADAPTION_INDICATION, 415 + SCTP_ADAPTATION_INDICATION, 416 416 }; 417 417 418 418 /* Notification error codes used to fill up the error fields in some ··· 488 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 494 * Indication parameter for all future INIT and INIT-ACK exchanges. 495 495 */ 496 - struct sctp_setadaption { 497 - __u32 ssb_adaption_ind; 496 + struct sctp_setadaptation { 497 + __u32 ssb_adaptation_ind; 498 498 }; 499 499 500 500 /*
+2 -7
include/net/tcp.h
··· 242 242 243 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 - 248 - static inline int after(__u32 seq1, __u32 seq2) 249 - { 250 - return (__s32)(seq2-seq1) < 0; 251 - } 252 - 247 + #define after(seq2, seq1) before(seq1, seq2) 253 248 254 249 /* is s2<=s1<=s3 ? */ 255 250 static inline int between(__u32 seq1, __u32 seq2, __u32 seq3)
+8 -5
net/ipv4/udp.c
··· 165 165 goto gotit; 166 166 } 167 167 size = 0; 168 - sk_for_each(sk2, node, head) 169 - if (++size < best_size_so_far) { 170 - best_size_so_far = size; 171 - best = result; 172 - } 168 + sk_for_each(sk2, node, head) { 169 + if (++size >= best_size_so_far) 170 + goto next; 171 + } 172 + best_size_so_far = size; 173 + best = result; 174 + next: 175 + ; 173 176 } 174 177 result = best; 175 178 for(i = 0; i < (1 << 16) / UDP_HTABLE_SIZE; i++, result += UDP_HTABLE_SIZE) {
+26 -11
net/netlabel/netlabel_cipso_v4.c
··· 162 162 struct nlattr *nla_b; 163 163 int nla_a_rem; 164 164 int nla_b_rem; 165 + u32 iter; 165 166 166 167 if (!info->attrs[NLBL_CIPSOV4_A_TAGLST] || 167 168 !info->attrs[NLBL_CIPSOV4_A_MLSLVLLST]) ··· 186 185 ret_val = netlbl_cipsov4_add_common(info, doi_def); 187 186 if (ret_val != 0) 188 187 goto add_std_failure; 188 + ret_val = -EINVAL; 189 189 190 190 nla_for_each_nested(nla_a, 191 191 info->attrs[NLBL_CIPSOV4_A_MLSLVLLST], 192 192 nla_a_rem) 193 193 if (nla_a->nla_type == NLBL_CIPSOV4_A_MLSLVL) { 194 + if (nla_validate_nested(nla_a, 195 + NLBL_CIPSOV4_A_MAX, 196 + netlbl_cipsov4_genl_policy) != 0) 197 + goto add_std_failure; 194 198 nla_for_each_nested(nla_b, nla_a, nla_b_rem) 195 199 switch (nla_b->nla_type) { 196 200 case NLBL_CIPSOV4_A_MLSLVLLOC: 201 + if (nla_get_u32(nla_b) > 202 + CIPSO_V4_MAX_LOC_LVLS) 203 + goto add_std_failure; 197 204 if (nla_get_u32(nla_b) >= 198 205 doi_def->map.std->lvl.local_size) 199 206 doi_def->map.std->lvl.local_size = 200 207 nla_get_u32(nla_b) + 1; 201 208 break; 202 209 case NLBL_CIPSOV4_A_MLSLVLREM: 210 + if (nla_get_u32(nla_b) > 211 + CIPSO_V4_MAX_REM_LVLS) 212 + goto add_std_failure; 203 213 if (nla_get_u32(nla_b) >= 204 214 doi_def->map.std->lvl.cipso_size) 205 215 doi_def->map.std->lvl.cipso_size = ··· 218 206 break; 219 207 } 220 208 } 221 - if (doi_def->map.std->lvl.local_size > CIPSO_V4_MAX_LOC_LVLS || 222 - doi_def->map.std->lvl.cipso_size > CIPSO_V4_MAX_REM_LVLS) 223 - goto add_std_failure; 224 209 doi_def->map.std->lvl.local = kcalloc(doi_def->map.std->lvl.local_size, 225 210 sizeof(u32), 226 211 GFP_KERNEL); ··· 232 223 ret_val = -ENOMEM; 233 224 goto add_std_failure; 234 225 } 226 + for (iter = 0; iter < doi_def->map.std->lvl.local_size; iter++) 227 + doi_def->map.std->lvl.local[iter] = CIPSO_V4_INV_LVL; 228 + for (iter = 0; iter < doi_def->map.std->lvl.cipso_size; iter++) 229 + doi_def->map.std->lvl.cipso[iter] = CIPSO_V4_INV_LVL; 235 230 nla_for_each_nested(nla_a, 236 231 info->attrs[NLBL_CIPSOV4_A_MLSLVLLST], 237 232 nla_a_rem) 238 233 if (nla_a->nla_type == NLBL_CIPSOV4_A_MLSLVL) { 239 234 struct nlattr *lvl_loc; 240 235 struct nlattr *lvl_rem; 241 - 242 - if (nla_validate_nested(nla_a, 243 - NLBL_CIPSOV4_A_MAX, 244 - netlbl_cipsov4_genl_policy) != 0) 245 - goto add_std_failure; 246 236 247 237 lvl_loc = nla_find_nested(nla_a, 248 238 NLBL_CIPSOV4_A_MLSLVLLOC); ··· 272 264 nla_for_each_nested(nla_b, nla_a, nla_b_rem) 273 265 switch (nla_b->nla_type) { 274 266 case NLBL_CIPSOV4_A_MLSCATLOC: 267 + if (nla_get_u32(nla_b) > 268 + CIPSO_V4_MAX_LOC_CATS) 269 + goto add_std_failure; 275 270 if (nla_get_u32(nla_b) >= 276 271 doi_def->map.std->cat.local_size) 277 272 doi_def->map.std->cat.local_size = 278 273 nla_get_u32(nla_b) + 1; 279 274 break; 280 275 case NLBL_CIPSOV4_A_MLSCATREM: 276 + if (nla_get_u32(nla_b) > 277 + CIPSO_V4_MAX_REM_CATS) 278 + goto add_std_failure; 281 279 if (nla_get_u32(nla_b) >= 282 280 doi_def->map.std->cat.cipso_size) 283 281 doi_def->map.std->cat.cipso_size = ··· 291 277 break; 292 278 } 293 279 } 294 - if (doi_def->map.std->cat.local_size > CIPSO_V4_MAX_LOC_CATS || 295 - doi_def->map.std->cat.cipso_size > CIPSO_V4_MAX_REM_CATS) 296 - goto add_std_failure; 297 280 doi_def->map.std->cat.local = kcalloc( 298 281 doi_def->map.std->cat.local_size, 299 282 sizeof(u32), ··· 307 296 ret_val = -ENOMEM; 308 297 goto add_std_failure; 309 298 } 299 + for (iter = 0; iter < doi_def->map.std->cat.local_size; iter++) 300 + doi_def->map.std->cat.local[iter] = CIPSO_V4_INV_CAT; 301 + for (iter = 0; iter < doi_def->map.std->cat.cipso_size; iter++) 302 + doi_def->map.std->cat.cipso[iter] = CIPSO_V4_INV_CAT; 310 303 nla_for_each_nested(nla_a, 311 304 info->attrs[NLBL_CIPSOV4_A_MLSCATLST], 312 305 nla_a_rem)
+2 -2
net/sctp/ipv6.c
··· 79 79 #include <asm/uaccess.h> 80 80 81 81 /* Event handler for inet6 address addition/deletion events. */ 82 - int sctp_inet6addr_event(struct notifier_block *this, unsigned long ev, 83 - void *ptr) 82 + static int sctp_inet6addr_event(struct notifier_block *this, unsigned long ev, 83 + void *ptr) 84 84 { 85 85 struct inet6_ifaddr *ifa = (struct inet6_ifaddr *)ptr; 86 86 struct sctp_sockaddr_entry *addr;
+2 -2
net/sctp/protocol.c
··· 601 601 } 602 602 603 603 /* Event handler for inet address addition/deletion events. */ 604 - int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev, 605 - void *ptr) 604 + static int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev, 605 + void *ptr) 606 606 { 607 607 struct in_ifaddr *ifa = (struct in_ifaddr *)ptr; 608 608 struct sctp_sockaddr_entry *addr;
+12 -12
net/sctp/sm_make_chunk.c
··· 184 184 struct sctp_sock *sp; 185 185 sctp_supported_addrs_param_t sat; 186 186 __be16 types[2]; 187 - sctp_adaption_ind_param_t aiparam; 187 + sctp_adaptation_ind_param_t aiparam; 188 188 189 189 /* RFC 2960 3.3.2 Initiation (INIT) (1) 190 190 * ··· 249 249 sctp_addto_chunk(retval, sizeof(ecap_param), &ecap_param); 250 250 if (sctp_prsctp_enable) 251 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 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 255 sctp_addto_chunk(retval, sizeof(aiparam), &aiparam); 256 256 nodata: 257 257 kfree(addrs.v); ··· 269 269 sctp_cookie_param_t *cookie; 270 270 int cookie_len; 271 271 size_t chunksize; 272 - sctp_adaption_ind_param_t aiparam; 272 + sctp_adaptation_ind_param_t aiparam; 273 273 274 274 retval = NULL; 275 275 ··· 323 323 if (asoc->peer.prsctp_capable) 324 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 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 329 sctp_addto_chunk(retval, sizeof(aiparam), &aiparam); 330 330 331 331 /* We need to remove the const qualifier at this point. */ ··· 1300 1300 /* Remember PR-SCTP capability. */ 1301 1301 cookie->c.prsctp_capable = asoc->peer.prsctp_capable; 1302 1302 1303 - /* Save adaption indication in the cookie. */ 1304 - cookie->c.adaption_ind = asoc->peer.adaption_ind; 1303 + /* Save adaptation indication in the cookie. */ 1304 + cookie->c.adaptation_ind = asoc->peer.adaptation_ind; 1305 1305 1306 1306 /* Set an expiration time for the cookie. */ 1307 1307 do_gettimeofday(&cookie->c.expiration); ··· 1512 1512 retval->addip_serial = retval->c.initial_tsn; 1513 1513 retval->adv_peer_ack_point = retval->ctsn_ack_point; 1514 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 1517 /* The INIT stuff will be done by the side effects. */ 1518 1518 return retval; ··· 1743 1743 case SCTP_PARAM_HEARTBEAT_INFO: 1744 1744 case SCTP_PARAM_UNRECOGNIZED_PARAMETERS: 1745 1745 case SCTP_PARAM_ECN_CAPABLE: 1746 - case SCTP_PARAM_ADAPTION_LAYER_IND: 1746 + case SCTP_PARAM_ADAPTATION_LAYER_IND: 1747 1747 break; 1748 1748 1749 1749 case SCTP_PARAM_HOST_NAME_ADDRESS: ··· 2098 2098 asoc->peer.ecn_capable = 1; 2099 2099 break; 2100 2100 2101 - case SCTP_PARAM_ADAPTION_LAYER_IND: 2102 - asoc->peer.adaption_ind = param.aind->adaption_ind; 2101 + case SCTP_PARAM_ADAPTATION_LAYER_IND: 2102 + asoc->peer.adaptation_ind = param.aind->adaptation_ind; 2103 2103 break; 2104 2104 2105 2105 case SCTP_PARAM_FWD_TSN_SUPPORT:
+16 -16
net/sctp/sm_statefuns.c
··· 688 688 goto nomem_ev; 689 689 690 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 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) { 696 - ai_ev = sctp_ulpevent_make_adaption_indication(new_asoc, 695 + if (new_asoc->peer.adaptation_ind) { 696 + ai_ev = sctp_ulpevent_make_adaptation_indication(new_asoc, 697 697 GFP_ATOMIC); 698 698 if (!ai_ev) 699 699 goto nomem_aiev; ··· 820 820 sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, SCTP_ULPEVENT(ev)); 821 821 822 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 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) { 828 - ev = sctp_ulpevent_make_adaption_indication(asoc, GFP_ATOMIC); 827 + if (asoc->peer.adaptation_ind) { 828 + ev = sctp_ulpevent_make_adaptation_indication(asoc, GFP_ATOMIC); 829 829 if (!ev) 830 830 goto nomem; 831 831 ··· 1698 1698 sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, SCTP_ULPEVENT(ev)); 1699 1699 1700 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 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) { 1706 - ev = sctp_ulpevent_make_adaption_indication(asoc, GFP_ATOMIC); 1705 + if (asoc->peer.adaptation_ind) { 1706 + ev = sctp_ulpevent_make_adaptation_indication(asoc, GFP_ATOMIC); 1707 1707 if (!ev) 1708 1708 goto nomem_ev; 1709 1709 ··· 1791 1791 goto nomem; 1792 1792 1793 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 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) { 1799 - ai_ev = sctp_ulpevent_make_adaption_indication(asoc, 1798 + if (asoc->peer.adaptation_ind) { 1799 + ai_ev = sctp_ulpevent_make_adaptation_indication(asoc, 1800 1800 GFP_ATOMIC); 1801 1801 if (!ai_ev) 1802 1802 goto nomem;
+17 -17
net/sctp/socket.c
··· 2731 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 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 2740 return -EINVAL; 2741 - if (copy_from_user(&adaption, optval, optlen)) 2741 + if (copy_from_user(&adaptation, optval, optlen)) 2742 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 2746 return 0; 2747 2747 } ··· 2894 2894 case SCTP_MAXSEG: 2895 2895 retval = sctp_setsockopt_maxseg(sk, optval, optlen); 2896 2896 break; 2897 - case SCTP_ADAPTION_LAYER: 2898 - retval = sctp_setsockopt_adaption_layer(sk, optval, optlen); 2897 + case SCTP_ADAPTATION_LAYER: 2898 + retval = sctp_setsockopt_adaptation_layer(sk, optval, optlen); 2899 2899 break; 2900 2900 case SCTP_CONTEXT: 2901 2901 retval = sctp_setsockopt_context(sk, optval, optlen); ··· 3123 3123 /* User specified fragmentation limit. */ 3124 3124 sp->user_frag = 0; 3125 3125 3126 - sp->adaption_ind = 0; 3126 + sp->adaptation_ind = 0; 3127 3127 3128 3128 sp->pf = sctp_get_pf_specific(sk->sk_family); 3129 3129 ··· 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 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 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 4224 return -EINVAL; 4225 4225 4226 - adaption.ssb_adaption_ind = sctp_sk(sk)->adaption_ind; 4227 - if (copy_to_user(optval, &adaption, len)) 4226 + adaptation.ssb_adaptation_ind = sctp_sk(sk)->adaptation_ind; 4227 + if (copy_to_user(optval, &adaptation, len)) 4228 4228 return -EFAULT; 4229 4229 4230 4230 return 0; ··· 4635 4635 retval = sctp_getsockopt_peer_addr_info(sk, len, optval, 4636 4636 optlen); 4637 4637 break; 4638 - case SCTP_ADAPTION_LAYER: 4639 - retval = sctp_getsockopt_adaption_layer(sk, len, optval, 4638 + case SCTP_ADAPTATION_LAYER: 4639 + retval = sctp_getsockopt_adaptation_layer(sk, len, optval, 4640 4640 optlen); 4641 4641 break; 4642 4642 case SCTP_CONTEXT:
+10 -10
net/sctp/ulpevent.c
··· 609 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 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 618 const struct sctp_association *asoc, gfp_t gfp) 619 619 { 620 620 struct sctp_ulpevent *event; 621 - struct sctp_adaption_event *sai; 621 + struct sctp_adaptation_event *sai; 622 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 625 MSG_NOTIFICATION, gfp); 626 626 if (!event) 627 627 goto fail; 628 628 629 629 skb = sctp_event2skb(event); 630 - sai = (struct sctp_adaption_event *) 631 - skb_put(skb, sizeof(struct sctp_adaption_event)); 630 + sai = (struct sctp_adaptation_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 634 sai->sai_flags = 0; 635 - sai->sai_length = sizeof(struct sctp_adaption_event); 636 - sai->sai_adaption_ind = asoc->peer.adaption_ind; 635 + sai->sai_length = sizeof(struct sctp_adaptation_event); 636 + sai->sai_adaptation_ind = asoc->peer.adaptation_ind; 637 637 sctp_ulpevent_set_owner(event, asoc); 638 638 sai->sai_assoc_id = sctp_assoc2id(asoc); 639 639