diff options
| -rw-r--r-- | drivers/net/e100.c | 224 | ||||
| -rw-r--r-- | drivers/scsi/sata_nv.c | 14 | ||||
| -rw-r--r-- | include/linux/netfilter/nfnetlink.h | 12 | ||||
| -rw-r--r-- | include/linux/netfilter/nfnetlink_conntrack.h | 15 | ||||
| -rw-r--r-- | include/linux/netfilter_ipv4/ip_conntrack.h | 8 | ||||
| -rw-r--r-- | include/linux/netfilter_ipv4/ip_conntrack_protocol.h | 3 | ||||
| -rw-r--r-- | include/linux/netfilter_ipv4/ip_conntrack_tuple.h | 2 | ||||
| -rw-r--r-- | include/linux/netfilter_ipv4/ip_nat.h | 4 | ||||
| -rw-r--r-- | include/linux/netpoll.h | 2 | ||||
| -rw-r--r-- | include/net/inet_timewait_sock.h | 3 | ||||
| -rw-r--r-- | net/bridge/br_if.c | 2 | ||||
| -rw-r--r-- | net/dccp/ccid.h | 4 | ||||
| -rw-r--r-- | net/dccp/input.c | 6 | ||||
| -rw-r--r-- | net/ipv4/esp4.c | 17 | ||||
| -rw-r--r-- | net/ipv4/inet_timewait_sock.c | 1 | ||||
| -rw-r--r-- | net/ipv4/netfilter/Kconfig | 8 | ||||
| -rw-r--r-- | net/ipv4/netfilter/ip_conntrack_core.c | 13 | ||||
| -rw-r--r-- | net/ipv4/netfilter/ip_conntrack_netlink.c | 48 | ||||
| -rw-r--r-- | net/ipv4/netfilter/ip_conntrack_proto_icmp.c | 3 | ||||
| -rw-r--r-- | net/ipv4/netfilter/ip_conntrack_proto_tcp.c | 27 | ||||
| -rw-r--r-- | net/ipv4/tcp_output.c | 9 | ||||
| -rw-r--r-- | net/ipv6/esp6.c | 18 | ||||
| -rw-r--r-- | net/netfilter/nfnetlink.c | 4 |
23 files changed, 184 insertions, 263 deletions
diff --git a/drivers/net/e100.c b/drivers/net/e100.c index fbf1c06ec5c1..40887f09b681 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c | |||
| @@ -903,8 +903,8 @@ static void mdio_write(struct net_device *netdev, int addr, int reg, int data) | |||
| 903 | 903 | ||
| 904 | static void e100_get_defaults(struct nic *nic) | 904 | static void e100_get_defaults(struct nic *nic) |
| 905 | { | 905 | { |
| 906 | struct param_range rfds = { .min = 16, .max = 256, .count = 256 }; | 906 | struct param_range rfds = { .min = 16, .max = 256, .count = 64 }; |
| 907 | struct param_range cbs = { .min = 64, .max = 256, .count = 128 }; | 907 | struct param_range cbs = { .min = 64, .max = 256, .count = 64 }; |
| 908 | 908 | ||
| 909 | pci_read_config_byte(nic->pdev, PCI_REVISION_ID, &nic->rev_id); | 909 | pci_read_config_byte(nic->pdev, PCI_REVISION_ID, &nic->rev_id); |
| 910 | /* MAC type is encoded as rev ID; exception: ICH is treated as 82559 */ | 910 | /* MAC type is encoded as rev ID; exception: ICH is treated as 82559 */ |
| @@ -1007,213 +1007,25 @@ static void e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb) | |||
| 1007 | c[16], c[17], c[18], c[19], c[20], c[21], c[22], c[23]); | 1007 | c[16], c[17], c[18], c[19], c[20], c[21], c[22], c[23]); |
| 1008 | } | 1008 | } |
| 1009 | 1009 | ||
| 1010 | /********************************************************/ | ||
| 1011 | /* Micro code for 8086:1229 Rev 8 */ | ||
| 1012 | /********************************************************/ | ||
| 1013 | |||
| 1014 | /* Parameter values for the D101M B-step */ | ||
| 1015 | #define D101M_CPUSAVER_TIMER_DWORD 78 | ||
| 1016 | #define D101M_CPUSAVER_BUNDLE_DWORD 65 | ||
| 1017 | #define D101M_CPUSAVER_MIN_SIZE_DWORD 126 | ||
| 1018 | |||
| 1019 | #define D101M_B_RCVBUNDLE_UCODE \ | ||
| 1020 | {\ | ||
| 1021 | 0x00550215, 0xFFFF0437, 0xFFFFFFFF, 0x06A70789, 0xFFFFFFFF, 0x0558FFFF, \ | ||
| 1022 | 0x000C0001, 0x00101312, 0x000C0008, 0x00380216, \ | ||
| 1023 | 0x0010009C, 0x00204056, 0x002380CC, 0x00380056, \ | ||
| 1024 | 0x0010009C, 0x00244C0B, 0x00000800, 0x00124818, \ | ||
| 1025 | 0x00380438, 0x00000000, 0x00140000, 0x00380555, \ | ||
| 1026 | 0x00308000, 0x00100662, 0x00100561, 0x000E0408, \ | ||
| 1027 | 0x00134861, 0x000C0002, 0x00103093, 0x00308000, \ | ||
| 1028 | 0x00100624, 0x00100561, 0x000E0408, 0x00100861, \ | ||
| 1029 | 0x000C007E, 0x00222C21, 0x000C0002, 0x00103093, \ | ||
| 1030 | 0x00380C7A, 0x00080000, 0x00103090, 0x00380C7A, \ | ||
| 1031 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1032 | 0x0010009C, 0x00244C2D, 0x00010004, 0x00041000, \ | ||
| 1033 | 0x003A0437, 0x00044010, 0x0038078A, 0x00000000, \ | ||
| 1034 | 0x00100099, 0x00206C7A, 0x0010009C, 0x00244C48, \ | ||
| 1035 | 0x00130824, 0x000C0001, 0x00101213, 0x00260C75, \ | ||
| 1036 | 0x00041000, 0x00010004, 0x00130826, 0x000C0006, \ | ||
| 1037 | 0x002206A8, 0x0013C926, 0x00101313, 0x003806A8, \ | ||
| 1038 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1039 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1040 | 0x00080600, 0x00101B10, 0x00050004, 0x00100826, \ | ||
| 1041 | 0x00101210, 0x00380C34, 0x00000000, 0x00000000, \ | ||
| 1042 | 0x0021155B, 0x00100099, 0x00206559, 0x0010009C, \ | ||
| 1043 | 0x00244559, 0x00130836, 0x000C0000, 0x00220C62, \ | ||
| 1044 | 0x000C0001, 0x00101B13, 0x00229C0E, 0x00210C0E, \ | ||
| 1045 | 0x00226C0E, 0x00216C0E, 0x0022FC0E, 0x00215C0E, \ | ||
| 1046 | 0x00214C0E, 0x00380555, 0x00010004, 0x00041000, \ | ||
| 1047 | 0x00278C67, 0x00040800, 0x00018100, 0x003A0437, \ | ||
| 1048 | 0x00130826, 0x000C0001, 0x00220559, 0x00101313, \ | ||
| 1049 | 0x00380559, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1050 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1051 | 0x00000000, 0x00130831, 0x0010090B, 0x00124813, \ | ||
| 1052 | 0x000CFF80, 0x002606AB, 0x00041000, 0x00010004, \ | ||
| 1053 | 0x003806A8, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1054 | } | ||
| 1055 | |||
| 1056 | /********************************************************/ | ||
| 1057 | /* Micro code for 8086:1229 Rev 9 */ | ||
| 1058 | /********************************************************/ | ||
| 1059 | |||
| 1060 | /* Parameter values for the D101S */ | ||
| 1061 | #define D101S_CPUSAVER_TIMER_DWORD 78 | ||
| 1062 | #define D101S_CPUSAVER_BUNDLE_DWORD 67 | ||
| 1063 | #define D101S_CPUSAVER_MIN_SIZE_DWORD 128 | ||
| 1064 | |||
| 1065 | #define D101S_RCVBUNDLE_UCODE \ | ||
| 1066 | {\ | ||
| 1067 | 0x00550242, 0xFFFF047E, 0xFFFFFFFF, 0x06FF0818, 0xFFFFFFFF, 0x05A6FFFF, \ | ||
| 1068 | 0x000C0001, 0x00101312, 0x000C0008, 0x00380243, \ | ||
| 1069 | 0x0010009C, 0x00204056, 0x002380D0, 0x00380056, \ | ||
| 1070 | 0x0010009C, 0x00244F8B, 0x00000800, 0x00124818, \ | ||
| 1071 | 0x0038047F, 0x00000000, 0x00140000, 0x003805A3, \ | ||
| 1072 | 0x00308000, 0x00100610, 0x00100561, 0x000E0408, \ | ||
| 1073 | 0x00134861, 0x000C0002, 0x00103093, 0x00308000, \ | ||
| 1074 | 0x00100624, 0x00100561, 0x000E0408, 0x00100861, \ | ||
| 1075 | 0x000C007E, 0x00222FA1, 0x000C0002, 0x00103093, \ | ||
| 1076 | 0x00380F90, 0x00080000, 0x00103090, 0x00380F90, \ | ||
| 1077 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1078 | 0x0010009C, 0x00244FAD, 0x00010004, 0x00041000, \ | ||
| 1079 | 0x003A047E, 0x00044010, 0x00380819, 0x00000000, \ | ||
| 1080 | 0x00100099, 0x00206FFD, 0x0010009A, 0x0020AFFD, \ | ||
| 1081 | 0x0010009C, 0x00244FC8, 0x00130824, 0x000C0001, \ | ||
| 1082 | 0x00101213, 0x00260FF7, 0x00041000, 0x00010004, \ | ||
| 1083 | 0x00130826, 0x000C0006, 0x00220700, 0x0013C926, \ | ||
| 1084 | 0x00101313, 0x00380700, 0x00000000, 0x00000000, \ | ||
| 1085 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1086 | 0x00080600, 0x00101B10, 0x00050004, 0x00100826, \ | ||
| 1087 | 0x00101210, 0x00380FB6, 0x00000000, 0x00000000, \ | ||
| 1088 | 0x002115A9, 0x00100099, 0x002065A7, 0x0010009A, \ | ||
| 1089 | 0x0020A5A7, 0x0010009C, 0x002445A7, 0x00130836, \ | ||
| 1090 | 0x000C0000, 0x00220FE4, 0x000C0001, 0x00101B13, \ | ||
| 1091 | 0x00229F8E, 0x00210F8E, 0x00226F8E, 0x00216F8E, \ | ||
| 1092 | 0x0022FF8E, 0x00215F8E, 0x00214F8E, 0x003805A3, \ | ||
| 1093 | 0x00010004, 0x00041000, 0x00278FE9, 0x00040800, \ | ||
| 1094 | 0x00018100, 0x003A047E, 0x00130826, 0x000C0001, \ | ||
| 1095 | 0x002205A7, 0x00101313, 0x003805A7, 0x00000000, \ | ||
| 1096 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1097 | 0x00000000, 0x00000000, 0x00000000, 0x00130831, \ | ||
| 1098 | 0x0010090B, 0x00124813, 0x000CFF80, 0x00260703, \ | ||
| 1099 | 0x00041000, 0x00010004, 0x00380700 \ | ||
| 1100 | } | ||
| 1101 | |||
| 1102 | /********************************************************/ | ||
| 1103 | /* Micro code for the 8086:1229 Rev F/10 */ | ||
| 1104 | /********************************************************/ | ||
| 1105 | |||
| 1106 | /* Parameter values for the D102 E-step */ | ||
| 1107 | #define D102_E_CPUSAVER_TIMER_DWORD 42 | ||
| 1108 | #define D102_E_CPUSAVER_BUNDLE_DWORD 54 | ||
| 1109 | #define D102_E_CPUSAVER_MIN_SIZE_DWORD 46 | ||
| 1110 | |||
| 1111 | #define D102_E_RCVBUNDLE_UCODE \ | ||
| 1112 | {\ | ||
| 1113 | 0x007D028F, 0x0E4204F9, 0x14ED0C85, 0x14FA14E9, 0x0EF70E36, 0x1FFF1FFF, \ | ||
| 1114 | 0x00E014B9, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1115 | 0x00E014BD, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1116 | 0x00E014D5, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1117 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1118 | 0x00E014C1, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1119 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1120 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1121 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1122 | 0x00E014C8, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1123 | 0x00200600, 0x00E014EE, 0x00000000, 0x00000000, \ | ||
| 1124 | 0x0030FF80, 0x00940E46, 0x00038200, 0x00102000, \ | ||
| 1125 | 0x00E00E43, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1126 | 0x00300006, 0x00E014FB, 0x00000000, 0x00000000, \ | ||
| 1127 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1128 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1129 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1130 | 0x00906E41, 0x00800E3C, 0x00E00E39, 0x00000000, \ | ||
| 1131 | 0x00906EFD, 0x00900EFD, 0x00E00EF8, 0x00000000, \ | ||
| 1132 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1133 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1134 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1135 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1136 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1137 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1138 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1139 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1140 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1141 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1142 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1143 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1144 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1145 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ | ||
| 1146 | } | ||
| 1147 | |||
| 1148 | static void e100_load_ucode(struct nic *nic, struct cb *cb, struct sk_buff *skb) | 1010 | static void e100_load_ucode(struct nic *nic, struct cb *cb, struct sk_buff *skb) |
| 1149 | { | 1011 | { |
| 1150 | /* *INDENT-OFF* */ | 1012 | int i; |
| 1151 | static struct { | 1013 | static const u32 ucode[UCODE_SIZE] = { |
| 1152 | u32 ucode[UCODE_SIZE + 1]; | 1014 | /* NFS packets are misinterpreted as TCO packets and |
| 1153 | u8 mac; | 1015 | * incorrectly routed to the BMC over SMBus. This |
| 1154 | u8 timer_dword; | 1016 | * microcode patch checks the fragmented IP bit in the |
| 1155 | u8 bundle_dword; | 1017 | * NFS/UDP header to distinguish between NFS and TCO. */ |
| 1156 | u8 min_size_dword; | 1018 | 0x0EF70E36, 0x1FFF1FFF, 0x1FFF1FFF, 0x1FFF1FFF, 0x1FFF1FFF, |
| 1157 | } ucode_opts[] = { | 1019 | 0x1FFF1FFF, 0x00906E41, 0x00800E3C, 0x00E00E39, 0x00000000, |
| 1158 | { D101M_B_RCVBUNDLE_UCODE, | 1020 | 0x00906EFD, 0x00900EFD, 0x00E00EF8, |
| 1159 | mac_82559_D101M, | 1021 | }; |
| 1160 | D101M_CPUSAVER_TIMER_DWORD, | ||
| 1161 | D101M_CPUSAVER_BUNDLE_DWORD, | ||
| 1162 | D101M_CPUSAVER_MIN_SIZE_DWORD }, | ||
| 1163 | { D101S_RCVBUNDLE_UCODE, | ||
| 1164 | mac_82559_D101S, | ||
| 1165 | D101S_CPUSAVER_TIMER_DWORD, | ||
| 1166 | D101S_CPUSAVER_BUNDLE_DWORD, | ||
| 1167 | D101S_CPUSAVER_MIN_SIZE_DWORD }, | ||
| 1168 | { D102_E_RCVBUNDLE_UCODE, | ||
| 1169 | mac_82551_F, | ||
| 1170 | D102_E_CPUSAVER_TIMER_DWORD, | ||
| 1171 | D102_E_CPUSAVER_BUNDLE_DWORD, | ||
| 1172 | D102_E_CPUSAVER_MIN_SIZE_DWORD }, | ||
| 1173 | { D102_E_RCVBUNDLE_UCODE, | ||
| 1174 | mac_82551_10, | ||
| 1175 | D102_E_CPUSAVER_TIMER_DWORD, | ||
| 1176 | D102_E_CPUSAVER_BUNDLE_DWORD, | ||
| 1177 | D102_E_CPUSAVER_MIN_SIZE_DWORD }, | ||
| 1178 | { {0}, 0, 0, 0, 0} | ||
| 1179 | }, *opts; | ||
| 1180 | /* *INDENT-ON* */ | ||
| 1181 | |||
| 1182 | #define BUNDLESMALL 1 | ||
| 1183 | #define BUNDLEMAX 50 | ||
| 1184 | #define INTDELAY 15000 | ||
| 1185 | |||
| 1186 | opts = ucode_opts; | ||
| 1187 | |||
| 1188 | /* do not load u-code for ICH devices */ | ||
| 1189 | if (nic->flags & ich) | ||
| 1190 | return; | ||
| 1191 | |||
| 1192 | /* Search for ucode match against h/w rev_id */ | ||
| 1193 | while (opts->mac) { | ||
| 1194 | if (nic->mac == opts->mac) { | ||
| 1195 | int i; | ||
| 1196 | u32 *ucode = opts->ucode; | ||
| 1197 | |||
| 1198 | /* Insert user-tunable settings */ | ||
| 1199 | ucode[opts->timer_dword] &= 0xFFFF0000; | ||
| 1200 | ucode[opts->timer_dword] |= | ||
| 1201 | (u16) INTDELAY; | ||
| 1202 | ucode[opts->bundle_dword] &= 0xFFFF0000; | ||
| 1203 | ucode[opts->bundle_dword] |= (u16) BUNDLEMAX; | ||
| 1204 | ucode[opts->min_size_dword] &= 0xFFFF0000; | ||
| 1205 | ucode[opts->min_size_dword] |= | ||
| 1206 | (BUNDLESMALL) ? 0xFFFF : 0xFF80; | ||
| 1207 | |||
| 1208 | for(i = 0; i < UCODE_SIZE; i++) | ||
| 1209 | cb->u.ucode[i] = cpu_to_le32(ucode[i]); | ||
| 1210 | cb->command = cpu_to_le16(cb_ucode); | ||
| 1211 | return; | ||
| 1212 | } | ||
| 1213 | opts++; | ||
| 1214 | } | ||
| 1215 | 1022 | ||
| 1216 | cb->command = cpu_to_le16(cb_nop); | 1023 | if(nic->mac == mac_82551_F || nic->mac == mac_82551_10) { |
| 1024 | for(i = 0; i < UCODE_SIZE; i++) | ||
| 1025 | cb->u.ucode[i] = cpu_to_le32(ucode[i]); | ||
| 1026 | cb->command = cpu_to_le16(cb_ucode); | ||
| 1027 | } else | ||
| 1028 | cb->command = cpu_to_le16(cb_nop); | ||
| 1217 | } | 1029 | } |
| 1218 | 1030 | ||
| 1219 | static void e100_setup_iaaddr(struct nic *nic, struct cb *cb, | 1031 | static void e100_setup_iaaddr(struct nic *nic, struct cb *cb, |
diff --git a/drivers/scsi/sata_nv.c b/drivers/scsi/sata_nv.c index c05653c7779d..cb832b03ec5e 100644 --- a/drivers/scsi/sata_nv.c +++ b/drivers/scsi/sata_nv.c | |||
| @@ -29,6 +29,8 @@ | |||
| 29 | * NV-specific details such as register offsets, SATA phy location, | 29 | * NV-specific details such as register offsets, SATA phy location, |
| 30 | * hotplug info, etc. | 30 | * hotplug info, etc. |
| 31 | * | 31 | * |
| 32 | * 0.09 | ||
| 33 | * - Fixed bug introduced by 0.08's MCP51 and MCP55 support. | ||
| 32 | * | 34 | * |
| 33 | * 0.08 | 35 | * 0.08 |
| 34 | * - Added support for MCP51 and MCP55. | 36 | * - Added support for MCP51 and MCP55. |
| @@ -132,9 +134,7 @@ enum nv_host_type | |||
| 132 | GENERIC, | 134 | GENERIC, |
| 133 | NFORCE2, | 135 | NFORCE2, |
| 134 | NFORCE3, | 136 | NFORCE3, |
| 135 | CK804, | 137 | CK804 |
| 136 | MCP51, | ||
| 137 | MCP55 | ||
| 138 | }; | 138 | }; |
| 139 | 139 | ||
| 140 | static struct pci_device_id nv_pci_tbl[] = { | 140 | static struct pci_device_id nv_pci_tbl[] = { |
| @@ -153,13 +153,13 @@ static struct pci_device_id nv_pci_tbl[] = { | |||
| 153 | { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA2, | 153 | { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA2, |
| 154 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, CK804 }, | 154 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, CK804 }, |
| 155 | { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA, | 155 | { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA, |
| 156 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, MCP51 }, | 156 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, GENERIC }, |
| 157 | { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2, | 157 | { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2, |
| 158 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, MCP51 }, | 158 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, GENERIC }, |
| 159 | { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA, | 159 | { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA, |
| 160 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, MCP55 }, | 160 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, GENERIC }, |
| 161 | { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2, | 161 | { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2, |
| 162 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, MCP55 }, | 162 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, GENERIC }, |
| 163 | { PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, | 163 | { PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, |
| 164 | PCI_ANY_ID, PCI_ANY_ID, | 164 | PCI_ANY_ID, PCI_ANY_ID, |
| 165 | PCI_CLASS_STORAGE_IDE<<8, 0xffff00, GENERIC }, | 165 | PCI_CLASS_STORAGE_IDE<<8, 0xffff00, GENERIC }, |
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index 1d5b10ae2399..f08e870100f4 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
| @@ -41,11 +41,15 @@ enum nfnetlink_groups { | |||
| 41 | struct nfattr | 41 | struct nfattr |
| 42 | { | 42 | { |
| 43 | u_int16_t nfa_len; | 43 | u_int16_t nfa_len; |
| 44 | u_int16_t nfa_type; | 44 | u_int16_t nfa_type; /* we use 15 bits for the type, and the highest |
| 45 | * bit to indicate whether the payload is nested */ | ||
| 45 | } __attribute__ ((packed)); | 46 | } __attribute__ ((packed)); |
| 46 | 47 | ||
| 47 | /* FIXME: Shamelessly copy and pasted from rtnetlink.h, it's time | 48 | /* FIXME: Apart from NFNL_NFA_NESTED shamelessly copy and pasted from |
| 48 | * to put this in a generic file */ | 49 | * rtnetlink.h, it's time to put this in a generic file */ |
| 50 | |||
| 51 | #define NFNL_NFA_NEST 0x8000 | ||
| 52 | #define NFA_TYPE(attr) ((attr)->nfa_type & 0x7fff) | ||
| 49 | 53 | ||
| 50 | #define NFA_ALIGNTO 4 | 54 | #define NFA_ALIGNTO 4 |
| 51 | #define NFA_ALIGN(len) (((len) + NFA_ALIGNTO - 1) & ~(NFA_ALIGNTO - 1)) | 55 | #define NFA_ALIGN(len) (((len) + NFA_ALIGNTO - 1) & ~(NFA_ALIGNTO - 1)) |
| @@ -59,7 +63,7 @@ struct nfattr | |||
| 59 | #define NFA_PAYLOAD(nfa) ((int)((nfa)->nfa_len) - NFA_LENGTH(0)) | 63 | #define NFA_PAYLOAD(nfa) ((int)((nfa)->nfa_len) - NFA_LENGTH(0)) |
| 60 | #define NFA_NEST(skb, type) \ | 64 | #define NFA_NEST(skb, type) \ |
| 61 | ({ struct nfattr *__start = (struct nfattr *) (skb)->tail; \ | 65 | ({ struct nfattr *__start = (struct nfattr *) (skb)->tail; \ |
| 62 | NFA_PUT(skb, type, 0, NULL); \ | 66 | NFA_PUT(skb, (NFNL_NFA_NEST | type), 0, NULL); \ |
| 63 | __start; }) | 67 | __start; }) |
| 64 | #define NFA_NEST_END(skb, start) \ | 68 | #define NFA_NEST_END(skb, start) \ |
| 65 | ({ (start)->nfa_len = ((skb)->tail - (unsigned char *) (start)); \ | 69 | ({ (start)->nfa_len = ((skb)->tail - (unsigned char *) (start)); \ |
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h index 5c55751c78e4..116fcaced909 100644 --- a/include/linux/netfilter/nfnetlink_conntrack.h +++ b/include/linux/netfilter/nfnetlink_conntrack.h | |||
| @@ -70,15 +70,24 @@ enum ctattr_l4proto { | |||
| 70 | 70 | ||
| 71 | enum ctattr_protoinfo { | 71 | enum ctattr_protoinfo { |
| 72 | CTA_PROTOINFO_UNSPEC, | 72 | CTA_PROTOINFO_UNSPEC, |
| 73 | CTA_PROTOINFO_TCP_STATE, | 73 | CTA_PROTOINFO_TCP, |
| 74 | __CTA_PROTOINFO_MAX | 74 | __CTA_PROTOINFO_MAX |
| 75 | }; | 75 | }; |
| 76 | #define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1) | 76 | #define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1) |
| 77 | 77 | ||
| 78 | enum ctattr_protoinfo_tcp { | ||
| 79 | CTA_PROTOINFO_TCP_UNSPEC, | ||
| 80 | CTA_PROTOINFO_TCP_STATE, | ||
| 81 | __CTA_PROTOINFO_TCP_MAX | ||
| 82 | }; | ||
| 83 | #define CTA_PROTOINFO_TCP_MAX (__CTA_PROTOINFO_TCP_MAX - 1) | ||
| 84 | |||
| 78 | enum ctattr_counters { | 85 | enum ctattr_counters { |
| 79 | CTA_COUNTERS_UNSPEC, | 86 | CTA_COUNTERS_UNSPEC, |
| 80 | CTA_COUNTERS_PACKETS, | 87 | CTA_COUNTERS_PACKETS, /* old 64bit counters */ |
| 81 | CTA_COUNTERS_BYTES, | 88 | CTA_COUNTERS_BYTES, /* old 64bit counters */ |
| 89 | CTA_COUNTERS32_PACKETS, | ||
| 90 | CTA_COUNTERS32_BYTES, | ||
| 82 | __CTA_COUNTERS_MAX | 91 | __CTA_COUNTERS_MAX |
| 83 | }; | 92 | }; |
| 84 | #define CTA_COUNTERS_MAX (__CTA_COUNTERS_MAX - 1) | 93 | #define CTA_COUNTERS_MAX (__CTA_COUNTERS_MAX - 1) |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h index 4ced38736813..d078bb91d9e5 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack.h +++ b/include/linux/netfilter_ipv4/ip_conntrack.h | |||
| @@ -117,6 +117,10 @@ enum ip_conntrack_events | |||
| 117 | /* NAT info */ | 117 | /* NAT info */ |
| 118 | IPCT_NATINFO_BIT = 10, | 118 | IPCT_NATINFO_BIT = 10, |
| 119 | IPCT_NATINFO = (1 << IPCT_NATINFO_BIT), | 119 | IPCT_NATINFO = (1 << IPCT_NATINFO_BIT), |
| 120 | |||
| 121 | /* Counter highest bit has been set */ | ||
| 122 | IPCT_COUNTER_FILLING_BIT = 11, | ||
| 123 | IPCT_COUNTER_FILLING = (1 << IPCT_COUNTER_FILLING_BIT), | ||
| 120 | }; | 124 | }; |
| 121 | 125 | ||
| 122 | enum ip_conntrack_expect_events { | 126 | enum ip_conntrack_expect_events { |
| @@ -192,8 +196,8 @@ do { \ | |||
| 192 | 196 | ||
| 193 | struct ip_conntrack_counter | 197 | struct ip_conntrack_counter |
| 194 | { | 198 | { |
| 195 | u_int64_t packets; | 199 | u_int32_t packets; |
| 196 | u_int64_t bytes; | 200 | u_int32_t bytes; |
| 197 | }; | 201 | }; |
| 198 | 202 | ||
| 199 | struct ip_conntrack_helper; | 203 | struct ip_conntrack_helper; |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_protocol.h b/include/linux/netfilter_ipv4/ip_conntrack_protocol.h index b6b99be8632a..2c76b879e3dc 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_protocol.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_protocol.h | |||
| @@ -52,6 +52,9 @@ struct ip_conntrack_protocol | |||
| 52 | int (*to_nfattr)(struct sk_buff *skb, struct nfattr *nfa, | 52 | int (*to_nfattr)(struct sk_buff *skb, struct nfattr *nfa, |
| 53 | const struct ip_conntrack *ct); | 53 | const struct ip_conntrack *ct); |
| 54 | 54 | ||
| 55 | /* convert nfnetlink attributes to protoinfo */ | ||
| 56 | int (*from_nfattr)(struct nfattr *tb[], struct ip_conntrack *ct); | ||
| 57 | |||
| 55 | int (*tuple_to_nfattr)(struct sk_buff *skb, | 58 | int (*tuple_to_nfattr)(struct sk_buff *skb, |
| 56 | const struct ip_conntrack_tuple *t); | 59 | const struct ip_conntrack_tuple *t); |
| 57 | int (*nfattr_to_tuple)(struct nfattr *tb[], | 60 | int (*nfattr_to_tuple)(struct nfattr *tb[], |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_tuple.h b/include/linux/netfilter_ipv4/ip_conntrack_tuple.h index 20e43f018b7c..3232db11a4e5 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_tuple.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_tuple.h | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | #ifndef _IP_CONNTRACK_TUPLE_H | 1 | #ifndef _IP_CONNTRACK_TUPLE_H |
| 2 | #define _IP_CONNTRACK_TUPLE_H | 2 | #define _IP_CONNTRACK_TUPLE_H |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 4 | /* A `tuple' is a structure containing the information to uniquely | 6 | /* A `tuple' is a structure containing the information to uniquely |
| 5 | identify a connection. ie. if two packets have the same tuple, they | 7 | identify a connection. ie. if two packets have the same tuple, they |
| 6 | are in the same connection; if not, they are not. | 8 | are in the same connection; if not, they are not. |
diff --git a/include/linux/netfilter_ipv4/ip_nat.h b/include/linux/netfilter_ipv4/ip_nat.h index e201ec6e9905..41a107de17cf 100644 --- a/include/linux/netfilter_ipv4/ip_nat.h +++ b/include/linux/netfilter_ipv4/ip_nat.h | |||
| @@ -58,10 +58,6 @@ extern rwlock_t ip_nat_lock; | |||
| 58 | struct ip_nat_info | 58 | struct ip_nat_info |
| 59 | { | 59 | { |
| 60 | struct list_head bysource; | 60 | struct list_head bysource; |
| 61 | |||
| 62 | /* Helper (NULL if none). */ | ||
| 63 | struct ip_nat_helper *helper; | ||
| 64 | |||
| 65 | struct ip_nat_seq seq[IP_CT_DIR_MAX]; | 61 | struct ip_nat_seq seq[IP_CT_DIR_MAX]; |
| 66 | }; | 62 | }; |
| 67 | 63 | ||
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index 5ade54a78dbb..ca5a8733000f 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h | |||
| @@ -86,7 +86,7 @@ static inline void netpoll_poll_unlock(void *have) | |||
| 86 | 86 | ||
| 87 | #else | 87 | #else |
| 88 | #define netpoll_rx(a) 0 | 88 | #define netpoll_rx(a) 0 |
| 89 | #define netpoll_poll_lock(a) 0 | 89 | #define netpoll_poll_lock(a) NULL |
| 90 | #define netpoll_poll_unlock(a) | 90 | #define netpoll_poll_unlock(a) |
| 91 | #endif | 91 | #endif |
| 92 | 92 | ||
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h index 4ade56ef3a4d..28f7b2103505 100644 --- a/include/net/inet_timewait_sock.h +++ b/include/net/inet_timewait_sock.h | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | #include <linux/ip.h> | 20 | #include <linux/ip.h> |
| 21 | #include <linux/list.h> | 21 | #include <linux/list.h> |
| 22 | #include <linux/module.h> | ||
| 22 | #include <linux/timer.h> | 23 | #include <linux/timer.h> |
| 23 | #include <linux/types.h> | 24 | #include <linux/types.h> |
| 24 | #include <linux/workqueue.h> | 25 | #include <linux/workqueue.h> |
| @@ -193,11 +194,13 @@ static inline u32 inet_rcv_saddr(const struct sock *sk) | |||
| 193 | static inline void inet_twsk_put(struct inet_timewait_sock *tw) | 194 | static inline void inet_twsk_put(struct inet_timewait_sock *tw) |
| 194 | { | 195 | { |
| 195 | if (atomic_dec_and_test(&tw->tw_refcnt)) { | 196 | if (atomic_dec_and_test(&tw->tw_refcnt)) { |
| 197 | struct module *owner = tw->tw_prot->owner; | ||
| 196 | #ifdef SOCK_REFCNT_DEBUG | 198 | #ifdef SOCK_REFCNT_DEBUG |
| 197 | printk(KERN_DEBUG "%s timewait_sock %p released\n", | 199 | printk(KERN_DEBUG "%s timewait_sock %p released\n", |
| 198 | tw->tw_prot->name, tw); | 200 | tw->tw_prot->name, tw); |
| 199 | #endif | 201 | #endif |
| 200 | kmem_cache_free(tw->tw_prot->twsk_slab, tw); | 202 | kmem_cache_free(tw->tw_prot->twsk_slab, tw); |
| 203 | module_put(owner); | ||
| 201 | } | 204 | } |
| 202 | } | 205 | } |
| 203 | 206 | ||
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index 91bb895375f4..defcf6a8607c 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c | |||
| @@ -79,7 +79,6 @@ static void destroy_nbp(struct net_bridge_port *p) | |||
| 79 | { | 79 | { |
| 80 | struct net_device *dev = p->dev; | 80 | struct net_device *dev = p->dev; |
| 81 | 81 | ||
| 82 | dev->br_port = NULL; | ||
| 83 | p->br = NULL; | 82 | p->br = NULL; |
| 84 | p->dev = NULL; | 83 | p->dev = NULL; |
| 85 | dev_put(dev); | 84 | dev_put(dev); |
| @@ -100,6 +99,7 @@ static void del_nbp(struct net_bridge_port *p) | |||
| 100 | struct net_bridge *br = p->br; | 99 | struct net_bridge *br = p->br; |
| 101 | struct net_device *dev = p->dev; | 100 | struct net_device *dev = p->dev; |
| 102 | 101 | ||
| 102 | dev->br_port = NULL; | ||
| 103 | dev_set_promiscuity(dev, -1); | 103 | dev_set_promiscuity(dev, -1); |
| 104 | 104 | ||
| 105 | spin_lock_bh(&br->lock); | 105 | spin_lock_bh(&br->lock); |
diff --git a/net/dccp/ccid.h b/net/dccp/ccid.h index 21e55142dcd3..c37eeeaf5c6e 100644 --- a/net/dccp/ccid.h +++ b/net/dccp/ccid.h | |||
| @@ -110,14 +110,14 @@ static inline int ccid_hc_tx_init(struct ccid *ccid, struct sock *sk) | |||
| 110 | 110 | ||
| 111 | static inline void ccid_hc_rx_exit(struct ccid *ccid, struct sock *sk) | 111 | static inline void ccid_hc_rx_exit(struct ccid *ccid, struct sock *sk) |
| 112 | { | 112 | { |
| 113 | if (ccid->ccid_hc_rx_exit != NULL && | 113 | if (ccid != NULL && ccid->ccid_hc_rx_exit != NULL && |
| 114 | dccp_sk(sk)->dccps_hc_rx_ccid_private != NULL) | 114 | dccp_sk(sk)->dccps_hc_rx_ccid_private != NULL) |
| 115 | ccid->ccid_hc_rx_exit(sk); | 115 | ccid->ccid_hc_rx_exit(sk); |
| 116 | } | 116 | } |
| 117 | 117 | ||
| 118 | static inline void ccid_hc_tx_exit(struct ccid *ccid, struct sock *sk) | 118 | static inline void ccid_hc_tx_exit(struct ccid *ccid, struct sock *sk) |
| 119 | { | 119 | { |
| 120 | if (ccid->ccid_hc_tx_exit != NULL && | 120 | if (ccid != NULL && ccid->ccid_hc_tx_exit != NULL && |
| 121 | dccp_sk(sk)->dccps_hc_tx_ccid_private != NULL) | 121 | dccp_sk(sk)->dccps_hc_tx_ccid_private != NULL) |
| 122 | ccid->ccid_hc_tx_exit(sk); | 122 | ccid->ccid_hc_tx_exit(sk); |
| 123 | } | 123 | } |
diff --git a/net/dccp/input.c b/net/dccp/input.c index 1b6b2cb12376..3454d5941900 100644 --- a/net/dccp/input.c +++ b/net/dccp/input.c | |||
| @@ -375,6 +375,9 @@ static int dccp_rcv_respond_partopen_state_process(struct sock *sk, | |||
| 375 | case DCCP_PKT_RESET: | 375 | case DCCP_PKT_RESET: |
| 376 | inet_csk_clear_xmit_timer(sk, ICSK_TIME_DACK); | 376 | inet_csk_clear_xmit_timer(sk, ICSK_TIME_DACK); |
| 377 | break; | 377 | break; |
| 378 | case DCCP_PKT_DATA: | ||
| 379 | if (sk->sk_state == DCCP_RESPOND) | ||
| 380 | break; | ||
| 378 | case DCCP_PKT_DATAACK: | 381 | case DCCP_PKT_DATAACK: |
| 379 | case DCCP_PKT_ACK: | 382 | case DCCP_PKT_ACK: |
| 380 | /* | 383 | /* |
| @@ -393,7 +396,8 @@ static int dccp_rcv_respond_partopen_state_process(struct sock *sk, | |||
| 393 | dccp_sk(sk)->dccps_osr = DCCP_SKB_CB(skb)->dccpd_seq; | 396 | dccp_sk(sk)->dccps_osr = DCCP_SKB_CB(skb)->dccpd_seq; |
| 394 | dccp_set_state(sk, DCCP_OPEN); | 397 | dccp_set_state(sk, DCCP_OPEN); |
| 395 | 398 | ||
| 396 | if (dh->dccph_type == DCCP_PKT_DATAACK) { | 399 | if (dh->dccph_type == DCCP_PKT_DATAACK || |
| 400 | dh->dccph_type == DCCP_PKT_DATA) { | ||
| 397 | dccp_rcv_established(sk, skb, dh, len); | 401 | dccp_rcv_established(sk, skb, dh, len); |
| 398 | queued = 1; /* packet was queued | 402 | queued = 1; /* packet was queued |
| 399 | (by dccp_rcv_established) */ | 403 | (by dccp_rcv_established) */ |
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c index 1b5a09d1b90b..1b18ce66e7b7 100644 --- a/net/ipv4/esp4.c +++ b/net/ipv4/esp4.c | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #include <net/esp.h> | 5 | #include <net/esp.h> |
| 6 | #include <asm/scatterlist.h> | 6 | #include <asm/scatterlist.h> |
| 7 | #include <linux/crypto.h> | 7 | #include <linux/crypto.h> |
| 8 | #include <linux/kernel.h> | ||
| 8 | #include <linux/pfkeyv2.h> | 9 | #include <linux/pfkeyv2.h> |
| 9 | #include <linux/random.h> | 10 | #include <linux/random.h> |
| 10 | #include <net/icmp.h> | 11 | #include <net/icmp.h> |
| @@ -42,10 +43,10 @@ static int esp_output(struct xfrm_state *x, struct sk_buff *skb) | |||
| 42 | esp = x->data; | 43 | esp = x->data; |
| 43 | alen = esp->auth.icv_trunc_len; | 44 | alen = esp->auth.icv_trunc_len; |
| 44 | tfm = esp->conf.tfm; | 45 | tfm = esp->conf.tfm; |
| 45 | blksize = (crypto_tfm_alg_blocksize(tfm) + 3) & ~3; | 46 | blksize = ALIGN(crypto_tfm_alg_blocksize(tfm), 4); |
| 46 | clen = (clen + 2 + blksize-1)&~(blksize-1); | 47 | clen = ALIGN(clen + 2, blksize); |
| 47 | if (esp->conf.padlen) | 48 | if (esp->conf.padlen) |
| 48 | clen = (clen + esp->conf.padlen-1)&~(esp->conf.padlen-1); | 49 | clen = ALIGN(clen, esp->conf.padlen); |
| 49 | 50 | ||
| 50 | if ((nfrags = skb_cow_data(skb, clen-skb->len+alen, &trailer)) < 0) | 51 | if ((nfrags = skb_cow_data(skb, clen-skb->len+alen, &trailer)) < 0) |
| 51 | goto error; | 52 | goto error; |
| @@ -143,7 +144,7 @@ static int esp_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struc | |||
| 143 | struct ip_esp_hdr *esph; | 144 | struct ip_esp_hdr *esph; |
| 144 | struct esp_data *esp = x->data; | 145 | struct esp_data *esp = x->data; |
| 145 | struct sk_buff *trailer; | 146 | struct sk_buff *trailer; |
| 146 | int blksize = crypto_tfm_alg_blocksize(esp->conf.tfm); | 147 | int blksize = ALIGN(crypto_tfm_alg_blocksize(esp->conf.tfm), 4); |
| 147 | int alen = esp->auth.icv_trunc_len; | 148 | int alen = esp->auth.icv_trunc_len; |
| 148 | int elen = skb->len - sizeof(struct ip_esp_hdr) - esp->conf.ivlen - alen; | 149 | int elen = skb->len - sizeof(struct ip_esp_hdr) - esp->conf.ivlen - alen; |
| 149 | int nfrags; | 150 | int nfrags; |
| @@ -304,16 +305,16 @@ static int esp_post_input(struct xfrm_state *x, struct xfrm_decap_state *decap, | |||
| 304 | static u32 esp4_get_max_size(struct xfrm_state *x, int mtu) | 305 | static u32 esp4_get_max_size(struct xfrm_state *x, int mtu) |
| 305 | { | 306 | { |
| 306 | struct esp_data *esp = x->data; | 307 | struct esp_data *esp = x->data; |
| 307 | u32 blksize = crypto_tfm_alg_blocksize(esp->conf.tfm); | 308 | u32 blksize = ALIGN(crypto_tfm_alg_blocksize(esp->conf.tfm), 4); |
| 308 | 309 | ||
| 309 | if (x->props.mode) { | 310 | if (x->props.mode) { |
| 310 | mtu = (mtu + 2 + blksize-1)&~(blksize-1); | 311 | mtu = ALIGN(mtu + 2, blksize); |
| 311 | } else { | 312 | } else { |
| 312 | /* The worst case. */ | 313 | /* The worst case. */ |
| 313 | mtu += 2 + blksize; | 314 | mtu = ALIGN(mtu + 2, 4) + blksize - 4; |
| 314 | } | 315 | } |
| 315 | if (esp->conf.padlen) | 316 | if (esp->conf.padlen) |
| 316 | mtu = (mtu + esp->conf.padlen-1)&~(esp->conf.padlen-1); | 317 | mtu = ALIGN(mtu, esp->conf.padlen); |
| 317 | 318 | ||
| 318 | return mtu + x->props.header_len + esp->auth.icv_trunc_len; | 319 | return mtu + x->props.header_len + esp->auth.icv_trunc_len; |
| 319 | } | 320 | } |
diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c index f9076ef3a1a8..a010e9a68811 100644 --- a/net/ipv4/inet_timewait_sock.c +++ b/net/ipv4/inet_timewait_sock.c | |||
| @@ -111,6 +111,7 @@ struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, const int stat | |||
| 111 | tw->tw_prot = sk->sk_prot_creator; | 111 | tw->tw_prot = sk->sk_prot_creator; |
| 112 | atomic_set(&tw->tw_refcnt, 1); | 112 | atomic_set(&tw->tw_refcnt, 1); |
| 113 | inet_twsk_dead_node_init(tw); | 113 | inet_twsk_dead_node_init(tw); |
| 114 | __module_get(tw->tw_prot->owner); | ||
| 114 | } | 115 | } |
| 115 | 116 | ||
| 116 | return tw; | 117 | return tw; |
diff --git a/net/ipv4/netfilter/Kconfig b/net/ipv4/netfilter/Kconfig index a7659728e7a0..7d917e4ce1d9 100644 --- a/net/ipv4/netfilter/Kconfig +++ b/net/ipv4/netfilter/Kconfig | |||
| @@ -139,6 +139,7 @@ config IP_NF_AMANDA | |||
| 139 | 139 | ||
| 140 | config IP_NF_PPTP | 140 | config IP_NF_PPTP |
| 141 | tristate 'PPTP protocol support' | 141 | tristate 'PPTP protocol support' |
| 142 | depends on IP_NF_CONNTRACK | ||
| 142 | help | 143 | help |
| 143 | This module adds support for PPTP (Point to Point Tunnelling | 144 | This module adds support for PPTP (Point to Point Tunnelling |
| 144 | Protocol, RFC2637) connection tracking and NAT. | 145 | Protocol, RFC2637) connection tracking and NAT. |
| @@ -498,9 +499,14 @@ config IP_NF_TARGET_LOG | |||
| 498 | To compile it as a module, choose M here. If unsure, say N. | 499 | To compile it as a module, choose M here. If unsure, say N. |
| 499 | 500 | ||
| 500 | config IP_NF_TARGET_ULOG | 501 | config IP_NF_TARGET_ULOG |
| 501 | tristate "ULOG target support" | 502 | tristate "ULOG target support (OBSOLETE)" |
| 502 | depends on IP_NF_IPTABLES | 503 | depends on IP_NF_IPTABLES |
| 503 | ---help--- | 504 | ---help--- |
| 505 | |||
| 506 | This option enables the old IPv4-only "ipt_ULOG" implementation | ||
| 507 | which has been obsoleted by the new "nfnetlink_log" code (see | ||
| 508 | CONFIG_NETFILTER_NETLINK_LOG). | ||
| 509 | |||
| 504 | This option adds a `ULOG' target, which allows you to create rules in | 510 | This option adds a `ULOG' target, which allows you to create rules in |
| 505 | any iptables table. The packet is passed to a userspace logging | 511 | any iptables table. The packet is passed to a userspace logging |
| 506 | daemon using netlink multicast sockets; unlike the LOG target | 512 | daemon using netlink multicast sockets; unlike the LOG target |
diff --git a/net/ipv4/netfilter/ip_conntrack_core.c b/net/ipv4/netfilter/ip_conntrack_core.c index ea65dd3e517a..07a80b56e8dc 100644 --- a/net/ipv4/netfilter/ip_conntrack_core.c +++ b/net/ipv4/netfilter/ip_conntrack_core.c | |||
| @@ -1119,7 +1119,7 @@ void __ip_ct_refresh_acct(struct ip_conntrack *ct, | |||
| 1119 | unsigned long extra_jiffies, | 1119 | unsigned long extra_jiffies, |
| 1120 | int do_acct) | 1120 | int do_acct) |
| 1121 | { | 1121 | { |
| 1122 | int do_event = 0; | 1122 | int event = 0; |
| 1123 | 1123 | ||
| 1124 | IP_NF_ASSERT(ct->timeout.data == (unsigned long)ct); | 1124 | IP_NF_ASSERT(ct->timeout.data == (unsigned long)ct); |
| 1125 | IP_NF_ASSERT(skb); | 1125 | IP_NF_ASSERT(skb); |
| @@ -1129,13 +1129,13 @@ void __ip_ct_refresh_acct(struct ip_conntrack *ct, | |||
| 1129 | /* If not in hash table, timer will not be active yet */ | 1129 | /* If not in hash table, timer will not be active yet */ |
| 1130 | if (!is_confirmed(ct)) { | 1130 | if (!is_confirmed(ct)) { |
| 1131 | ct->timeout.expires = extra_jiffies; | 1131 | ct->timeout.expires = extra_jiffies; |
| 1132 | do_event = 1; | 1132 | event = IPCT_REFRESH; |
| 1133 | } else { | 1133 | } else { |
| 1134 | /* Need del_timer for race avoidance (may already be dying). */ | 1134 | /* Need del_timer for race avoidance (may already be dying). */ |
| 1135 | if (del_timer(&ct->timeout)) { | 1135 | if (del_timer(&ct->timeout)) { |
| 1136 | ct->timeout.expires = jiffies + extra_jiffies; | 1136 | ct->timeout.expires = jiffies + extra_jiffies; |
| 1137 | add_timer(&ct->timeout); | 1137 | add_timer(&ct->timeout); |
| 1138 | do_event = 1; | 1138 | event = IPCT_REFRESH; |
| 1139 | } | 1139 | } |
| 1140 | } | 1140 | } |
| 1141 | 1141 | ||
| @@ -1144,14 +1144,17 @@ void __ip_ct_refresh_acct(struct ip_conntrack *ct, | |||
| 1144 | ct->counters[CTINFO2DIR(ctinfo)].packets++; | 1144 | ct->counters[CTINFO2DIR(ctinfo)].packets++; |
| 1145 | ct->counters[CTINFO2DIR(ctinfo)].bytes += | 1145 | ct->counters[CTINFO2DIR(ctinfo)].bytes += |
| 1146 | ntohs(skb->nh.iph->tot_len); | 1146 | ntohs(skb->nh.iph->tot_len); |
| 1147 | if ((ct->counters[CTINFO2DIR(ctinfo)].packets & 0x80000000) | ||
| 1148 | || (ct->counters[CTINFO2DIR(ctinfo)].bytes & 0x80000000)) | ||
| 1149 | event |= IPCT_COUNTER_FILLING; | ||
| 1147 | } | 1150 | } |
| 1148 | #endif | 1151 | #endif |
| 1149 | 1152 | ||
| 1150 | write_unlock_bh(&ip_conntrack_lock); | 1153 | write_unlock_bh(&ip_conntrack_lock); |
| 1151 | 1154 | ||
| 1152 | /* must be unlocked when calling event cache */ | 1155 | /* must be unlocked when calling event cache */ |
| 1153 | if (do_event) | 1156 | if (event) |
| 1154 | ip_conntrack_event_cache(IPCT_REFRESH, skb); | 1157 | ip_conntrack_event_cache(event, skb); |
| 1155 | } | 1158 | } |
| 1156 | 1159 | ||
| 1157 | #if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ | 1160 | #if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ |
diff --git a/net/ipv4/netfilter/ip_conntrack_netlink.c b/net/ipv4/netfilter/ip_conntrack_netlink.c index b08a432efcf8..166e6069f121 100644 --- a/net/ipv4/netfilter/ip_conntrack_netlink.c +++ b/net/ipv4/netfilter/ip_conntrack_netlink.c | |||
| @@ -177,11 +177,11 @@ ctnetlink_dump_counters(struct sk_buff *skb, const struct ip_conntrack *ct, | |||
| 177 | struct nfattr *nest_count = NFA_NEST(skb, type); | 177 | struct nfattr *nest_count = NFA_NEST(skb, type); |
| 178 | u_int64_t tmp; | 178 | u_int64_t tmp; |
| 179 | 179 | ||
| 180 | tmp = cpu_to_be64(ct->counters[dir].packets); | 180 | tmp = htonl(ct->counters[dir].packets); |
| 181 | NFA_PUT(skb, CTA_COUNTERS_PACKETS, sizeof(u_int64_t), &tmp); | 181 | NFA_PUT(skb, CTA_COUNTERS32_PACKETS, sizeof(u_int32_t), &tmp); |
| 182 | 182 | ||
| 183 | tmp = cpu_to_be64(ct->counters[dir].bytes); | 183 | tmp = htonl(ct->counters[dir].bytes); |
| 184 | NFA_PUT(skb, CTA_COUNTERS_BYTES, sizeof(u_int64_t), &tmp); | 184 | NFA_PUT(skb, CTA_COUNTERS32_BYTES, sizeof(u_int32_t), &tmp); |
| 185 | 185 | ||
| 186 | NFA_NEST_END(skb, nest_count); | 186 | NFA_NEST_END(skb, nest_count); |
| 187 | 187 | ||
| @@ -833,7 +833,8 @@ out: | |||
| 833 | static inline int | 833 | static inline int |
| 834 | ctnetlink_change_status(struct ip_conntrack *ct, struct nfattr *cda[]) | 834 | ctnetlink_change_status(struct ip_conntrack *ct, struct nfattr *cda[]) |
| 835 | { | 835 | { |
| 836 | unsigned long d, status = *(u_int32_t *)NFA_DATA(cda[CTA_STATUS-1]); | 836 | unsigned long d; |
| 837 | unsigned status = ntohl(*(u_int32_t *)NFA_DATA(cda[CTA_STATUS-1])); | ||
| 837 | d = ct->status ^ status; | 838 | d = ct->status ^ status; |
| 838 | 839 | ||
| 839 | if (d & (IPS_EXPECTED|IPS_CONFIRMED|IPS_DYING)) | 840 | if (d & (IPS_EXPECTED|IPS_CONFIRMED|IPS_DYING)) |
| @@ -948,6 +949,31 @@ ctnetlink_change_timeout(struct ip_conntrack *ct, struct nfattr *cda[]) | |||
| 948 | return 0; | 949 | return 0; |
| 949 | } | 950 | } |
| 950 | 951 | ||
| 952 | static inline int | ||
| 953 | ctnetlink_change_protoinfo(struct ip_conntrack *ct, struct nfattr *cda[]) | ||
| 954 | { | ||
| 955 | struct nfattr *tb[CTA_PROTOINFO_MAX], *attr = cda[CTA_PROTOINFO-1]; | ||
| 956 | struct ip_conntrack_protocol *proto; | ||
| 957 | u_int16_t npt = ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.protonum; | ||
| 958 | int err = 0; | ||
| 959 | |||
| 960 | if (nfattr_parse_nested(tb, CTA_PROTOINFO_MAX, attr) < 0) | ||
| 961 | goto nfattr_failure; | ||
| 962 | |||
| 963 | proto = ip_conntrack_proto_find_get(npt); | ||
| 964 | if (!proto) | ||
| 965 | return -EINVAL; | ||
| 966 | |||
| 967 | if (proto->from_nfattr) | ||
| 968 | err = proto->from_nfattr(tb, ct); | ||
| 969 | ip_conntrack_proto_put(proto); | ||
| 970 | |||
| 971 | return err; | ||
| 972 | |||
| 973 | nfattr_failure: | ||
| 974 | return -ENOMEM; | ||
| 975 | } | ||
| 976 | |||
| 951 | static int | 977 | static int |
| 952 | ctnetlink_change_conntrack(struct ip_conntrack *ct, struct nfattr *cda[]) | 978 | ctnetlink_change_conntrack(struct ip_conntrack *ct, struct nfattr *cda[]) |
| 953 | { | 979 | { |
| @@ -973,6 +999,12 @@ ctnetlink_change_conntrack(struct ip_conntrack *ct, struct nfattr *cda[]) | |||
| 973 | return err; | 999 | return err; |
| 974 | } | 1000 | } |
| 975 | 1001 | ||
| 1002 | if (cda[CTA_PROTOINFO-1]) { | ||
| 1003 | err = ctnetlink_change_protoinfo(ct, cda); | ||
| 1004 | if (err < 0) | ||
| 1005 | return err; | ||
| 1006 | } | ||
| 1007 | |||
| 976 | DEBUGP("all done\n"); | 1008 | DEBUGP("all done\n"); |
| 977 | return 0; | 1009 | return 0; |
| 978 | } | 1010 | } |
| @@ -1002,6 +1034,12 @@ ctnetlink_create_conntrack(struct nfattr *cda[], | |||
| 1002 | if (err < 0) | 1034 | if (err < 0) |
| 1003 | goto err; | 1035 | goto err; |
| 1004 | 1036 | ||
| 1037 | if (cda[CTA_PROTOINFO-1]) { | ||
| 1038 | err = ctnetlink_change_protoinfo(ct, cda); | ||
| 1039 | if (err < 0) | ||
| 1040 | return err; | ||
| 1041 | } | ||
| 1042 | |||
| 1005 | ct->helper = ip_conntrack_helper_find_get(rtuple); | 1043 | ct->helper = ip_conntrack_helper_find_get(rtuple); |
| 1006 | 1044 | ||
| 1007 | add_timer(&ct->timeout); | 1045 | add_timer(&ct->timeout); |
diff --git a/net/ipv4/netfilter/ip_conntrack_proto_icmp.c b/net/ipv4/netfilter/ip_conntrack_proto_icmp.c index 838d1d69b36e..98f0015dd255 100644 --- a/net/ipv4/netfilter/ip_conntrack_proto_icmp.c +++ b/net/ipv4/netfilter/ip_conntrack_proto_icmp.c | |||
| @@ -296,8 +296,7 @@ static int icmp_nfattr_to_tuple(struct nfattr *tb[], | |||
| 296 | struct ip_conntrack_tuple *tuple) | 296 | struct ip_conntrack_tuple *tuple) |
| 297 | { | 297 | { |
| 298 | if (!tb[CTA_PROTO_ICMP_TYPE-1] | 298 | if (!tb[CTA_PROTO_ICMP_TYPE-1] |
| 299 | || !tb[CTA_PROTO_ICMP_CODE-1] | 299 | || !tb[CTA_PROTO_ICMP_CODE-1]) |
| 300 | || !tb[CTA_PROTO_ICMP_ID-1]) | ||
| 301 | return -1; | 300 | return -1; |
| 302 | 301 | ||
| 303 | tuple->dst.u.icmp.type = | 302 | tuple->dst.u.icmp.type = |
diff --git a/net/ipv4/netfilter/ip_conntrack_proto_tcp.c b/net/ipv4/netfilter/ip_conntrack_proto_tcp.c index 121760d6cc50..d6701cafbcc2 100644 --- a/net/ipv4/netfilter/ip_conntrack_proto_tcp.c +++ b/net/ipv4/netfilter/ip_conntrack_proto_tcp.c | |||
| @@ -341,17 +341,43 @@ static int tcp_print_conntrack(struct seq_file *s, | |||
| 341 | static int tcp_to_nfattr(struct sk_buff *skb, struct nfattr *nfa, | 341 | static int tcp_to_nfattr(struct sk_buff *skb, struct nfattr *nfa, |
| 342 | const struct ip_conntrack *ct) | 342 | const struct ip_conntrack *ct) |
| 343 | { | 343 | { |
| 344 | struct nfattr *nest_parms = NFA_NEST(skb, CTA_PROTOINFO_TCP); | ||
| 345 | |||
| 344 | read_lock_bh(&tcp_lock); | 346 | read_lock_bh(&tcp_lock); |
| 345 | NFA_PUT(skb, CTA_PROTOINFO_TCP_STATE, sizeof(u_int8_t), | 347 | NFA_PUT(skb, CTA_PROTOINFO_TCP_STATE, sizeof(u_int8_t), |
| 346 | &ct->proto.tcp.state); | 348 | &ct->proto.tcp.state); |
| 347 | read_unlock_bh(&tcp_lock); | 349 | read_unlock_bh(&tcp_lock); |
| 348 | 350 | ||
| 351 | NFA_NEST_END(skb, nest_parms); | ||
| 352 | |||
| 349 | return 0; | 353 | return 0; |
| 350 | 354 | ||
| 351 | nfattr_failure: | 355 | nfattr_failure: |
| 352 | read_unlock_bh(&tcp_lock); | 356 | read_unlock_bh(&tcp_lock); |
| 353 | return -1; | 357 | return -1; |
| 354 | } | 358 | } |
| 359 | |||
| 360 | static int nfattr_to_tcp(struct nfattr *cda[], struct ip_conntrack *ct) | ||
| 361 | { | ||
| 362 | struct nfattr *attr = cda[CTA_PROTOINFO_TCP-1]; | ||
| 363 | struct nfattr *tb[CTA_PROTOINFO_TCP_MAX]; | ||
| 364 | |||
| 365 | if (nfattr_parse_nested(tb, CTA_PROTOINFO_TCP_MAX, attr) < 0) | ||
| 366 | goto nfattr_failure; | ||
| 367 | |||
| 368 | if (!tb[CTA_PROTOINFO_TCP_STATE-1]) | ||
| 369 | return -EINVAL; | ||
| 370 | |||
| 371 | write_lock_bh(&tcp_lock); | ||
| 372 | ct->proto.tcp.state = | ||
| 373 | *(u_int8_t *)NFA_DATA(tb[CTA_PROTOINFO_TCP_STATE-1]); | ||
| 374 | write_unlock_bh(&tcp_lock); | ||
| 375 | |||
| 376 | return 0; | ||
| 377 | |||
| 378 | nfattr_failure: | ||
| 379 | return -1; | ||
| 380 | } | ||
| 355 | #endif | 381 | #endif |
| 356 | 382 | ||
| 357 | static unsigned int get_conntrack_index(const struct tcphdr *tcph) | 383 | static unsigned int get_conntrack_index(const struct tcphdr *tcph) |
| @@ -1123,6 +1149,7 @@ struct ip_conntrack_protocol ip_conntrack_protocol_tcp = | |||
| 1123 | #if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ | 1149 | #if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ |
| 1124 | defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) | 1150 | defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) |
| 1125 | .to_nfattr = tcp_to_nfattr, | 1151 | .to_nfattr = tcp_to_nfattr, |
| 1152 | .from_nfattr = nfattr_to_tcp, | ||
| 1126 | .tuple_to_nfattr = ip_ct_port_tuple_to_nfattr, | 1153 | .tuple_to_nfattr = ip_ct_port_tuple_to_nfattr, |
| 1127 | .nfattr_to_tuple = ip_ct_port_nfattr_to_tuple, | 1154 | .nfattr_to_tuple = ip_ct_port_nfattr_to_tuple, |
| 1128 | #endif | 1155 | #endif |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 8225e4257258..f37a50e55b68 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
| @@ -435,7 +435,14 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss | |||
| 435 | int nsize, old_factor; | 435 | int nsize, old_factor; |
| 436 | u16 flags; | 436 | u16 flags; |
| 437 | 437 | ||
| 438 | BUG_ON(len >= skb->len); | 438 | if (unlikely(len >= skb->len)) { |
| 439 | printk(KERN_DEBUG "TCP: seg_size=%u, mss=%u, seq=%u, " | ||
| 440 | "end_seq=%u, skb->len=%u.\n", len, mss_now, | ||
| 441 | TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq, | ||
| 442 | skb->len); | ||
| 443 | WARN_ON(1); | ||
| 444 | return 0; | ||
| 445 | } | ||
| 439 | 446 | ||
| 440 | nsize = skb_headlen(skb) - len; | 447 | nsize = skb_headlen(skb) - len; |
| 441 | if (nsize < 0) | 448 | if (nsize < 0) |
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c index 9b27460f0cc7..40d9a1935ab5 100644 --- a/net/ipv6/esp6.c +++ b/net/ipv6/esp6.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | #include <net/esp.h> | 31 | #include <net/esp.h> |
| 32 | #include <asm/scatterlist.h> | 32 | #include <asm/scatterlist.h> |
| 33 | #include <linux/crypto.h> | 33 | #include <linux/crypto.h> |
| 34 | #include <linux/kernel.h> | ||
| 34 | #include <linux/pfkeyv2.h> | 35 | #include <linux/pfkeyv2.h> |
| 35 | #include <linux/random.h> | 36 | #include <linux/random.h> |
| 36 | #include <net/icmp.h> | 37 | #include <net/icmp.h> |
| @@ -66,10 +67,10 @@ static int esp6_output(struct xfrm_state *x, struct sk_buff *skb) | |||
| 66 | 67 | ||
| 67 | alen = esp->auth.icv_trunc_len; | 68 | alen = esp->auth.icv_trunc_len; |
| 68 | tfm = esp->conf.tfm; | 69 | tfm = esp->conf.tfm; |
| 69 | blksize = (crypto_tfm_alg_blocksize(tfm) + 3) & ~3; | 70 | blksize = ALIGN(crypto_tfm_alg_blocksize(tfm), 4); |
| 70 | clen = (clen + 2 + blksize-1)&~(blksize-1); | 71 | clen = ALIGN(clen + 2, blksize); |
| 71 | if (esp->conf.padlen) | 72 | if (esp->conf.padlen) |
| 72 | clen = (clen + esp->conf.padlen-1)&~(esp->conf.padlen-1); | 73 | clen = ALIGN(clen, esp->conf.padlen); |
| 73 | 74 | ||
| 74 | if ((nfrags = skb_cow_data(skb, clen-skb->len+alen, &trailer)) < 0) { | 75 | if ((nfrags = skb_cow_data(skb, clen-skb->len+alen, &trailer)) < 0) { |
| 75 | goto error; | 76 | goto error; |
| @@ -133,7 +134,7 @@ static int esp6_input(struct xfrm_state *x, struct xfrm_decap_state *decap, stru | |||
| 133 | struct ipv6_esp_hdr *esph; | 134 | struct ipv6_esp_hdr *esph; |
| 134 | struct esp_data *esp = x->data; | 135 | struct esp_data *esp = x->data; |
| 135 | struct sk_buff *trailer; | 136 | struct sk_buff *trailer; |
| 136 | int blksize = crypto_tfm_alg_blocksize(esp->conf.tfm); | 137 | int blksize = ALIGN(crypto_tfm_alg_blocksize(esp->conf.tfm), 4); |
| 137 | int alen = esp->auth.icv_trunc_len; | 138 | int alen = esp->auth.icv_trunc_len; |
| 138 | int elen = skb->len - sizeof(struct ipv6_esp_hdr) - esp->conf.ivlen - alen; | 139 | int elen = skb->len - sizeof(struct ipv6_esp_hdr) - esp->conf.ivlen - alen; |
| 139 | 140 | ||
| @@ -235,16 +236,17 @@ out_nofree: | |||
| 235 | static u32 esp6_get_max_size(struct xfrm_state *x, int mtu) | 236 | static u32 esp6_get_max_size(struct xfrm_state *x, int mtu) |
| 236 | { | 237 | { |
| 237 | struct esp_data *esp = x->data; | 238 | struct esp_data *esp = x->data; |
| 238 | u32 blksize = crypto_tfm_alg_blocksize(esp->conf.tfm); | 239 | u32 blksize = ALIGN(crypto_tfm_alg_blocksize(esp->conf.tfm), 4); |
| 239 | 240 | ||
| 240 | if (x->props.mode) { | 241 | if (x->props.mode) { |
| 241 | mtu = (mtu + 2 + blksize-1)&~(blksize-1); | 242 | mtu = ALIGN(mtu + 2, blksize); |
| 242 | } else { | 243 | } else { |
| 243 | /* The worst case. */ | 244 | /* The worst case. */ |
| 244 | mtu += 2 + blksize; | 245 | u32 padsize = ((blksize - 1) & 7) + 1; |
| 246 | mtu = ALIGN(mtu + 2, padsize) + blksize - padsize; | ||
| 245 | } | 247 | } |
| 246 | if (esp->conf.padlen) | 248 | if (esp->conf.padlen) |
| 247 | mtu = (mtu + esp->conf.padlen-1)&~(esp->conf.padlen-1); | 249 | mtu = ALIGN(mtu, esp->conf.padlen); |
| 248 | 250 | ||
| 249 | return mtu + x->props.header_len + esp->auth.icv_full_len; | 251 | return mtu + x->props.header_len + esp->auth.icv_full_len; |
| 250 | } | 252 | } |
diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c index 1caaca06f698..4bc27a6334c1 100644 --- a/net/netfilter/nfnetlink.c +++ b/net/netfilter/nfnetlink.c | |||
| @@ -133,7 +133,7 @@ int nfattr_parse(struct nfattr *tb[], int maxattr, struct nfattr *nfa, int len) | |||
| 133 | memset(tb, 0, sizeof(struct nfattr *) * maxattr); | 133 | memset(tb, 0, sizeof(struct nfattr *) * maxattr); |
| 134 | 134 | ||
| 135 | while (NFA_OK(nfa, len)) { | 135 | while (NFA_OK(nfa, len)) { |
| 136 | unsigned flavor = nfa->nfa_type; | 136 | unsigned flavor = NFA_TYPE(nfa); |
| 137 | if (flavor && flavor <= maxattr) | 137 | if (flavor && flavor <= maxattr) |
| 138 | tb[flavor-1] = nfa; | 138 | tb[flavor-1] = nfa; |
| 139 | nfa = NFA_NEXT(nfa, len); | 139 | nfa = NFA_NEXT(nfa, len); |
| @@ -177,7 +177,7 @@ nfnetlink_check_attributes(struct nfnetlink_subsystem *subsys, | |||
| 177 | int attrlen = nlh->nlmsg_len - NLMSG_ALIGN(min_len); | 177 | int attrlen = nlh->nlmsg_len - NLMSG_ALIGN(min_len); |
| 178 | 178 | ||
| 179 | while (NFA_OK(attr, attrlen)) { | 179 | while (NFA_OK(attr, attrlen)) { |
| 180 | unsigned flavor = attr->nfa_type; | 180 | unsigned flavor = NFA_TYPE(attr); |
| 181 | if (flavor) { | 181 | if (flavor) { |
| 182 | if (flavor > attr_count) | 182 | if (flavor > attr_count) |
| 183 | return -EINVAL; | 183 | return -EINVAL; |
