diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-24 13:01:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-24 13:01:12 -0400 |
commit | 09ce42d3167e3f20b501fa780c2415332330fac5 (patch) | |
tree | 2f0a6e2e3ec51187f4df78e8c75aa31602a6edd4 | |
parent | d7ed9c05ebf56c04811276207d7110706debe09f (diff) | |
parent | 7959ea254ed18faee41160b1c50b3c9664735967 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6:
bnx2: Fix the behavior of ethtool when ONBOOT=no
qla3xxx: Don't sleep while holding lock.
qla3xxx: Give the PHY time to come out of reset.
ipv4 routing: Ensure that route cache entries are usable and reclaimable with caching is off
net: Move rx skb_orphan call to where needed
ipv6: Use correct data types for ICMPv6 type and code
net: let KS8842 driver depend on HAS_IOMEM
can: let SJA1000 driver depend on HAS_IOMEM
netxen: fix firmware init handshake
netxen: fix build with without CONFIG_PM
netfilter: xt_rateest: fix comparison with self
netfilter: xt_quota: fix incomplete initialization
netfilter: nf_log: fix direct userspace memory access in proc handler
netfilter: fix some sparse endianess warnings
netfilter: nf_conntrack: fix conntrack lookup race
netfilter: nf_conntrack: fix confirmation race condition
netfilter: nf_conntrack: death_by_timeout() fix
39 files changed, 149 insertions, 88 deletions
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 1dc721517e4c..c155bd3ec9f1 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -1725,6 +1725,7 @@ config TLAN | |||
1725 | 1725 | ||
1726 | config KS8842 | 1726 | config KS8842 |
1727 | tristate "Micrel KSZ8842" | 1727 | tristate "Micrel KSZ8842" |
1728 | depends on HAS_IOMEM | ||
1728 | help | 1729 | help |
1729 | This platform driver is for Micrel KSZ8842 chip. | 1730 | This platform driver is for Micrel KSZ8842 chip. |
1730 | 1731 | ||
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 38f1c3375d7f..b70cc99962fc 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -6825,6 +6825,14 @@ bnx2_nway_reset(struct net_device *dev) | |||
6825 | return 0; | 6825 | return 0; |
6826 | } | 6826 | } |
6827 | 6827 | ||
6828 | static u32 | ||
6829 | bnx2_get_link(struct net_device *dev) | ||
6830 | { | ||
6831 | struct bnx2 *bp = netdev_priv(dev); | ||
6832 | |||
6833 | return bp->link_up; | ||
6834 | } | ||
6835 | |||
6828 | static int | 6836 | static int |
6829 | bnx2_get_eeprom_len(struct net_device *dev) | 6837 | bnx2_get_eeprom_len(struct net_device *dev) |
6830 | { | 6838 | { |
@@ -7392,7 +7400,7 @@ static const struct ethtool_ops bnx2_ethtool_ops = { | |||
7392 | .get_wol = bnx2_get_wol, | 7400 | .get_wol = bnx2_get_wol, |
7393 | .set_wol = bnx2_set_wol, | 7401 | .set_wol = bnx2_set_wol, |
7394 | .nway_reset = bnx2_nway_reset, | 7402 | .nway_reset = bnx2_nway_reset, |
7395 | .get_link = ethtool_op_get_link, | 7403 | .get_link = bnx2_get_link, |
7396 | .get_eeprom_len = bnx2_get_eeprom_len, | 7404 | .get_eeprom_len = bnx2_get_eeprom_len, |
7397 | .get_eeprom = bnx2_get_eeprom, | 7405 | .get_eeprom = bnx2_get_eeprom, |
7398 | .set_eeprom = bnx2_set_eeprom, | 7406 | .set_eeprom = bnx2_set_eeprom, |
diff --git a/drivers/net/can/Kconfig b/drivers/net/can/Kconfig index d5e18812bf49..33821a81cbf8 100644 --- a/drivers/net/can/Kconfig +++ b/drivers/net/can/Kconfig | |||
@@ -36,7 +36,7 @@ config CAN_CALC_BITTIMING | |||
36 | If unsure, say Y. | 36 | If unsure, say Y. |
37 | 37 | ||
38 | config CAN_SJA1000 | 38 | config CAN_SJA1000 |
39 | depends on CAN_DEV | 39 | depends on CAN_DEV && HAS_IOMEM |
40 | tristate "Philips SJA1000" | 40 | tristate "Philips SJA1000" |
41 | ---help--- | 41 | ---help--- |
42 | Driver for the SJA1000 CAN controllers from Philips or NXP | 42 | Driver for the SJA1000 CAN controllers from Philips or NXP |
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index bdb143d2b5c7..055bb61d6e77 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -944,28 +944,31 @@ int netxen_phantom_init(struct netxen_adapter *adapter, int pegtune_val) | |||
944 | u32 val = 0; | 944 | u32 val = 0; |
945 | int retries = 60; | 945 | int retries = 60; |
946 | 946 | ||
947 | if (!pegtune_val) { | 947 | if (pegtune_val) |
948 | do { | 948 | return 0; |
949 | val = NXRD32(adapter, CRB_CMDPEG_STATE); | ||
950 | 949 | ||
951 | if (val == PHAN_INITIALIZE_COMPLETE || | 950 | do { |
952 | val == PHAN_INITIALIZE_ACK) | 951 | val = NXRD32(adapter, CRB_CMDPEG_STATE); |
953 | return 0; | ||
954 | 952 | ||
955 | msleep(500); | 953 | switch (val) { |
954 | case PHAN_INITIALIZE_COMPLETE: | ||
955 | case PHAN_INITIALIZE_ACK: | ||
956 | return 0; | ||
957 | case PHAN_INITIALIZE_FAILED: | ||
958 | goto out_err; | ||
959 | default: | ||
960 | break; | ||
961 | } | ||
956 | 962 | ||
957 | } while (--retries); | 963 | msleep(500); |
958 | 964 | ||
959 | if (!retries) { | 965 | } while (--retries); |
960 | pegtune_val = NXRD32(adapter, | ||
961 | NETXEN_ROMUSB_GLB_PEGTUNE_DONE); | ||
962 | printk(KERN_WARNING "netxen_phantom_init: init failed, " | ||
963 | "pegtune_val=%x\n", pegtune_val); | ||
964 | return -1; | ||
965 | } | ||
966 | } | ||
967 | 966 | ||
968 | return 0; | 967 | NXWR32(adapter, CRB_CMDPEG_STATE, PHAN_INITIALIZE_FAILED); |
968 | |||
969 | out_err: | ||
970 | dev_warn(&adapter->pdev->dev, "firmware init failed\n"); | ||
971 | return -EIO; | ||
969 | } | 972 | } |
970 | 973 | ||
971 | static int | 974 | static int |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 71daa3d5f114..2919a2d12bf4 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -705,7 +705,7 @@ netxen_start_firmware(struct netxen_adapter *adapter, int request_fw) | |||
705 | first_driver = (adapter->ahw.pci_func == 0); | 705 | first_driver = (adapter->ahw.pci_func == 0); |
706 | 706 | ||
707 | if (!first_driver) | 707 | if (!first_driver) |
708 | return 0; | 708 | goto wait_init; |
709 | 709 | ||
710 | first_boot = NXRD32(adapter, NETXEN_CAM_RAM(0x1fc)); | 710 | first_boot = NXRD32(adapter, NETXEN_CAM_RAM(0x1fc)); |
711 | 711 | ||
@@ -752,6 +752,7 @@ netxen_start_firmware(struct netxen_adapter *adapter, int request_fw) | |||
752 | | (_NETXEN_NIC_LINUX_SUBVERSION); | 752 | | (_NETXEN_NIC_LINUX_SUBVERSION); |
753 | NXWR32(adapter, CRB_DRIVER_VERSION, val); | 753 | NXWR32(adapter, CRB_DRIVER_VERSION, val); |
754 | 754 | ||
755 | wait_init: | ||
755 | /* Handshake with the card before we register the devices. */ | 756 | /* Handshake with the card before we register the devices. */ |
756 | err = netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE); | 757 | err = netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE); |
757 | if (err) { | 758 | if (err) { |
@@ -1178,6 +1179,7 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev) | |||
1178 | free_netdev(netdev); | 1179 | free_netdev(netdev); |
1179 | } | 1180 | } |
1180 | 1181 | ||
1182 | #ifdef CONFIG_PM | ||
1181 | static int | 1183 | static int |
1182 | netxen_nic_suspend(struct pci_dev *pdev, pm_message_t state) | 1184 | netxen_nic_suspend(struct pci_dev *pdev, pm_message_t state) |
1183 | { | 1185 | { |
@@ -1242,6 +1244,7 @@ netxen_nic_resume(struct pci_dev *pdev) | |||
1242 | 1244 | ||
1243 | return 0; | 1245 | return 0; |
1244 | } | 1246 | } |
1247 | #endif | ||
1245 | 1248 | ||
1246 | static int netxen_nic_open(struct net_device *netdev) | 1249 | static int netxen_nic_open(struct net_device *netdev) |
1247 | { | 1250 | { |
@@ -1771,8 +1774,10 @@ static struct pci_driver netxen_driver = { | |||
1771 | .id_table = netxen_pci_tbl, | 1774 | .id_table = netxen_pci_tbl, |
1772 | .probe = netxen_nic_probe, | 1775 | .probe = netxen_nic_probe, |
1773 | .remove = __devexit_p(netxen_nic_remove), | 1776 | .remove = __devexit_p(netxen_nic_remove), |
1777 | #ifdef CONFIG_PM | ||
1774 | .suspend = netxen_nic_suspend, | 1778 | .suspend = netxen_nic_suspend, |
1775 | .resume = netxen_nic_resume | 1779 | .resume = netxen_nic_resume |
1780 | #endif | ||
1776 | }; | 1781 | }; |
1777 | 1782 | ||
1778 | /* Driver Registration on NetXen card */ | 1783 | /* Driver Registration on NetXen card */ |
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index bbc6d4d3cc94..3e4b67aaa6ea 100644 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c | |||
@@ -3142,6 +3142,7 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev) | |||
3142 | (void __iomem *)port_regs; | 3142 | (void __iomem *)port_regs; |
3143 | u32 delay = 10; | 3143 | u32 delay = 10; |
3144 | int status = 0; | 3144 | int status = 0; |
3145 | unsigned long hw_flags = 0; | ||
3145 | 3146 | ||
3146 | if(ql_mii_setup(qdev)) | 3147 | if(ql_mii_setup(qdev)) |
3147 | return -1; | 3148 | return -1; |
@@ -3150,7 +3151,8 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev) | |||
3150 | ql_write_common_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg, | 3151 | ql_write_common_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg, |
3151 | (ISP_SERIAL_PORT_IF_WE | | 3152 | (ISP_SERIAL_PORT_IF_WE | |
3152 | (ISP_SERIAL_PORT_IF_WE << 16))); | 3153 | (ISP_SERIAL_PORT_IF_WE << 16))); |
3153 | 3154 | /* Give the PHY time to come out of reset. */ | |
3155 | mdelay(100); | ||
3154 | qdev->port_link_state = LS_DOWN; | 3156 | qdev->port_link_state = LS_DOWN; |
3155 | netif_carrier_off(qdev->ndev); | 3157 | netif_carrier_off(qdev->ndev); |
3156 | 3158 | ||
@@ -3350,7 +3352,9 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev) | |||
3350 | value = ql_read_page0_reg(qdev, &port_regs->portStatus); | 3352 | value = ql_read_page0_reg(qdev, &port_regs->portStatus); |
3351 | if (value & PORT_STATUS_IC) | 3353 | if (value & PORT_STATUS_IC) |
3352 | break; | 3354 | break; |
3355 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); | ||
3353 | msleep(500); | 3356 | msleep(500); |
3357 | spin_lock_irqsave(&qdev->hw_lock, hw_flags); | ||
3354 | } while (--delay); | 3358 | } while (--delay); |
3355 | 3359 | ||
3356 | if (delay == 0) { | 3360 | if (delay == 0) { |
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h index 10d701eec484..b6a85183c333 100644 --- a/include/linux/icmpv6.h +++ b/include/linux/icmpv6.h | |||
@@ -175,16 +175,16 @@ struct icmp6_filter { | |||
175 | 175 | ||
176 | 176 | ||
177 | extern void icmpv6_send(struct sk_buff *skb, | 177 | extern void icmpv6_send(struct sk_buff *skb, |
178 | int type, int code, | 178 | u8 type, u8 code, |
179 | __u32 info, | 179 | __u32 info, |
180 | struct net_device *dev); | 180 | struct net_device *dev); |
181 | 181 | ||
182 | extern int icmpv6_init(void); | 182 | extern int icmpv6_init(void); |
183 | extern int icmpv6_err_convert(int type, int code, | 183 | extern int icmpv6_err_convert(u8 type, u8 code, |
184 | int *err); | 184 | int *err); |
185 | extern void icmpv6_cleanup(void); | 185 | extern void icmpv6_cleanup(void); |
186 | extern void icmpv6_param_prob(struct sk_buff *skb, | 186 | extern void icmpv6_param_prob(struct sk_buff *skb, |
187 | int code, int pos); | 187 | u8 code, int pos); |
188 | 188 | ||
189 | struct flowi; | 189 | struct flowi; |
190 | struct in6_addr; | 190 | struct in6_addr; |
diff --git a/include/net/protocol.h b/include/net/protocol.h index ffa5b8b1f1df..1089d5aabd49 100644 --- a/include/net/protocol.h +++ b/include/net/protocol.h | |||
@@ -53,7 +53,7 @@ struct inet6_protocol | |||
53 | 53 | ||
54 | void (*err_handler)(struct sk_buff *skb, | 54 | void (*err_handler)(struct sk_buff *skb, |
55 | struct inet6_skb_parm *opt, | 55 | struct inet6_skb_parm *opt, |
56 | int type, int code, int offset, | 56 | u8 type, u8 code, int offset, |
57 | __be32 info); | 57 | __be32 info); |
58 | 58 | ||
59 | int (*gso_send_check)(struct sk_buff *skb); | 59 | int (*gso_send_check)(struct sk_buff *skb); |
diff --git a/include/net/rawv6.h b/include/net/rawv6.h index 8a22599f26ba..f6b9b830df8c 100644 --- a/include/net/rawv6.h +++ b/include/net/rawv6.h | |||
@@ -6,7 +6,7 @@ | |||
6 | #include <net/protocol.h> | 6 | #include <net/protocol.h> |
7 | 7 | ||
8 | void raw6_icmp_error(struct sk_buff *, int nexthdr, | 8 | void raw6_icmp_error(struct sk_buff *, int nexthdr, |
9 | int type, int code, int inner_offset, __be32); | 9 | u8 type, u8 code, int inner_offset, __be32); |
10 | int raw6_local_deliver(struct sk_buff *, int); | 10 | int raw6_local_deliver(struct sk_buff *, int); |
11 | 11 | ||
12 | extern int rawv6_rcv(struct sock *sk, | 12 | extern int rawv6_rcv(struct sock *sk, |
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 9f80a7668289..d16a304cbed4 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -448,6 +448,7 @@ static inline void sctp_skb_set_owner_r(struct sk_buff *skb, struct sock *sk) | |||
448 | { | 448 | { |
449 | struct sctp_ulpevent *event = sctp_skb2event(skb); | 449 | struct sctp_ulpevent *event = sctp_skb2event(skb); |
450 | 450 | ||
451 | skb_orphan(skb); | ||
451 | skb->sk = sk; | 452 | skb->sk = sk; |
452 | skb->destructor = sctp_sock_rfree; | 453 | skb->destructor = sctp_sock_rfree; |
453 | atomic_add(event->rmem_len, &sk->sk_rmem_alloc); | 454 | atomic_add(event->rmem_len, &sk->sk_rmem_alloc); |
diff --git a/include/net/sock.h b/include/net/sock.h index 07133c5e9868..352f06bbd7a9 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -1252,6 +1252,7 @@ static inline int sk_has_allocations(const struct sock *sk) | |||
1252 | 1252 | ||
1253 | static inline void skb_set_owner_w(struct sk_buff *skb, struct sock *sk) | 1253 | static inline void skb_set_owner_w(struct sk_buff *skb, struct sock *sk) |
1254 | { | 1254 | { |
1255 | skb_orphan(skb); | ||
1255 | skb->sk = sk; | 1256 | skb->sk = sk; |
1256 | skb->destructor = sock_wfree; | 1257 | skb->destructor = sock_wfree; |
1257 | /* | 1258 | /* |
@@ -1264,6 +1265,7 @@ static inline void skb_set_owner_w(struct sk_buff *skb, struct sock *sk) | |||
1264 | 1265 | ||
1265 | static inline void skb_set_owner_r(struct sk_buff *skb, struct sock *sk) | 1266 | static inline void skb_set_owner_r(struct sk_buff *skb, struct sock *sk) |
1266 | { | 1267 | { |
1268 | skb_orphan(skb); | ||
1267 | skb->sk = sk; | 1269 | skb->sk = sk; |
1268 | skb->destructor = sock_rfree; | 1270 | skb->destructor = sock_rfree; |
1269 | atomic_add(skb->truesize, &sk->sk_rmem_alloc); | 1271 | atomic_add(skb->truesize, &sk->sk_rmem_alloc); |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 736bca450886..9e3a3f4c1f60 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -1274,7 +1274,7 @@ struct xfrm_tunnel { | |||
1274 | struct xfrm6_tunnel { | 1274 | struct xfrm6_tunnel { |
1275 | int (*handler)(struct sk_buff *skb); | 1275 | int (*handler)(struct sk_buff *skb); |
1276 | int (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt, | 1276 | int (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt, |
1277 | int type, int code, int offset, __be32 info); | 1277 | u8 type, u8 code, int offset, __be32 info); |
1278 | struct xfrm6_tunnel *next; | 1278 | struct xfrm6_tunnel *next; |
1279 | int priority; | 1279 | int priority; |
1280 | }; | 1280 | }; |
diff --git a/net/ax25/ax25_in.c b/net/ax25/ax25_in.c index 5f1d2107a1dd..de56d3983de0 100644 --- a/net/ax25/ax25_in.c +++ b/net/ax25/ax25_in.c | |||
@@ -437,8 +437,7 @@ free: | |||
437 | int ax25_kiss_rcv(struct sk_buff *skb, struct net_device *dev, | 437 | int ax25_kiss_rcv(struct sk_buff *skb, struct net_device *dev, |
438 | struct packet_type *ptype, struct net_device *orig_dev) | 438 | struct packet_type *ptype, struct net_device *orig_dev) |
439 | { | 439 | { |
440 | skb->sk = NULL; /* Initially we don't know who it's for */ | 440 | skb_orphan(skb); |
441 | skb->destructor = NULL; /* Who initializes this, dammit?! */ | ||
442 | 441 | ||
443 | if (!net_eq(dev_net(dev), &init_net)) { | 442 | if (!net_eq(dev_net(dev), &init_net)) { |
444 | kfree_skb(skb); | 443 | kfree_skb(skb); |
diff --git a/net/core/dev.c b/net/core/dev.c index baf2dc13a34a..60b572812278 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2310,8 +2310,6 @@ ncls: | |||
2310 | if (!skb) | 2310 | if (!skb) |
2311 | goto out; | 2311 | goto out; |
2312 | 2312 | ||
2313 | skb_orphan(skb); | ||
2314 | |||
2315 | type = skb->protocol; | 2313 | type = skb->protocol; |
2316 | list_for_each_entry_rcu(ptype, | 2314 | list_for_each_entry_rcu(ptype, |
2317 | &ptype_base[ntohs(type) & PTYPE_HASH_MASK], list) { | 2315 | &ptype_base[ntohs(type) & PTYPE_HASH_MASK], list) { |
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index 05ea7440d9e5..3e70faab2989 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c | |||
@@ -85,7 +85,7 @@ static inline __u32 dccp_v6_init_sequence(struct sk_buff *skb) | |||
85 | } | 85 | } |
86 | 86 | ||
87 | static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | 87 | static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, |
88 | int type, int code, int offset, __be32 info) | 88 | u8 type, u8 code, int offset, __be32 info) |
89 | { | 89 | { |
90 | struct ipv6hdr *hdr = (struct ipv6hdr *)skb->data; | 90 | struct ipv6hdr *hdr = (struct ipv6hdr *)skb->data; |
91 | const struct dccp_hdr *dh = (struct dccp_hdr *)(skb->data + offset); | 91 | const struct dccp_hdr *dh = (struct dccp_hdr *)(skb->data + offset); |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 65b3a8b11a6c..278f46f5011b 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -1093,8 +1093,27 @@ restart: | |||
1093 | * If we drop it here, the callers have no way to resolve routes | 1093 | * If we drop it here, the callers have no way to resolve routes |
1094 | * when we're not caching. Instead, just point *rp at rt, so | 1094 | * when we're not caching. Instead, just point *rp at rt, so |
1095 | * the caller gets a single use out of the route | 1095 | * the caller gets a single use out of the route |
1096 | * Note that we do rt_free on this new route entry, so that | ||
1097 | * once its refcount hits zero, we are still able to reap it | ||
1098 | * (Thanks Alexey) | ||
1099 | * Note also the rt_free uses call_rcu. We don't actually | ||
1100 | * need rcu protection here, this is just our path to get | ||
1101 | * on the route gc list. | ||
1096 | */ | 1102 | */ |
1097 | goto report_and_exit; | 1103 | |
1104 | if (rt->rt_type == RTN_UNICAST || rt->fl.iif == 0) { | ||
1105 | int err = arp_bind_neighbour(&rt->u.dst); | ||
1106 | if (err) { | ||
1107 | if (net_ratelimit()) | ||
1108 | printk(KERN_WARNING | ||
1109 | "Neighbour table failure & not caching routes.\n"); | ||
1110 | rt_drop(rt); | ||
1111 | return err; | ||
1112 | } | ||
1113 | } | ||
1114 | |||
1115 | rt_free(rt); | ||
1116 | goto skip_hashing; | ||
1098 | } | 1117 | } |
1099 | 1118 | ||
1100 | rthp = &rt_hash_table[hash].chain; | 1119 | rthp = &rt_hash_table[hash].chain; |
@@ -1211,7 +1230,8 @@ restart: | |||
1211 | #if RT_CACHE_DEBUG >= 2 | 1230 | #if RT_CACHE_DEBUG >= 2 |
1212 | if (rt->u.dst.rt_next) { | 1231 | if (rt->u.dst.rt_next) { |
1213 | struct rtable *trt; | 1232 | struct rtable *trt; |
1214 | printk(KERN_DEBUG "rt_cache @%02x: %pI4", hash, &rt->rt_dst); | 1233 | printk(KERN_DEBUG "rt_cache @%02x: %pI4", |
1234 | hash, &rt->rt_dst); | ||
1215 | for (trt = rt->u.dst.rt_next; trt; trt = trt->u.dst.rt_next) | 1235 | for (trt = rt->u.dst.rt_next; trt; trt = trt->u.dst.rt_next) |
1216 | printk(" . %pI4", &trt->rt_dst); | 1236 | printk(" . %pI4", &trt->rt_dst); |
1217 | printk("\n"); | 1237 | printk("\n"); |
@@ -1226,7 +1246,7 @@ restart: | |||
1226 | 1246 | ||
1227 | spin_unlock_bh(rt_hash_lock_addr(hash)); | 1247 | spin_unlock_bh(rt_hash_lock_addr(hash)); |
1228 | 1248 | ||
1229 | report_and_exit: | 1249 | skip_hashing: |
1230 | if (rp) | 1250 | if (rp) |
1231 | *rp = rt; | 1251 | *rp = rt; |
1232 | else | 1252 | else |
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c index 52449f7a1b71..86f42a288c4b 100644 --- a/net/ipv6/ah6.c +++ b/net/ipv6/ah6.c | |||
@@ -405,7 +405,7 @@ out: | |||
405 | } | 405 | } |
406 | 406 | ||
407 | static void ah6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | 407 | static void ah6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, |
408 | int type, int code, int offset, __be32 info) | 408 | u8 type, u8 code, int offset, __be32 info) |
409 | { | 409 | { |
410 | struct net *net = dev_net(skb->dev); | 410 | struct net *net = dev_net(skb->dev); |
411 | struct ipv6hdr *iph = (struct ipv6hdr*)skb->data; | 411 | struct ipv6hdr *iph = (struct ipv6hdr*)skb->data; |
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c index c2f250150db1..678bb95b1525 100644 --- a/net/ipv6/esp6.c +++ b/net/ipv6/esp6.c | |||
@@ -354,7 +354,7 @@ static u32 esp6_get_mtu(struct xfrm_state *x, int mtu) | |||
354 | } | 354 | } |
355 | 355 | ||
356 | static void esp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | 356 | static void esp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, |
357 | int type, int code, int offset, __be32 info) | 357 | u8 type, u8 code, int offset, __be32 info) |
358 | { | 358 | { |
359 | struct net *net = dev_net(skb->dev); | 359 | struct net *net = dev_net(skb->dev); |
360 | struct ipv6hdr *iph = (struct ipv6hdr*)skb->data; | 360 | struct ipv6hdr *iph = (struct ipv6hdr*)skb->data; |
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index 36dff8807183..eab62a7a8f06 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c | |||
@@ -117,7 +117,7 @@ static __inline__ void icmpv6_xmit_unlock(struct sock *sk) | |||
117 | /* | 117 | /* |
118 | * Slightly more convenient version of icmpv6_send. | 118 | * Slightly more convenient version of icmpv6_send. |
119 | */ | 119 | */ |
120 | void icmpv6_param_prob(struct sk_buff *skb, int code, int pos) | 120 | void icmpv6_param_prob(struct sk_buff *skb, u8 code, int pos) |
121 | { | 121 | { |
122 | icmpv6_send(skb, ICMPV6_PARAMPROB, code, pos, skb->dev); | 122 | icmpv6_send(skb, ICMPV6_PARAMPROB, code, pos, skb->dev); |
123 | kfree_skb(skb); | 123 | kfree_skb(skb); |
@@ -161,7 +161,7 @@ static int is_ineligible(struct sk_buff *skb) | |||
161 | /* | 161 | /* |
162 | * Check the ICMP output rate limit | 162 | * Check the ICMP output rate limit |
163 | */ | 163 | */ |
164 | static inline int icmpv6_xrlim_allow(struct sock *sk, int type, | 164 | static inline int icmpv6_xrlim_allow(struct sock *sk, u8 type, |
165 | struct flowi *fl) | 165 | struct flowi *fl) |
166 | { | 166 | { |
167 | struct dst_entry *dst; | 167 | struct dst_entry *dst; |
@@ -305,7 +305,7 @@ static inline void mip6_addr_swap(struct sk_buff *skb) {} | |||
305 | /* | 305 | /* |
306 | * Send an ICMP message in response to a packet in error | 306 | * Send an ICMP message in response to a packet in error |
307 | */ | 307 | */ |
308 | void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info, | 308 | void icmpv6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info, |
309 | struct net_device *dev) | 309 | struct net_device *dev) |
310 | { | 310 | { |
311 | struct net *net = dev_net(skb->dev); | 311 | struct net *net = dev_net(skb->dev); |
@@ -590,7 +590,7 @@ out: | |||
590 | icmpv6_xmit_unlock(sk); | 590 | icmpv6_xmit_unlock(sk); |
591 | } | 591 | } |
592 | 592 | ||
593 | static void icmpv6_notify(struct sk_buff *skb, int type, int code, __be32 info) | 593 | static void icmpv6_notify(struct sk_buff *skb, u8 type, u8 code, __be32 info) |
594 | { | 594 | { |
595 | struct inet6_protocol *ipprot; | 595 | struct inet6_protocol *ipprot; |
596 | int inner_offset; | 596 | int inner_offset; |
@@ -643,7 +643,7 @@ static int icmpv6_rcv(struct sk_buff *skb) | |||
643 | struct in6_addr *saddr, *daddr; | 643 | struct in6_addr *saddr, *daddr; |
644 | struct ipv6hdr *orig_hdr; | 644 | struct ipv6hdr *orig_hdr; |
645 | struct icmp6hdr *hdr; | 645 | struct icmp6hdr *hdr; |
646 | int type; | 646 | u8 type; |
647 | 647 | ||
648 | if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) { | 648 | if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) { |
649 | struct sec_path *sp = skb_sec_path(skb); | 649 | struct sec_path *sp = skb_sec_path(skb); |
@@ -914,7 +914,7 @@ static const struct icmp6_err { | |||
914 | }, | 914 | }, |
915 | }; | 915 | }; |
916 | 916 | ||
917 | int icmpv6_err_convert(int type, int code, int *err) | 917 | int icmpv6_err_convert(u8 type, u8 code, int *err) |
918 | { | 918 | { |
919 | int fatal = 0; | 919 | int fatal = 0; |
920 | 920 | ||
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index 404d16a97d5c..51f410e7775a 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c | |||
@@ -394,13 +394,13 @@ parse_tlv_tnl_enc_lim(struct sk_buff *skb, __u8 * raw) | |||
394 | 394 | ||
395 | static int | 395 | static int |
396 | ip6_tnl_err(struct sk_buff *skb, __u8 ipproto, struct inet6_skb_parm *opt, | 396 | ip6_tnl_err(struct sk_buff *skb, __u8 ipproto, struct inet6_skb_parm *opt, |
397 | int *type, int *code, int *msg, __u32 *info, int offset) | 397 | u8 *type, u8 *code, int *msg, __u32 *info, int offset) |
398 | { | 398 | { |
399 | struct ipv6hdr *ipv6h = (struct ipv6hdr *) skb->data; | 399 | struct ipv6hdr *ipv6h = (struct ipv6hdr *) skb->data; |
400 | struct ip6_tnl *t; | 400 | struct ip6_tnl *t; |
401 | int rel_msg = 0; | 401 | int rel_msg = 0; |
402 | int rel_type = ICMPV6_DEST_UNREACH; | 402 | u8 rel_type = ICMPV6_DEST_UNREACH; |
403 | int rel_code = ICMPV6_ADDR_UNREACH; | 403 | u8 rel_code = ICMPV6_ADDR_UNREACH; |
404 | __u32 rel_info = 0; | 404 | __u32 rel_info = 0; |
405 | __u16 len; | 405 | __u16 len; |
406 | int err = -ENOENT; | 406 | int err = -ENOENT; |
@@ -488,11 +488,11 @@ out: | |||
488 | 488 | ||
489 | static int | 489 | static int |
490 | ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | 490 | ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, |
491 | int type, int code, int offset, __be32 info) | 491 | u8 type, u8 code, int offset, __be32 info) |
492 | { | 492 | { |
493 | int rel_msg = 0; | 493 | int rel_msg = 0; |
494 | int rel_type = type; | 494 | u8 rel_type = type; |
495 | int rel_code = code; | 495 | u8 rel_code = code; |
496 | __u32 rel_info = ntohl(info); | 496 | __u32 rel_info = ntohl(info); |
497 | int err; | 497 | int err; |
498 | struct sk_buff *skb2; | 498 | struct sk_buff *skb2; |
@@ -586,11 +586,11 @@ out: | |||
586 | 586 | ||
587 | static int | 587 | static int |
588 | ip6ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | 588 | ip6ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, |
589 | int type, int code, int offset, __be32 info) | 589 | u8 type, u8 code, int offset, __be32 info) |
590 | { | 590 | { |
591 | int rel_msg = 0; | 591 | int rel_msg = 0; |
592 | int rel_type = type; | 592 | u8 rel_type = type; |
593 | int rel_code = code; | 593 | u8 rel_code = code; |
594 | __u32 rel_info = ntohl(info); | 594 | __u32 rel_info = ntohl(info); |
595 | int err; | 595 | int err; |
596 | 596 | ||
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c index 3a0b3be7ece5..79c172f1ff01 100644 --- a/net/ipv6/ipcomp6.c +++ b/net/ipv6/ipcomp6.c | |||
@@ -51,7 +51,7 @@ | |||
51 | #include <linux/mutex.h> | 51 | #include <linux/mutex.h> |
52 | 52 | ||
53 | static void ipcomp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | 53 | static void ipcomp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, |
54 | int type, int code, int offset, __be32 info) | 54 | u8 type, u8 code, int offset, __be32 info) |
55 | { | 55 | { |
56 | __be32 spi; | 56 | __be32 spi; |
57 | struct ipv6hdr *iph = (struct ipv6hdr*)skb->data; | 57 | struct ipv6hdr *iph = (struct ipv6hdr*)skb->data; |
diff --git a/net/ipv6/mip6.c b/net/ipv6/mip6.c index f995e19c87a9..f797e8c6f3b3 100644 --- a/net/ipv6/mip6.c +++ b/net/ipv6/mip6.c | |||
@@ -54,7 +54,7 @@ static inline void *mip6_padn(__u8 *data, __u8 padlen) | |||
54 | return data + padlen; | 54 | return data + padlen; |
55 | } | 55 | } |
56 | 56 | ||
57 | static inline void mip6_param_prob(struct sk_buff *skb, int code, int pos) | 57 | static inline void mip6_param_prob(struct sk_buff *skb, u8 code, int pos) |
58 | { | 58 | { |
59 | icmpv6_send(skb, ICMPV6_PARAMPROB, code, pos, skb->dev); | 59 | icmpv6_send(skb, ICMPV6_PARAMPROB, code, pos, skb->dev); |
60 | } | 60 | } |
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index 8b0b6f948063..d6c3c1c34b2d 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -310,7 +310,7 @@ out: | |||
310 | 310 | ||
311 | static void rawv6_err(struct sock *sk, struct sk_buff *skb, | 311 | static void rawv6_err(struct sock *sk, struct sk_buff *skb, |
312 | struct inet6_skb_parm *opt, | 312 | struct inet6_skb_parm *opt, |
313 | int type, int code, int offset, __be32 info) | 313 | u8 type, u8 code, int offset, __be32 info) |
314 | { | 314 | { |
315 | struct inet_sock *inet = inet_sk(sk); | 315 | struct inet_sock *inet = inet_sk(sk); |
316 | struct ipv6_pinfo *np = inet6_sk(sk); | 316 | struct ipv6_pinfo *np = inet6_sk(sk); |
@@ -343,7 +343,7 @@ static void rawv6_err(struct sock *sk, struct sk_buff *skb, | |||
343 | } | 343 | } |
344 | 344 | ||
345 | void raw6_icmp_error(struct sk_buff *skb, int nexthdr, | 345 | void raw6_icmp_error(struct sk_buff *skb, int nexthdr, |
346 | int type, int code, int inner_offset, __be32 info) | 346 | u8 type, u8 code, int inner_offset, __be32 info) |
347 | { | 347 | { |
348 | struct sock *sk; | 348 | struct sock *sk; |
349 | int hash; | 349 | int hash; |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 658293ea05ba..1473ee0a1f51 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -1865,7 +1865,7 @@ int ipv6_route_ioctl(struct net *net, unsigned int cmd, void __user *arg) | |||
1865 | * Drop the packet on the floor | 1865 | * Drop the packet on the floor |
1866 | */ | 1866 | */ |
1867 | 1867 | ||
1868 | static int ip6_pkt_drop(struct sk_buff *skb, int code, int ipstats_mib_noroutes) | 1868 | static int ip6_pkt_drop(struct sk_buff *skb, u8 code, int ipstats_mib_noroutes) |
1869 | { | 1869 | { |
1870 | int type; | 1870 | int type; |
1871 | struct dst_entry *dst = skb_dst(skb); | 1871 | struct dst_entry *dst = skb_dst(skb); |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 53b6a4192b16..58810c65b635 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -317,7 +317,7 @@ failure: | |||
317 | } | 317 | } |
318 | 318 | ||
319 | static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | 319 | static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, |
320 | int type, int code, int offset, __be32 info) | 320 | u8 type, u8 code, int offset, __be32 info) |
321 | { | 321 | { |
322 | struct ipv6hdr *hdr = (struct ipv6hdr*)skb->data; | 322 | struct ipv6hdr *hdr = (struct ipv6hdr*)skb->data; |
323 | const struct tcphdr *th = (struct tcphdr *)(skb->data+offset); | 323 | const struct tcphdr *th = (struct tcphdr *)(skb->data+offset); |
diff --git a/net/ipv6/tunnel6.c b/net/ipv6/tunnel6.c index 669f280989c3..633ad789effc 100644 --- a/net/ipv6/tunnel6.c +++ b/net/ipv6/tunnel6.c | |||
@@ -124,7 +124,7 @@ drop: | |||
124 | } | 124 | } |
125 | 125 | ||
126 | static void tunnel6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | 126 | static void tunnel6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, |
127 | int type, int code, int offset, __be32 info) | 127 | u8 type, u8 code, int offset, __be32 info) |
128 | { | 128 | { |
129 | struct xfrm6_tunnel *handler; | 129 | struct xfrm6_tunnel *handler; |
130 | 130 | ||
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 023beda6b224..33b59bd92c4d 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -312,7 +312,7 @@ csum_copy_err: | |||
312 | } | 312 | } |
313 | 313 | ||
314 | void __udp6_lib_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | 314 | void __udp6_lib_err(struct sk_buff *skb, struct inet6_skb_parm *opt, |
315 | int type, int code, int offset, __be32 info, | 315 | u8 type, u8 code, int offset, __be32 info, |
316 | struct udp_table *udptable) | 316 | struct udp_table *udptable) |
317 | { | 317 | { |
318 | struct ipv6_pinfo *np; | 318 | struct ipv6_pinfo *np; |
@@ -346,8 +346,8 @@ out: | |||
346 | } | 346 | } |
347 | 347 | ||
348 | static __inline__ void udpv6_err(struct sk_buff *skb, | 348 | static __inline__ void udpv6_err(struct sk_buff *skb, |
349 | struct inet6_skb_parm *opt, int type, | 349 | struct inet6_skb_parm *opt, u8 type, |
350 | int code, int offset, __be32 info ) | 350 | u8 code, int offset, __be32 info ) |
351 | { | 351 | { |
352 | __udp6_lib_err(skb, opt, type, code, offset, info, &udp_table); | 352 | __udp6_lib_err(skb, opt, type, code, offset, info, &udp_table); |
353 | } | 353 | } |
diff --git a/net/ipv6/udp_impl.h b/net/ipv6/udp_impl.h index 23779208c334..6bb303471e20 100644 --- a/net/ipv6/udp_impl.h +++ b/net/ipv6/udp_impl.h | |||
@@ -9,7 +9,7 @@ | |||
9 | 9 | ||
10 | extern int __udp6_lib_rcv(struct sk_buff *, struct udp_table *, int ); | 10 | extern int __udp6_lib_rcv(struct sk_buff *, struct udp_table *, int ); |
11 | extern void __udp6_lib_err(struct sk_buff *, struct inet6_skb_parm *, | 11 | extern void __udp6_lib_err(struct sk_buff *, struct inet6_skb_parm *, |
12 | int , int , int , __be32 , struct udp_table *); | 12 | u8 , u8 , int , __be32 , struct udp_table *); |
13 | 13 | ||
14 | extern int udp_v6_get_port(struct sock *sk, unsigned short snum); | 14 | extern int udp_v6_get_port(struct sock *sk, unsigned short snum); |
15 | 15 | ||
diff --git a/net/ipv6/udplite.c b/net/ipv6/udplite.c index ba162a824585..4818c48688f2 100644 --- a/net/ipv6/udplite.c +++ b/net/ipv6/udplite.c | |||
@@ -20,7 +20,7 @@ static int udplitev6_rcv(struct sk_buff *skb) | |||
20 | 20 | ||
21 | static void udplitev6_err(struct sk_buff *skb, | 21 | static void udplitev6_err(struct sk_buff *skb, |
22 | struct inet6_skb_parm *opt, | 22 | struct inet6_skb_parm *opt, |
23 | int type, int code, int offset, __be32 info) | 23 | u8 type, u8 code, int offset, __be32 info) |
24 | { | 24 | { |
25 | __udp6_lib_err(skb, opt, type, code, offset, info, &udplite_table); | 25 | __udp6_lib_err(skb, opt, type, code, offset, info, &udplite_table); |
26 | } | 26 | } |
diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c index 80193db224d9..81a95c00e503 100644 --- a/net/ipv6/xfrm6_tunnel.c +++ b/net/ipv6/xfrm6_tunnel.c | |||
@@ -262,7 +262,7 @@ static int xfrm6_tunnel_rcv(struct sk_buff *skb) | |||
262 | } | 262 | } |
263 | 263 | ||
264 | static int xfrm6_tunnel_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | 264 | static int xfrm6_tunnel_err(struct sk_buff *skb, struct inet6_skb_parm *opt, |
265 | int type, int code, int offset, __be32 info) | 265 | u8 type, u8 code, int offset, __be32 info) |
266 | { | 266 | { |
267 | /* xfrm6_tunnel native err handling */ | 267 | /* xfrm6_tunnel native err handling */ |
268 | switch (type) { | 268 | switch (type) { |
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index 5922febe25c4..cb762c8723ea 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c | |||
@@ -913,9 +913,6 @@ static int irda_accept(struct socket *sock, struct socket *newsock, int flags) | |||
913 | /* Clean up the original one to keep it in listen state */ | 913 | /* Clean up the original one to keep it in listen state */ |
914 | irttp_listen(self->tsap); | 914 | irttp_listen(self->tsap); |
915 | 915 | ||
916 | /* Wow ! What is that ? Jean II */ | ||
917 | skb->sk = NULL; | ||
918 | skb->destructor = NULL; | ||
919 | kfree_skb(skb); | 916 | kfree_skb(skb); |
920 | sk->sk_ack_backlog--; | 917 | sk->sk_ack_backlog--; |
921 | 918 | ||
diff --git a/net/irda/ircomm/ircomm_lmp.c b/net/irda/ircomm/ircomm_lmp.c index 67c99d20857f..7ba96618660e 100644 --- a/net/irda/ircomm/ircomm_lmp.c +++ b/net/irda/ircomm/ircomm_lmp.c | |||
@@ -196,6 +196,7 @@ static int ircomm_lmp_data_request(struct ircomm_cb *self, | |||
196 | /* Don't forget to refcount it - see ircomm_tty_do_softint() */ | 196 | /* Don't forget to refcount it - see ircomm_tty_do_softint() */ |
197 | skb_get(skb); | 197 | skb_get(skb); |
198 | 198 | ||
199 | skb_orphan(skb); | ||
199 | skb->destructor = ircomm_lmp_flow_control; | 200 | skb->destructor = ircomm_lmp_flow_control; |
200 | 201 | ||
201 | if ((self->pkt_count++ > 7) && (self->flow_status == FLOW_START)) { | 202 | if ((self->pkt_count++ > 7) && (self->flow_status == FLOW_START)) { |
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index 5f72b94b4918..7508f11c5b39 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c | |||
@@ -335,7 +335,8 @@ begin: | |||
335 | h = __nf_conntrack_find(net, tuple); | 335 | h = __nf_conntrack_find(net, tuple); |
336 | if (h) { | 336 | if (h) { |
337 | ct = nf_ct_tuplehash_to_ctrack(h); | 337 | ct = nf_ct_tuplehash_to_ctrack(h); |
338 | if (unlikely(!atomic_inc_not_zero(&ct->ct_general.use))) | 338 | if (unlikely(nf_ct_is_dying(ct) || |
339 | !atomic_inc_not_zero(&ct->ct_general.use))) | ||
339 | h = NULL; | 340 | h = NULL; |
340 | else { | 341 | else { |
341 | if (unlikely(!nf_ct_tuple_equal(tuple, &h->tuple))) { | 342 | if (unlikely(!nf_ct_tuple_equal(tuple, &h->tuple))) { |
@@ -425,7 +426,6 @@ __nf_conntrack_confirm(struct sk_buff *skb) | |||
425 | /* Remove from unconfirmed list */ | 426 | /* Remove from unconfirmed list */ |
426 | hlist_nulls_del_rcu(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnnode); | 427 | hlist_nulls_del_rcu(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnnode); |
427 | 428 | ||
428 | __nf_conntrack_hash_insert(ct, hash, repl_hash); | ||
429 | /* Timer relative to confirmation time, not original | 429 | /* Timer relative to confirmation time, not original |
430 | setting time, otherwise we'd get timer wrap in | 430 | setting time, otherwise we'd get timer wrap in |
431 | weird delay cases. */ | 431 | weird delay cases. */ |
@@ -433,8 +433,16 @@ __nf_conntrack_confirm(struct sk_buff *skb) | |||
433 | add_timer(&ct->timeout); | 433 | add_timer(&ct->timeout); |
434 | atomic_inc(&ct->ct_general.use); | 434 | atomic_inc(&ct->ct_general.use); |
435 | set_bit(IPS_CONFIRMED_BIT, &ct->status); | 435 | set_bit(IPS_CONFIRMED_BIT, &ct->status); |
436 | |||
437 | /* Since the lookup is lockless, hash insertion must be done after | ||
438 | * starting the timer and setting the CONFIRMED bit. The RCU barriers | ||
439 | * guarantee that no other CPU can find the conntrack before the above | ||
440 | * stores are visible. | ||
441 | */ | ||
442 | __nf_conntrack_hash_insert(ct, hash, repl_hash); | ||
436 | NF_CT_STAT_INC(net, insert); | 443 | NF_CT_STAT_INC(net, insert); |
437 | spin_unlock_bh(&nf_conntrack_lock); | 444 | spin_unlock_bh(&nf_conntrack_lock); |
445 | |||
438 | help = nfct_help(ct); | 446 | help = nfct_help(ct); |
439 | if (help && help->helper) | 447 | if (help && help->helper) |
440 | nf_conntrack_event_cache(IPCT_HELPER, ct); | 448 | nf_conntrack_event_cache(IPCT_HELPER, ct); |
@@ -503,7 +511,8 @@ static noinline int early_drop(struct net *net, unsigned int hash) | |||
503 | cnt++; | 511 | cnt++; |
504 | } | 512 | } |
505 | 513 | ||
506 | if (ct && unlikely(!atomic_inc_not_zero(&ct->ct_general.use))) | 514 | if (ct && unlikely(nf_ct_is_dying(ct) || |
515 | !atomic_inc_not_zero(&ct->ct_general.use))) | ||
507 | ct = NULL; | 516 | ct = NULL; |
508 | if (ct || cnt >= NF_CT_EVICTION_RANGE) | 517 | if (ct || cnt >= NF_CT_EVICTION_RANGE) |
509 | break; | 518 | break; |
@@ -1267,13 +1276,19 @@ err_cache: | |||
1267 | return ret; | 1276 | return ret; |
1268 | } | 1277 | } |
1269 | 1278 | ||
1279 | /* | ||
1280 | * We need to use special "null" values, not used in hash table | ||
1281 | */ | ||
1282 | #define UNCONFIRMED_NULLS_VAL ((1<<30)+0) | ||
1283 | #define DYING_NULLS_VAL ((1<<30)+1) | ||
1284 | |||
1270 | static int nf_conntrack_init_net(struct net *net) | 1285 | static int nf_conntrack_init_net(struct net *net) |
1271 | { | 1286 | { |
1272 | int ret; | 1287 | int ret; |
1273 | 1288 | ||
1274 | atomic_set(&net->ct.count, 0); | 1289 | atomic_set(&net->ct.count, 0); |
1275 | INIT_HLIST_NULLS_HEAD(&net->ct.unconfirmed, 0); | 1290 | INIT_HLIST_NULLS_HEAD(&net->ct.unconfirmed, UNCONFIRMED_NULLS_VAL); |
1276 | INIT_HLIST_NULLS_HEAD(&net->ct.dying, 0); | 1291 | INIT_HLIST_NULLS_HEAD(&net->ct.dying, DYING_NULLS_VAL); |
1277 | net->ct.stat = alloc_percpu(struct ip_conntrack_stat); | 1292 | net->ct.stat = alloc_percpu(struct ip_conntrack_stat); |
1278 | if (!net->ct.stat) { | 1293 | if (!net->ct.stat) { |
1279 | ret = -ENOMEM; | 1294 | ret = -ENOMEM; |
diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c index 2fefe147750a..4e620305f28c 100644 --- a/net/netfilter/nf_log.c +++ b/net/netfilter/nf_log.c | |||
@@ -47,7 +47,6 @@ int nf_log_register(u_int8_t pf, struct nf_logger *logger) | |||
47 | mutex_lock(&nf_log_mutex); | 47 | mutex_lock(&nf_log_mutex); |
48 | 48 | ||
49 | if (pf == NFPROTO_UNSPEC) { | 49 | if (pf == NFPROTO_UNSPEC) { |
50 | int i; | ||
51 | for (i = NFPROTO_UNSPEC; i < NFPROTO_NUMPROTO; i++) | 50 | for (i = NFPROTO_UNSPEC; i < NFPROTO_NUMPROTO; i++) |
52 | list_add_tail(&(logger->list[i]), &(nf_loggers_l[i])); | 51 | list_add_tail(&(logger->list[i]), &(nf_loggers_l[i])); |
53 | } else { | 52 | } else { |
@@ -216,7 +215,7 @@ static const struct file_operations nflog_file_ops = { | |||
216 | #endif /* PROC_FS */ | 215 | #endif /* PROC_FS */ |
217 | 216 | ||
218 | #ifdef CONFIG_SYSCTL | 217 | #ifdef CONFIG_SYSCTL |
219 | struct ctl_path nf_log_sysctl_path[] = { | 218 | static struct ctl_path nf_log_sysctl_path[] = { |
220 | { .procname = "net", .ctl_name = CTL_NET, }, | 219 | { .procname = "net", .ctl_name = CTL_NET, }, |
221 | { .procname = "netfilter", .ctl_name = NET_NETFILTER, }, | 220 | { .procname = "netfilter", .ctl_name = NET_NETFILTER, }, |
222 | { .procname = "nf_log", .ctl_name = CTL_UNNUMBERED, }, | 221 | { .procname = "nf_log", .ctl_name = CTL_UNNUMBERED, }, |
@@ -228,19 +227,26 @@ static struct ctl_table nf_log_sysctl_table[NFPROTO_NUMPROTO+1]; | |||
228 | static struct ctl_table_header *nf_log_dir_header; | 227 | static struct ctl_table_header *nf_log_dir_header; |
229 | 228 | ||
230 | static int nf_log_proc_dostring(ctl_table *table, int write, struct file *filp, | 229 | static int nf_log_proc_dostring(ctl_table *table, int write, struct file *filp, |
231 | void *buffer, size_t *lenp, loff_t *ppos) | 230 | void __user *buffer, size_t *lenp, loff_t *ppos) |
232 | { | 231 | { |
233 | const struct nf_logger *logger; | 232 | const struct nf_logger *logger; |
233 | char buf[NFLOGGER_NAME_LEN]; | ||
234 | size_t size = *lenp; | ||
234 | int r = 0; | 235 | int r = 0; |
235 | int tindex = (unsigned long)table->extra1; | 236 | int tindex = (unsigned long)table->extra1; |
236 | 237 | ||
237 | if (write) { | 238 | if (write) { |
238 | if (!strcmp(buffer, "NONE")) { | 239 | if (size > sizeof(buf)) |
240 | size = sizeof(buf); | ||
241 | if (copy_from_user(buf, buffer, size)) | ||
242 | return -EFAULT; | ||
243 | |||
244 | if (!strcmp(buf, "NONE")) { | ||
239 | nf_log_unbind_pf(tindex); | 245 | nf_log_unbind_pf(tindex); |
240 | return 0; | 246 | return 0; |
241 | } | 247 | } |
242 | mutex_lock(&nf_log_mutex); | 248 | mutex_lock(&nf_log_mutex); |
243 | logger = __find_logger(tindex, buffer); | 249 | logger = __find_logger(tindex, buf); |
244 | if (logger == NULL) { | 250 | if (logger == NULL) { |
245 | mutex_unlock(&nf_log_mutex); | 251 | mutex_unlock(&nf_log_mutex); |
246 | return -ENOENT; | 252 | return -ENOENT; |
diff --git a/net/netfilter/xt_NFQUEUE.c b/net/netfilter/xt_NFQUEUE.c index 498b45101df7..f28f6a5fc02d 100644 --- a/net/netfilter/xt_NFQUEUE.c +++ b/net/netfilter/xt_NFQUEUE.c | |||
@@ -40,12 +40,12 @@ nfqueue_tg(struct sk_buff *skb, const struct xt_target_param *par) | |||
40 | static u32 hash_v4(const struct sk_buff *skb) | 40 | static u32 hash_v4(const struct sk_buff *skb) |
41 | { | 41 | { |
42 | const struct iphdr *iph = ip_hdr(skb); | 42 | const struct iphdr *iph = ip_hdr(skb); |
43 | u32 ipaddr; | 43 | __be32 ipaddr; |
44 | 44 | ||
45 | /* packets in either direction go into same queue */ | 45 | /* packets in either direction go into same queue */ |
46 | ipaddr = iph->saddr ^ iph->daddr; | 46 | ipaddr = iph->saddr ^ iph->daddr; |
47 | 47 | ||
48 | return jhash_2words(ipaddr, iph->protocol, jhash_initval); | 48 | return jhash_2words((__force u32)ipaddr, iph->protocol, jhash_initval); |
49 | } | 49 | } |
50 | 50 | ||
51 | static unsigned int | 51 | static unsigned int |
@@ -63,14 +63,14 @@ nfqueue_tg4_v1(struct sk_buff *skb, const struct xt_target_param *par) | |||
63 | static u32 hash_v6(const struct sk_buff *skb) | 63 | static u32 hash_v6(const struct sk_buff *skb) |
64 | { | 64 | { |
65 | const struct ipv6hdr *ip6h = ipv6_hdr(skb); | 65 | const struct ipv6hdr *ip6h = ipv6_hdr(skb); |
66 | u32 addr[4]; | 66 | __be32 addr[4]; |
67 | 67 | ||
68 | addr[0] = ip6h->saddr.s6_addr32[0] ^ ip6h->daddr.s6_addr32[0]; | 68 | addr[0] = ip6h->saddr.s6_addr32[0] ^ ip6h->daddr.s6_addr32[0]; |
69 | addr[1] = ip6h->saddr.s6_addr32[1] ^ ip6h->daddr.s6_addr32[1]; | 69 | addr[1] = ip6h->saddr.s6_addr32[1] ^ ip6h->daddr.s6_addr32[1]; |
70 | addr[2] = ip6h->saddr.s6_addr32[2] ^ ip6h->daddr.s6_addr32[2]; | 70 | addr[2] = ip6h->saddr.s6_addr32[2] ^ ip6h->daddr.s6_addr32[2]; |
71 | addr[3] = ip6h->saddr.s6_addr32[3] ^ ip6h->daddr.s6_addr32[3]; | 71 | addr[3] = ip6h->saddr.s6_addr32[3] ^ ip6h->daddr.s6_addr32[3]; |
72 | 72 | ||
73 | return jhash2(addr, ARRAY_SIZE(addr), jhash_initval); | 73 | return jhash2((__force u32 *)addr, ARRAY_SIZE(addr), jhash_initval); |
74 | } | 74 | } |
75 | 75 | ||
76 | static unsigned int | 76 | static unsigned int |
diff --git a/net/netfilter/xt_cluster.c b/net/netfilter/xt_cluster.c index 69a639f35403..225ee3ecd69d 100644 --- a/net/netfilter/xt_cluster.c +++ b/net/netfilter/xt_cluster.c | |||
@@ -15,14 +15,14 @@ | |||
15 | #include <net/netfilter/nf_conntrack.h> | 15 | #include <net/netfilter/nf_conntrack.h> |
16 | #include <linux/netfilter/xt_cluster.h> | 16 | #include <linux/netfilter/xt_cluster.h> |
17 | 17 | ||
18 | static inline u_int32_t nf_ct_orig_ipv4_src(const struct nf_conn *ct) | 18 | static inline u32 nf_ct_orig_ipv4_src(const struct nf_conn *ct) |
19 | { | 19 | { |
20 | return ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u3.ip; | 20 | return (__force u32)ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u3.ip; |
21 | } | 21 | } |
22 | 22 | ||
23 | static inline const void *nf_ct_orig_ipv6_src(const struct nf_conn *ct) | 23 | static inline const u32 *nf_ct_orig_ipv6_src(const struct nf_conn *ct) |
24 | { | 24 | { |
25 | return ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u3.ip6; | 25 | return (__force u32 *)ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u3.ip6; |
26 | } | 26 | } |
27 | 27 | ||
28 | static inline u_int32_t | 28 | static inline u_int32_t |
diff --git a/net/netfilter/xt_quota.c b/net/netfilter/xt_quota.c index 01dd07b764ec..98fc190e8f0e 100644 --- a/net/netfilter/xt_quota.c +++ b/net/netfilter/xt_quota.c | |||
@@ -54,6 +54,7 @@ static bool quota_mt_check(const struct xt_mtchk_param *par) | |||
54 | if (q->master == NULL) | 54 | if (q->master == NULL) |
55 | return -ENOMEM; | 55 | return -ENOMEM; |
56 | 56 | ||
57 | q->master->quota = q->quota; | ||
57 | return true; | 58 | return true; |
58 | } | 59 | } |
59 | 60 | ||
diff --git a/net/netfilter/xt_rateest.c b/net/netfilter/xt_rateest.c index 220a1d588ee0..4fc6a917f6de 100644 --- a/net/netfilter/xt_rateest.c +++ b/net/netfilter/xt_rateest.c | |||
@@ -66,7 +66,7 @@ xt_rateest_mt(const struct sk_buff *skb, const struct xt_match_param *par) | |||
66 | if (info->flags & XT_RATEEST_MATCH_BPS) | 66 | if (info->flags & XT_RATEEST_MATCH_BPS) |
67 | ret &= bps1 == bps2; | 67 | ret &= bps1 == bps2; |
68 | if (info->flags & XT_RATEEST_MATCH_PPS) | 68 | if (info->flags & XT_RATEEST_MATCH_PPS) |
69 | ret &= pps2 == pps2; | 69 | ret &= pps1 == pps2; |
70 | break; | 70 | break; |
71 | } | 71 | } |
72 | 72 | ||
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c index a63de3f7f185..6a4b19094143 100644 --- a/net/sctp/ipv6.c +++ b/net/sctp/ipv6.c | |||
@@ -133,7 +133,7 @@ static struct notifier_block sctp_inet6addr_notifier = { | |||
133 | 133 | ||
134 | /* ICMP error handler. */ | 134 | /* ICMP error handler. */ |
135 | SCTP_STATIC void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | 135 | SCTP_STATIC void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, |
136 | int type, int code, int offset, __be32 info) | 136 | u8 type, u8 code, int offset, __be32 info) |
137 | { | 137 | { |
138 | struct inet6_dev *idev; | 138 | struct inet6_dev *idev; |
139 | struct sock *sk; | 139 | struct sock *sk; |