aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-01-10 16:44:43 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-10 16:44:43 -0500
commit58dc125a66145f45f239cd78db9410062dc0bcd4 (patch)
tree90537ddf035e96ca3182f61755ed234de93b449b
parentc544bdb1999e04eb10035f1c3262a103859d94b2 (diff)
parent8a4c8a96a47c9e2f08156fd9664974df086eed50 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
-rw-r--r--drivers/atm/zatm.c12
-rw-r--r--drivers/net/irda/Kconfig3
-rw-r--r--drivers/net/irda/Makefile2
-rw-r--r--drivers/net/irda/sir-dev.h2
-rw-r--r--drivers/net/irda/sir_core.c56
-rw-r--r--drivers/net/irda/sir_dev.c10
-rw-r--r--drivers/net/irda/sir_dongle.c2
-rw-r--r--drivers/net/irda/sir_kthread.c11
-rw-r--r--include/linux/netfilter_ipv4/ip_nat_protocol.h7
-rw-r--r--include/linux/netfilter_ipv6.h5
-rw-r--r--include/net/inet_connection_sock.h4
-rw-r--r--net/8021q/vlan_dev.c2
-rw-r--r--net/atm/br2684.c4
-rw-r--r--net/atm/lec.c6
-rw-r--r--net/atm/mpc.c2
-rw-r--r--net/bluetooth/bnep/core.c6
-rw-r--r--net/bluetooth/hci_conn.c2
-rw-r--r--net/bridge/netfilter/ebt_ip.c3
-rw-r--r--net/bridge/netfilter/ebt_stp.c4
-rw-r--r--net/core/dv.c2
-rw-r--r--net/core/wireless.c2
-rw-r--r--net/ieee80211/ieee80211_rx.c14
-rw-r--r--net/ipv4/Makefile4
-rw-r--r--net/ipv4/netfilter.c10
-rw-r--r--net/ipv4/netfilter/ip_conntrack_proto_generic.c2
-rw-r--r--net/ipv4/netfilter/ip_conntrack_proto_icmp.c2
-rw-r--r--net/ipv4/netfilter/ip_conntrack_proto_sctp.c18
-rw-r--r--net/ipv4/netfilter/ip_conntrack_proto_tcp.c20
-rw-r--r--net/ipv4/netfilter/ip_conntrack_proto_udp.c4
-rw-r--r--net/ipv4/netfilter/ip_conntrack_standalone.c26
-rw-r--r--net/ipv4/netfilter/ip_nat_helper_pptp.c81
-rw-r--r--net/ipv4/netfilter/ip_nat_proto_gre.c38
-rw-r--r--net/ipv4/netfilter/ip_nat_proto_icmp.c34
-rw-r--r--net/ipv4/netfilter/ip_nat_proto_tcp.c36
-rw-r--r--net/ipv4/netfilter/ip_nat_proto_udp.c36
-rw-r--r--net/ipv4/netfilter/ip_nat_proto_unknown.c16
-rw-r--r--net/ipv4/netfilter/ipt_mac.c5
-rw-r--r--net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c2
-rw-r--r--net/ipv6/Makefile5
-rw-r--r--net/ipv6/netfilter.c19
-rw-r--r--net/ipv6/netfilter/ip6t_mac.c4
-rw-r--r--net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c4
-rw-r--r--net/netfilter/nf_conntrack_proto_generic.c2
-rw-r--r--net/netfilter/nf_conntrack_proto_sctp.c18
-rw-r--r--net/netfilter/nf_conntrack_proto_tcp.c20
-rw-r--r--net/netfilter/nf_conntrack_proto_udp.c4
-rw-r--r--net/netfilter/nf_conntrack_standalone.c24
-rw-r--r--net/netlink/af_netlink.c2
-rw-r--r--net/rxrpc/connection.c14
-rw-r--r--net/sunrpc/svc.c4
50 files changed, 190 insertions, 425 deletions
diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c
index 55959e4d1cb7..f484747f255e 100644
--- a/drivers/atm/zatm.c
+++ b/drivers/atm/zatm.c
@@ -669,11 +669,13 @@ printk("NONONONOO!!!!\n");
669 u32 *put; 669 u32 *put;
670 int i; 670 int i;
671 671
672 dsc = (u32 *) kmalloc(uPD98401_TXPD_SIZE*2+ 672 dsc = kmalloc(uPD98401_TXPD_SIZE * 2 +
673 uPD98401_TXBD_SIZE*ATM_SKB(skb)->iovcnt,GFP_ATOMIC); 673 uPD98401_TXBD_SIZE * ATM_SKB(skb)->iovcnt, GFP_ATOMIC);
674 if (!dsc) { 674 if (!dsc) {
675 if (vcc->pop) vcc->pop(vcc,skb); 675 if (vcc->pop)
676 else dev_kfree_skb_irq(skb); 676 vcc->pop(vcc, skb);
677 else
678 dev_kfree_skb_irq(skb);
677 return -EAGAIN; 679 return -EAGAIN;
678 } 680 }
679 /* @@@ should check alignment */ 681 /* @@@ should check alignment */
@@ -683,7 +685,7 @@ printk("NONONONOO!!!!\n");
683 (ATM_SKB(skb)->atm_options & ATM_ATMOPT_CLP ? 685 (ATM_SKB(skb)->atm_options & ATM_ATMOPT_CLP ?
684 uPD98401_CLPM_1 : uPD98401_CLPM_0)); 686 uPD98401_CLPM_1 : uPD98401_CLPM_0));
685 dsc[1] = 0; 687 dsc[1] = 0;
686 dsc[2] = ATM_SKB(skb)->iovcnt*uPD98401_TXBD_SIZE; 688 dsc[2] = ATM_SKB(skb)->iovcnt * uPD98401_TXBD_SIZE;
687 dsc[3] = virt_to_bus(put); 689 dsc[3] = virt_to_bus(put);
688 for (i = 0; i < ATM_SKB(skb)->iovcnt; i++) { 690 for (i = 0; i < ATM_SKB(skb)->iovcnt; i++) {
689 *put++ = ((struct iovec *) skb->data)[i].iov_len; 691 *put++ = ((struct iovec *) skb->data)[i].iov_len;
diff --git a/drivers/net/irda/Kconfig b/drivers/net/irda/Kconfig
index d54156f11e61..7a081346f079 100644
--- a/drivers/net/irda/Kconfig
+++ b/drivers/net/irda/Kconfig
@@ -1,4 +1,3 @@
1
2menu "Infrared-port device drivers" 1menu "Infrared-port device drivers"
3 depends on IRDA!=n 2 depends on IRDA!=n
4 3
@@ -156,7 +155,7 @@ comment "Old Serial dongle support"
156 155
157config DONGLE_OLD 156config DONGLE_OLD
158 bool "Old Serial dongle support" 157 bool "Old Serial dongle support"
159 depends on (IRTTY_OLD || IRPORT_SIR) && BROKEN_ON_SMP 158 depends on IRPORT_SIR && BROKEN_ON_SMP
160 help 159 help
161 Say Y here if you have an infrared device that connects to your 160 Say Y here if you have an infrared device that connects to your
162 computer's serial port. These devices are called dongles. Then say Y 161 computer's serial port. These devices are called dongles. Then say Y
diff --git a/drivers/net/irda/Makefile b/drivers/net/irda/Makefile
index e7a8b7f7f5dd..72cbfdc9cfcc 100644
--- a/drivers/net/irda/Makefile
+++ b/drivers/net/irda/Makefile
@@ -45,4 +45,4 @@ obj-$(CONFIG_ACT200L_DONGLE) += act200l-sir.o
45obj-$(CONFIG_MA600_DONGLE) += ma600-sir.o 45obj-$(CONFIG_MA600_DONGLE) += ma600-sir.o
46 46
47# The SIR helper module 47# The SIR helper module
48sir-dev-objs := sir_core.o sir_dev.o sir_dongle.o sir_kthread.o 48sir-dev-objs := sir_dev.o sir_dongle.o sir_kthread.o
diff --git a/drivers/net/irda/sir-dev.h b/drivers/net/irda/sir-dev.h
index f0b8bc3637e5..f69fb4cec76f 100644
--- a/drivers/net/irda/sir-dev.h
+++ b/drivers/net/irda/sir-dev.h
@@ -133,8 +133,6 @@ extern int sirdev_put_dongle(struct sir_dev *self);
133 133
134extern void sirdev_enable_rx(struct sir_dev *dev); 134extern void sirdev_enable_rx(struct sir_dev *dev);
135extern int sirdev_schedule_request(struct sir_dev *dev, int state, unsigned param); 135extern int sirdev_schedule_request(struct sir_dev *dev, int state, unsigned param);
136extern int __init irda_thread_create(void);
137extern void __exit irda_thread_join(void);
138 136
139/* inline helpers */ 137/* inline helpers */
140 138
diff --git a/drivers/net/irda/sir_core.c b/drivers/net/irda/sir_core.c
deleted file mode 100644
index a49f910c835b..000000000000
--- a/drivers/net/irda/sir_core.c
+++ /dev/null
@@ -1,56 +0,0 @@
1/*********************************************************************
2 *
3 * sir_core.c: module core for irda-sir abstraction layer
4 *
5 * Copyright (c) 2002 Martin Diehl
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
11 *
12 ********************************************************************/
13
14#include <linux/module.h>
15#include <linux/kernel.h>
16#include <linux/init.h>
17
18#include <net/irda/irda.h>
19
20#include "sir-dev.h"
21
22/***************************************************************************/
23
24MODULE_AUTHOR("Martin Diehl <info@mdiehl.de>");
25MODULE_DESCRIPTION("IrDA SIR core");
26MODULE_LICENSE("GPL");
27
28/***************************************************************************/
29
30EXPORT_SYMBOL(irda_register_dongle);
31EXPORT_SYMBOL(irda_unregister_dongle);
32
33EXPORT_SYMBOL(sirdev_get_instance);
34EXPORT_SYMBOL(sirdev_put_instance);
35
36EXPORT_SYMBOL(sirdev_set_dongle);
37EXPORT_SYMBOL(sirdev_write_complete);
38EXPORT_SYMBOL(sirdev_receive);
39
40EXPORT_SYMBOL(sirdev_raw_write);
41EXPORT_SYMBOL(sirdev_raw_read);
42EXPORT_SYMBOL(sirdev_set_dtr_rts);
43
44static int __init sir_core_init(void)
45{
46 return irda_thread_create();
47}
48
49static void __exit sir_core_exit(void)
50{
51 irda_thread_join();
52}
53
54module_init(sir_core_init);
55module_exit(sir_core_exit);
56
diff --git a/drivers/net/irda/sir_dev.c b/drivers/net/irda/sir_dev.c
index df22b8b532e7..ea7c9464d46a 100644
--- a/drivers/net/irda/sir_dev.c
+++ b/drivers/net/irda/sir_dev.c
@@ -60,6 +60,7 @@ int sirdev_set_dongle(struct sir_dev *dev, IRDA_DONGLE type)
60 up(&dev->fsm.sem); 60 up(&dev->fsm.sem);
61 return err; 61 return err;
62} 62}
63EXPORT_SYMBOL(sirdev_set_dongle);
63 64
64/* used by dongle drivers for dongle programming */ 65/* used by dongle drivers for dongle programming */
65 66
@@ -94,6 +95,7 @@ int sirdev_raw_write(struct sir_dev *dev, const char *buf, int len)
94 spin_unlock_irqrestore(&dev->tx_lock, flags); 95 spin_unlock_irqrestore(&dev->tx_lock, flags);
95 return ret; 96 return ret;
96} 97}
98EXPORT_SYMBOL(sirdev_raw_write);
97 99
98/* seems some dongle drivers may need this */ 100/* seems some dongle drivers may need this */
99 101
@@ -116,6 +118,7 @@ int sirdev_raw_read(struct sir_dev *dev, char *buf, int len)
116 118
117 return count; 119 return count;
118} 120}
121EXPORT_SYMBOL(sirdev_raw_read);
119 122
120int sirdev_set_dtr_rts(struct sir_dev *dev, int dtr, int rts) 123int sirdev_set_dtr_rts(struct sir_dev *dev, int dtr, int rts)
121{ 124{
@@ -124,7 +127,8 @@ int sirdev_set_dtr_rts(struct sir_dev *dev, int dtr, int rts)
124 ret = dev->drv->set_dtr_rts(dev, dtr, rts); 127 ret = dev->drv->set_dtr_rts(dev, dtr, rts);
125 return ret; 128 return ret;
126} 129}
127 130EXPORT_SYMBOL(sirdev_set_dtr_rts);
131
128/**********************************************************************/ 132/**********************************************************************/
129 133
130/* called from client driver - likely with bh-context - to indicate 134/* called from client driver - likely with bh-context - to indicate
@@ -227,6 +231,7 @@ void sirdev_write_complete(struct sir_dev *dev)
227done: 231done:
228 spin_unlock_irqrestore(&dev->tx_lock, flags); 232 spin_unlock_irqrestore(&dev->tx_lock, flags);
229} 233}
234EXPORT_SYMBOL(sirdev_write_complete);
230 235
231/* called from client driver - likely with bh-context - to give us 236/* called from client driver - likely with bh-context - to give us
232 * some more received bytes. We put them into the rx-buffer, 237 * some more received bytes. We put them into the rx-buffer,
@@ -279,6 +284,7 @@ int sirdev_receive(struct sir_dev *dev, const unsigned char *cp, size_t count)
279 284
280 return 0; 285 return 0;
281} 286}
287EXPORT_SYMBOL(sirdev_receive);
282 288
283/**********************************************************************/ 289/**********************************************************************/
284 290
@@ -641,6 +647,7 @@ out_freenetdev:
641out: 647out:
642 return NULL; 648 return NULL;
643} 649}
650EXPORT_SYMBOL(sirdev_get_instance);
644 651
645int sirdev_put_instance(struct sir_dev *dev) 652int sirdev_put_instance(struct sir_dev *dev)
646{ 653{
@@ -673,4 +680,5 @@ int sirdev_put_instance(struct sir_dev *dev)
673 680
674 return 0; 681 return 0;
675} 682}
683EXPORT_SYMBOL(sirdev_put_instance);
676 684
diff --git a/drivers/net/irda/sir_dongle.c b/drivers/net/irda/sir_dongle.c
index c5b76746e72b..8d225921ae7b 100644
--- a/drivers/net/irda/sir_dongle.c
+++ b/drivers/net/irda/sir_dongle.c
@@ -50,6 +50,7 @@ int irda_register_dongle(struct dongle_driver *new)
50 up(&dongle_list_lock); 50 up(&dongle_list_lock);
51 return 0; 51 return 0;
52} 52}
53EXPORT_SYMBOL(irda_register_dongle);
53 54
54int irda_unregister_dongle(struct dongle_driver *drv) 55int irda_unregister_dongle(struct dongle_driver *drv)
55{ 56{
@@ -58,6 +59,7 @@ int irda_unregister_dongle(struct dongle_driver *drv)
58 up(&dongle_list_lock); 59 up(&dongle_list_lock);
59 return 0; 60 return 0;
60} 61}
62EXPORT_SYMBOL(irda_unregister_dongle);
61 63
62int sirdev_get_dongle(struct sir_dev *dev, IRDA_DONGLE type) 64int sirdev_get_dongle(struct sir_dev *dev, IRDA_DONGLE type)
63{ 65{
diff --git a/drivers/net/irda/sir_kthread.c b/drivers/net/irda/sir_kthread.c
index c65054364bca..e3904d6bfecd 100644
--- a/drivers/net/irda/sir_kthread.c
+++ b/drivers/net/irda/sir_kthread.c
@@ -466,7 +466,7 @@ int sirdev_schedule_request(struct sir_dev *dev, int initial_state, unsigned par
466 return 0; 466 return 0;
467} 467}
468 468
469int __init irda_thread_create(void) 469static int __init irda_thread_create(void)
470{ 470{
471 struct completion startup; 471 struct completion startup;
472 int pid; 472 int pid;
@@ -488,7 +488,7 @@ int __init irda_thread_create(void)
488 return 0; 488 return 0;
489} 489}
490 490
491void __exit irda_thread_join(void) 491static void __exit irda_thread_join(void)
492{ 492{
493 if (irda_rq_queue.thread) { 493 if (irda_rq_queue.thread) {
494 flush_irda_queue(); 494 flush_irda_queue();
@@ -499,3 +499,10 @@ void __exit irda_thread_join(void)
499 } 499 }
500} 500}
501 501
502module_init(irda_thread_create);
503module_exit(irda_thread_join);
504
505MODULE_AUTHOR("Martin Diehl <info@mdiehl.de>");
506MODULE_DESCRIPTION("IrDA SIR core");
507MODULE_LICENSE("GPL");
508
diff --git a/include/linux/netfilter_ipv4/ip_nat_protocol.h b/include/linux/netfilter_ipv4/ip_nat_protocol.h
index ef63aa991a06..612a43614e7b 100644
--- a/include/linux/netfilter_ipv4/ip_nat_protocol.h
+++ b/include/linux/netfilter_ipv4/ip_nat_protocol.h
@@ -42,13 +42,6 @@ struct ip_nat_protocol
42 enum ip_nat_manip_type maniptype, 42 enum ip_nat_manip_type maniptype,
43 const struct ip_conntrack *conntrack); 43 const struct ip_conntrack *conntrack);
44 44
45 unsigned int (*print)(char *buffer,
46 const struct ip_conntrack_tuple *match,
47 const struct ip_conntrack_tuple *mask);
48
49 unsigned int (*print_range)(char *buffer,
50 const struct ip_nat_range *range);
51
52 int (*range_to_nfattr)(struct sk_buff *skb, 45 int (*range_to_nfattr)(struct sk_buff *skb,
53 const struct ip_nat_range *range); 46 const struct ip_nat_range *range);
54 47
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h
index 53b2983f6278..14f2bd010884 100644
--- a/include/linux/netfilter_ipv6.h
+++ b/include/linux/netfilter_ipv6.h
@@ -72,7 +72,12 @@ enum nf_ip6_hook_priorities {
72 NF_IP6_PRI_LAST = INT_MAX, 72 NF_IP6_PRI_LAST = INT_MAX,
73}; 73};
74 74
75#ifdef CONFIG_NETFILTER
75extern int ipv6_netfilter_init(void); 76extern int ipv6_netfilter_init(void);
76extern void ipv6_netfilter_fini(void); 77extern void ipv6_netfilter_fini(void);
78#else /* CONFIG_NETFILTER */
79static inline int ipv6_netfilter_init(void) { return 0; }
80static inline void ipv6_netfilter_fini(void) { return; }
81#endif /* CONFIG_NETFILTER */
77 82
78#endif /*__LINUX_IP6_NETFILTER_H*/ 83#endif /*__LINUX_IP6_NETFILTER_H*/
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
index 50234fa56a68..fa587c94e9d0 100644
--- a/include/net/inet_connection_sock.h
+++ b/include/net/inet_connection_sock.h
@@ -83,8 +83,8 @@ struct inet_connection_sock {
83 struct timer_list icsk_delack_timer; 83 struct timer_list icsk_delack_timer;
84 __u32 icsk_rto; 84 __u32 icsk_rto;
85 __u32 icsk_pmtu_cookie; 85 __u32 icsk_pmtu_cookie;
86 struct tcp_congestion_ops *icsk_ca_ops; 86 const struct tcp_congestion_ops *icsk_ca_ops;
87 struct inet_connection_sock_af_ops *icsk_af_ops; 87 const struct inet_connection_sock_af_ops *icsk_af_ops;
88 unsigned int (*icsk_sync_mss)(struct sock *sk, u32 pmtu); 88 unsigned int (*icsk_sync_mss)(struct sock *sk, u32 pmtu);
89 __u8 icsk_ca_state; 89 __u8 icsk_ca_state;
90 __u8 icsk_retransmits; 90 __u8 icsk_retransmits;
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index f2a8750bbf1d..0f604d227da2 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -214,7 +214,7 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
214 * This allows the VLAN to have a different MAC than the underlying 214 * This allows the VLAN to have a different MAC than the underlying
215 * device, and still route correctly. 215 * device, and still route correctly.
216 */ 216 */
217 if (memcmp(eth_hdr(skb)->h_dest, skb->dev->dev_addr, ETH_ALEN) == 0) { 217 if (!compare_ether_addr(eth_hdr(skb)->h_dest, skb->dev->dev_addr)) {
218 /* It is for our (changed) MAC-address! */ 218 /* It is for our (changed) MAC-address! */
219 skb->pkt_type = PACKET_HOST; 219 skb->pkt_type = PACKET_HOST;
220 } 220 }
diff --git a/net/atm/br2684.c b/net/atm/br2684.c
index bdb4d89730d2..1dafa9c108a7 100644
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -296,13 +296,13 @@ static inline __be16 br_type_trans(struct sk_buff *skb, struct net_device *dev)
296 eth = eth_hdr(skb); 296 eth = eth_hdr(skb);
297 297
298 if (is_multicast_ether_addr(eth->h_dest)) { 298 if (is_multicast_ether_addr(eth->h_dest)) {
299 if (memcmp(eth->h_dest, dev->broadcast, ETH_ALEN) == 0) 299 if (!compare_ether_addr(eth->h_dest, dev->broadcast))
300 skb->pkt_type = PACKET_BROADCAST; 300 skb->pkt_type = PACKET_BROADCAST;
301 else 301 else
302 skb->pkt_type = PACKET_MULTICAST; 302 skb->pkt_type = PACKET_MULTICAST;
303 } 303 }
304 304
305 else if (memcmp(eth->h_dest, dev->dev_addr, ETH_ALEN)) 305 else if (compare_ether_addr(eth->h_dest, dev->dev_addr))
306 skb->pkt_type = PACKET_OTHERHOST; 306 skb->pkt_type = PACKET_OTHERHOST;
307 307
308 if (ntohs(eth->h_proto) >= 1536) 308 if (ntohs(eth->h_proto) >= 1536)
diff --git a/net/atm/lec.c b/net/atm/lec.c
index ad840b9afba8..eea051338498 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -1321,7 +1321,7 @@ static int lane2_associate_req (struct net_device *dev, u8 *lan_dst,
1321 struct sk_buff *skb; 1321 struct sk_buff *skb;
1322 struct lec_priv *priv = (struct lec_priv*)dev->priv; 1322 struct lec_priv *priv = (struct lec_priv*)dev->priv;
1323 1323
1324 if ( memcmp(lan_dst, dev->dev_addr, ETH_ALEN) != 0 ) 1324 if (compare_ether_addr(lan_dst, dev->dev_addr))
1325 return (0); /* not our mac address */ 1325 return (0); /* not our mac address */
1326 1326
1327 kfree(priv->tlvs); /* NULL if there was no previous association */ 1327 kfree(priv->tlvs); /* NULL if there was no previous association */
@@ -1798,7 +1798,7 @@ lec_arp_find(struct lec_priv *priv,
1798 1798
1799 to_return = priv->lec_arp_tables[place]; 1799 to_return = priv->lec_arp_tables[place];
1800 while(to_return) { 1800 while(to_return) {
1801 if (memcmp(mac_addr, to_return->mac_addr, ETH_ALEN) == 0) { 1801 if (!compare_ether_addr(mac_addr, to_return->mac_addr)) {
1802 return to_return; 1802 return to_return;
1803 } 1803 }
1804 to_return = to_return->next; 1804 to_return = to_return->next;
@@ -2002,7 +2002,7 @@ lec_arp_resolve(struct lec_priv *priv, unsigned char *mac_to_find,
2002 return priv->mcast_vcc; 2002 return priv->mcast_vcc;
2003 break; 2003 break;
2004 case 2: /* LANE2 wants arp for multicast addresses */ 2004 case 2: /* LANE2 wants arp for multicast addresses */
2005 if ( memcmp(mac_to_find, bus_mac, ETH_ALEN) == 0) 2005 if (!compare_ether_addr(mac_to_find, bus_mac))
2006 return priv->mcast_vcc; 2006 return priv->mcast_vcc;
2007 break; 2007 break;
2008 default: 2008 default:
diff --git a/net/atm/mpc.c b/net/atm/mpc.c
index 526d9531411f..36b7ae360232 100644
--- a/net/atm/mpc.c
+++ b/net/atm/mpc.c
@@ -552,7 +552,7 @@ static int mpc_send_packet(struct sk_buff *skb, struct net_device *dev)
552 goto non_ip; /* Multi-Protocol Over ATM :-) */ 552 goto non_ip; /* Multi-Protocol Over ATM :-) */
553 553
554 while (i < mpc->number_of_mps_macs) { 554 while (i < mpc->number_of_mps_macs) {
555 if (memcmp(eth->h_dest, (mpc->mps_macs + i*ETH_ALEN), ETH_ALEN) == 0) 555 if (!compare_ether_addr(eth->h_dest, (mpc->mps_macs + i*ETH_ALEN)))
556 if ( send_via_shortcut(skb, mpc) == 0 ) /* try shortcut */ 556 if ( send_via_shortcut(skb, mpc) == 0 ) /* try shortcut */
557 return 0; /* success! */ 557 return 0; /* success! */
558 i++; 558 i++;
diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c
index 682bf20af52d..cbb20c32a6c8 100644
--- a/net/bluetooth/bnep/core.c
+++ b/net/bluetooth/bnep/core.c
@@ -75,7 +75,7 @@ static struct bnep_session *__bnep_get_session(u8 *dst)
75 75
76 list_for_each(p, &bnep_session_list) { 76 list_for_each(p, &bnep_session_list) {
77 s = list_entry(p, struct bnep_session, list); 77 s = list_entry(p, struct bnep_session, list);
78 if (!memcmp(dst, s->eh.h_source, ETH_ALEN)) 78 if (!compare_ether_addr(dst, s->eh.h_source))
79 return s; 79 return s;
80 } 80 }
81 return NULL; 81 return NULL;
@@ -420,10 +420,10 @@ static inline int bnep_tx_frame(struct bnep_session *s, struct sk_buff *skb)
420 iv[il++] = (struct kvec) { &type, 1 }; 420 iv[il++] = (struct kvec) { &type, 1 };
421 len++; 421 len++;
422 422
423 if (!memcmp(eh->h_dest, s->eh.h_source, ETH_ALEN)) 423 if (!compare_ether_addr(eh->h_dest, s->eh.h_source))
424 type |= 0x01; 424 type |= 0x01;
425 425
426 if (!memcmp(eh->h_source, s->eh.h_dest, ETH_ALEN)) 426 if (!compare_ether_addr(eh->h_source, s->eh.h_dest))
427 type |= 0x02; 427 type |= 0x02;
428 428
429 if (type) 429 if (type)
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index a31244e58888..f812ed129e58 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -403,7 +403,7 @@ int hci_get_conn_list(void __user *arg)
403 403
404 size = sizeof(req) + req.conn_num * sizeof(*ci); 404 size = sizeof(req) + req.conn_num * sizeof(*ci);
405 405
406 if (!(cl = (void *) kmalloc(size, GFP_KERNEL))) 406 if (!(cl = kmalloc(size, GFP_KERNEL)))
407 return -ENOMEM; 407 return -ENOMEM;
408 408
409 if (!(hdev = hci_dev_get(req.dev_id))) { 409 if (!(hdev = hci_dev_get(req.dev_id))) {
diff --git a/net/bridge/netfilter/ebt_ip.c b/net/bridge/netfilter/ebt_ip.c
index 7323805b9726..f158fe67dd60 100644
--- a/net/bridge/netfilter/ebt_ip.c
+++ b/net/bridge/netfilter/ebt_ip.c
@@ -15,6 +15,7 @@
15#include <linux/netfilter_bridge/ebtables.h> 15#include <linux/netfilter_bridge/ebtables.h>
16#include <linux/netfilter_bridge/ebt_ip.h> 16#include <linux/netfilter_bridge/ebt_ip.h>
17#include <linux/ip.h> 17#include <linux/ip.h>
18#include <net/ip.h>
18#include <linux/in.h> 19#include <linux/in.h>
19#include <linux/module.h> 20#include <linux/module.h>
20 21
@@ -51,6 +52,8 @@ static int ebt_filter_ip(const struct sk_buff *skb, const struct net_device *in,
51 if (!(info->bitmask & EBT_IP_DPORT) && 52 if (!(info->bitmask & EBT_IP_DPORT) &&
52 !(info->bitmask & EBT_IP_SPORT)) 53 !(info->bitmask & EBT_IP_SPORT))
53 return EBT_MATCH; 54 return EBT_MATCH;
55 if (ntohs(ih->frag_off) & IP_OFFSET)
56 return EBT_NOMATCH;
54 pptr = skb_header_pointer(skb, ih->ihl*4, 57 pptr = skb_header_pointer(skb, ih->ihl*4,
55 sizeof(_ports), &_ports); 58 sizeof(_ports), &_ports);
56 if (pptr == NULL) 59 if (pptr == NULL)
diff --git a/net/bridge/netfilter/ebt_stp.c b/net/bridge/netfilter/ebt_stp.c
index f8a8cdec16ee..9d2ef4ffe276 100644
--- a/net/bridge/netfilter/ebt_stp.c
+++ b/net/bridge/netfilter/ebt_stp.c
@@ -164,8 +164,8 @@ static int ebt_stp_check(const char *tablename, unsigned int hookmask,
164 if (datalen != len) 164 if (datalen != len)
165 return -EINVAL; 165 return -EINVAL;
166 /* Make sure the match only receives stp frames */ 166 /* Make sure the match only receives stp frames */
167 if (memcmp(e->destmac, bridge_ula, ETH_ALEN) || 167 if (compare_ether_addr(e->destmac, bridge_ula) ||
168 memcmp(e->destmsk, msk, ETH_ALEN) || !(e->bitmask & EBT_DESTMAC)) 168 compare_ether_addr(e->destmsk, msk) || !(e->bitmask & EBT_DESTMAC))
169 return -EINVAL; 169 return -EINVAL;
170 170
171 return 0; 171 return 0;
diff --git a/net/core/dv.c b/net/core/dv.c
index 3f25f4aa4e66..c5deb3655257 100644
--- a/net/core/dv.c
+++ b/net/core/dv.c
@@ -457,7 +457,7 @@ void divert_frame(struct sk_buff *skb)
457 unsigned char *skb_data_end = skb->data + skb->len; 457 unsigned char *skb_data_end = skb->data + skb->len;
458 458
459 /* Packet is already aimed at us, return */ 459 /* Packet is already aimed at us, return */
460 if (!memcmp(eth, skb->dev->dev_addr, ETH_ALEN)) 460 if (!compare_ether_addr(eth, skb->dev->dev_addr))
461 return; 461 return;
462 462
463 /* proto is not IP, do nothing */ 463 /* proto is not IP, do nothing */
diff --git a/net/core/wireless.c b/net/core/wireless.c
index 271ddb35b0b2..f88b0affb3b9 100644
--- a/net/core/wireless.c
+++ b/net/core/wireless.c
@@ -1506,7 +1506,7 @@ void wireless_spy_update(struct net_device * dev,
1506 1506
1507 /* Update all records that match */ 1507 /* Update all records that match */
1508 for(i = 0; i < spydata->spy_number; i++) 1508 for(i = 0; i < spydata->spy_number; i++)
1509 if(!memcmp(address, spydata->spy_address[i], ETH_ALEN)) { 1509 if(!compare_ether_addr(address, spydata->spy_address[i])) {
1510 memcpy(&(spydata->spy_stat[i]), wstats, 1510 memcpy(&(spydata->spy_stat[i]), wstats,
1511 sizeof(struct iw_quality)); 1511 sizeof(struct iw_quality));
1512 match = i; 1512 match = i;
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c
index 4cc6f41c6930..5e3380388046 100644
--- a/net/ieee80211/ieee80211_rx.c
+++ b/net/ieee80211/ieee80211_rx.c
@@ -76,8 +76,8 @@ static struct ieee80211_frag_entry *ieee80211_frag_cache_find(struct
76 76
77 if (entry->skb != NULL && entry->seq == seq && 77 if (entry->skb != NULL && entry->seq == seq &&
78 (entry->last_frag + 1 == frag || frag == -1) && 78 (entry->last_frag + 1 == frag || frag == -1) &&
79 memcmp(entry->src_addr, src, ETH_ALEN) == 0 && 79 !compare_ether_addr(entry->src_addr, src) &&
80 memcmp(entry->dst_addr, dst, ETH_ALEN) == 0) 80 !compare_ether_addr(entry->dst_addr, dst))
81 return entry; 81 return entry;
82 } 82 }
83 83
@@ -243,12 +243,12 @@ static int ieee80211_is_eapol_frame(struct ieee80211_device *ieee,
243 /* check that the frame is unicast frame to us */ 243 /* check that the frame is unicast frame to us */
244 if ((fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) == 244 if ((fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) ==
245 IEEE80211_FCTL_TODS && 245 IEEE80211_FCTL_TODS &&
246 memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN) == 0 && 246 !compare_ether_addr(hdr->addr1, dev->dev_addr) &&
247 memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN) == 0) { 247 !compare_ether_addr(hdr->addr3, dev->dev_addr)) {
248 /* ToDS frame with own addr BSSID and DA */ 248 /* ToDS frame with own addr BSSID and DA */
249 } else if ((fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) == 249 } else if ((fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) ==
250 IEEE80211_FCTL_FROMDS && 250 IEEE80211_FCTL_FROMDS &&
251 memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN) == 0) { 251 !compare_ether_addr(hdr->addr1, dev->dev_addr)) {
252 /* FromDS frame with own addr as DA */ 252 /* FromDS frame with own addr as DA */
253 } else 253 } else
254 return 0; 254 return 0;
@@ -505,7 +505,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
505 if (ieee->iw_mode == IW_MODE_MASTER && !wds && 505 if (ieee->iw_mode == IW_MODE_MASTER && !wds &&
506 (fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) == 506 (fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) ==
507 IEEE80211_FCTL_FROMDS && ieee->stadev 507 IEEE80211_FCTL_FROMDS && ieee->stadev
508 && memcmp(hdr->addr2, ieee->assoc_ap_addr, ETH_ALEN) == 0) { 508 && !compare_ether_addr(hdr->addr2, ieee->assoc_ap_addr)) {
509 /* Frame from BSSID of the AP for which we are a client */ 509 /* Frame from BSSID of the AP for which we are a client */
510 skb->dev = dev = ieee->stadev; 510 skb->dev = dev = ieee->stadev;
511 stats = hostap_get_stats(dev); 511 stats = hostap_get_stats(dev);
@@ -1231,7 +1231,7 @@ static inline int is_same_network(struct ieee80211_network *src,
1231 * as one network */ 1231 * as one network */
1232 return ((src->ssid_len == dst->ssid_len) && 1232 return ((src->ssid_len == dst->ssid_len) &&
1233 (src->channel == dst->channel) && 1233 (src->channel == dst->channel) &&
1234 !memcmp(src->bssid, dst->bssid, ETH_ALEN) && 1234 !compare_ether_addr(src->bssid, dst->bssid) &&
1235 !memcmp(src->ssid, dst->ssid, src->ssid_len)); 1235 !memcmp(src->ssid, dst->ssid, src->ssid_len));
1236} 1236}
1237 1237
diff --git a/net/ipv4/Makefile b/net/ipv4/Makefile
index c54edd76de09..35e5f5999092 100644
--- a/net/ipv4/Makefile
+++ b/net/ipv4/Makefile
@@ -9,7 +9,7 @@ obj-y := route.o inetpeer.o protocol.o \
9 tcp.o tcp_input.o tcp_output.o tcp_timer.o tcp_ipv4.o \ 9 tcp.o tcp_input.o tcp_output.o tcp_timer.o tcp_ipv4.o \
10 tcp_minisocks.o tcp_cong.o \ 10 tcp_minisocks.o tcp_cong.o \
11 datagram.o raw.o udp.o arp.o icmp.o devinet.o af_inet.o igmp.o \ 11 datagram.o raw.o udp.o arp.o icmp.o devinet.o af_inet.o igmp.o \
12 sysctl_net_ipv4.o fib_frontend.o fib_semantics.o netfilter.o 12 sysctl_net_ipv4.o fib_frontend.o fib_semantics.o
13 13
14obj-$(CONFIG_IP_FIB_HASH) += fib_hash.o 14obj-$(CONFIG_IP_FIB_HASH) += fib_hash.o
15obj-$(CONFIG_IP_FIB_TRIE) += fib_trie.o 15obj-$(CONFIG_IP_FIB_TRIE) += fib_trie.o
@@ -28,7 +28,7 @@ obj-$(CONFIG_IP_ROUTE_MULTIPATH_RR) += multipath_rr.o
28obj-$(CONFIG_IP_ROUTE_MULTIPATH_RANDOM) += multipath_random.o 28obj-$(CONFIG_IP_ROUTE_MULTIPATH_RANDOM) += multipath_random.o
29obj-$(CONFIG_IP_ROUTE_MULTIPATH_WRANDOM) += multipath_wrandom.o 29obj-$(CONFIG_IP_ROUTE_MULTIPATH_WRANDOM) += multipath_wrandom.o
30obj-$(CONFIG_IP_ROUTE_MULTIPATH_DRR) += multipath_drr.o 30obj-$(CONFIG_IP_ROUTE_MULTIPATH_DRR) += multipath_drr.o
31obj-$(CONFIG_NETFILTER) += netfilter/ 31obj-$(CONFIG_NETFILTER) += netfilter.o netfilter/
32obj-$(CONFIG_IP_VS) += ipvs/ 32obj-$(CONFIG_IP_VS) += ipvs/
33obj-$(CONFIG_INET_DIAG) += inet_diag.o 33obj-$(CONFIG_INET_DIAG) += inet_diag.o
34obj-$(CONFIG_IP_ROUTE_MULTIPATH_CACHED) += multipath.o 34obj-$(CONFIG_IP_ROUTE_MULTIPATH_CACHED) += multipath.o
diff --git a/net/ipv4/netfilter.c b/net/ipv4/netfilter.c
index 3321092b0914..52a3d7c57907 100644
--- a/net/ipv4/netfilter.c
+++ b/net/ipv4/netfilter.c
@@ -1,16 +1,8 @@
1/* IPv4 specific functions of netfilter core */ 1/* IPv4 specific functions of netfilter core */
2
3#include <linux/config.h>
4#ifdef CONFIG_NETFILTER
5
6#include <linux/kernel.h> 2#include <linux/kernel.h>
7#include <linux/netfilter.h> 3#include <linux/netfilter.h>
8#include <linux/netfilter_ipv4.h> 4#include <linux/netfilter_ipv4.h>
9
10#include <linux/ip.h> 5#include <linux/ip.h>
11#include <linux/tcp.h>
12#include <linux/udp.h>
13#include <linux/icmp.h>
14#include <net/route.h> 6#include <net/route.h>
15#include <net/xfrm.h> 7#include <net/xfrm.h>
16#include <net/ip.h> 8#include <net/ip.h>
@@ -146,5 +138,3 @@ static void fini(void)
146 138
147module_init(init); 139module_init(init);
148module_exit(fini); 140module_exit(fini);
149
150#endif /* CONFIG_NETFILTER */
diff --git a/net/ipv4/netfilter/ip_conntrack_proto_generic.c b/net/ipv4/netfilter/ip_conntrack_proto_generic.c
index 88c3712bd251..f891308b5e4c 100644
--- a/net/ipv4/netfilter/ip_conntrack_proto_generic.c
+++ b/net/ipv4/netfilter/ip_conntrack_proto_generic.c
@@ -12,7 +12,7 @@
12#include <linux/netfilter.h> 12#include <linux/netfilter.h>
13#include <linux/netfilter_ipv4/ip_conntrack_protocol.h> 13#include <linux/netfilter_ipv4/ip_conntrack_protocol.h>
14 14
15unsigned long ip_ct_generic_timeout = 600*HZ; 15unsigned int ip_ct_generic_timeout = 600*HZ;
16 16
17static int generic_pkt_to_tuple(const struct sk_buff *skb, 17static int generic_pkt_to_tuple(const struct sk_buff *skb,
18 unsigned int dataoff, 18 unsigned int dataoff,
diff --git a/net/ipv4/netfilter/ip_conntrack_proto_icmp.c b/net/ipv4/netfilter/ip_conntrack_proto_icmp.c
index 30fc21d6165a..f2a90e2743d7 100644
--- a/net/ipv4/netfilter/ip_conntrack_proto_icmp.c
+++ b/net/ipv4/netfilter/ip_conntrack_proto_icmp.c
@@ -22,7 +22,7 @@
22#include <linux/netfilter_ipv4/ip_conntrack_core.h> 22#include <linux/netfilter_ipv4/ip_conntrack_core.h>
23#include <linux/netfilter_ipv4/ip_conntrack_protocol.h> 23#include <linux/netfilter_ipv4/ip_conntrack_protocol.h>
24 24
25unsigned long ip_ct_icmp_timeout = 30*HZ; 25unsigned int ip_ct_icmp_timeout = 30*HZ;
26 26
27#if 0 27#if 0
28#define DEBUGP printk 28#define DEBUGP printk
diff --git a/net/ipv4/netfilter/ip_conntrack_proto_sctp.c b/net/ipv4/netfilter/ip_conntrack_proto_sctp.c
index 0b25050981a1..be602e8aeab0 100644
--- a/net/ipv4/netfilter/ip_conntrack_proto_sctp.c
+++ b/net/ipv4/netfilter/ip_conntrack_proto_sctp.c
@@ -58,15 +58,15 @@ static const char *sctp_conntrack_names[] = {
58#define HOURS * 60 MINS 58#define HOURS * 60 MINS
59#define DAYS * 24 HOURS 59#define DAYS * 24 HOURS
60 60
61static unsigned long ip_ct_sctp_timeout_closed = 10 SECS; 61static unsigned int ip_ct_sctp_timeout_closed = 10 SECS;
62static unsigned long ip_ct_sctp_timeout_cookie_wait = 3 SECS; 62static unsigned int ip_ct_sctp_timeout_cookie_wait = 3 SECS;
63static unsigned long ip_ct_sctp_timeout_cookie_echoed = 3 SECS; 63static unsigned int ip_ct_sctp_timeout_cookie_echoed = 3 SECS;
64static unsigned long ip_ct_sctp_timeout_established = 5 DAYS; 64static unsigned int ip_ct_sctp_timeout_established = 5 DAYS;
65static unsigned long ip_ct_sctp_timeout_shutdown_sent = 300 SECS / 1000; 65static unsigned int ip_ct_sctp_timeout_shutdown_sent = 300 SECS / 1000;
66static unsigned long ip_ct_sctp_timeout_shutdown_recd = 300 SECS / 1000; 66static unsigned int ip_ct_sctp_timeout_shutdown_recd = 300 SECS / 1000;
67static unsigned long ip_ct_sctp_timeout_shutdown_ack_sent = 3 SECS; 67static unsigned int ip_ct_sctp_timeout_shutdown_ack_sent = 3 SECS;
68 68
69static const unsigned long * sctp_timeouts[] 69static const unsigned int * sctp_timeouts[]
70= { NULL, /* SCTP_CONNTRACK_NONE */ 70= { NULL, /* SCTP_CONNTRACK_NONE */
71 &ip_ct_sctp_timeout_closed, /* SCTP_CONNTRACK_CLOSED */ 71 &ip_ct_sctp_timeout_closed, /* SCTP_CONNTRACK_CLOSED */
72 &ip_ct_sctp_timeout_cookie_wait, /* SCTP_CONNTRACK_COOKIE_WAIT */ 72 &ip_ct_sctp_timeout_cookie_wait, /* SCTP_CONNTRACK_COOKIE_WAIT */
diff --git a/net/ipv4/netfilter/ip_conntrack_proto_tcp.c b/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
index 77f304680d86..ea2b39c18050 100644
--- a/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
+++ b/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
@@ -85,21 +85,21 @@ static const char *tcp_conntrack_names[] = {
85#define HOURS * 60 MINS 85#define HOURS * 60 MINS
86#define DAYS * 24 HOURS 86#define DAYS * 24 HOURS
87 87
88unsigned long ip_ct_tcp_timeout_syn_sent = 2 MINS; 88unsigned int ip_ct_tcp_timeout_syn_sent = 2 MINS;
89unsigned long ip_ct_tcp_timeout_syn_recv = 60 SECS; 89unsigned int ip_ct_tcp_timeout_syn_recv = 60 SECS;
90unsigned long ip_ct_tcp_timeout_established = 5 DAYS; 90unsigned int ip_ct_tcp_timeout_established = 5 DAYS;
91unsigned long ip_ct_tcp_timeout_fin_wait = 2 MINS; 91unsigned int ip_ct_tcp_timeout_fin_wait = 2 MINS;
92unsigned long ip_ct_tcp_timeout_close_wait = 60 SECS; 92unsigned int ip_ct_tcp_timeout_close_wait = 60 SECS;
93unsigned long ip_ct_tcp_timeout_last_ack = 30 SECS; 93unsigned int ip_ct_tcp_timeout_last_ack = 30 SECS;
94unsigned long ip_ct_tcp_timeout_time_wait = 2 MINS; 94unsigned int ip_ct_tcp_timeout_time_wait = 2 MINS;
95unsigned long ip_ct_tcp_timeout_close = 10 SECS; 95unsigned int ip_ct_tcp_timeout_close = 10 SECS;
96 96
97/* RFC1122 says the R2 limit should be at least 100 seconds. 97/* RFC1122 says the R2 limit should be at least 100 seconds.
98 Linux uses 15 packets as limit, which corresponds 98 Linux uses 15 packets as limit, which corresponds
99 to ~13-30min depending on RTO. */ 99 to ~13-30min depending on RTO. */
100unsigned long ip_ct_tcp_timeout_max_retrans = 5 MINS; 100unsigned int ip_ct_tcp_timeout_max_retrans = 5 MINS;
101 101
102static const unsigned long * tcp_timeouts[] 102static const unsigned int * tcp_timeouts[]
103= { NULL, /* TCP_CONNTRACK_NONE */ 103= { NULL, /* TCP_CONNTRACK_NONE */
104 &ip_ct_tcp_timeout_syn_sent, /* TCP_CONNTRACK_SYN_SENT, */ 104 &ip_ct_tcp_timeout_syn_sent, /* TCP_CONNTRACK_SYN_SENT, */
105 &ip_ct_tcp_timeout_syn_recv, /* TCP_CONNTRACK_SYN_RECV, */ 105 &ip_ct_tcp_timeout_syn_recv, /* TCP_CONNTRACK_SYN_RECV, */
diff --git a/net/ipv4/netfilter/ip_conntrack_proto_udp.c b/net/ipv4/netfilter/ip_conntrack_proto_udp.c
index 46becbe4fe58..004003fd6117 100644
--- a/net/ipv4/netfilter/ip_conntrack_proto_udp.c
+++ b/net/ipv4/netfilter/ip_conntrack_proto_udp.c
@@ -19,8 +19,8 @@
19#include <linux/netfilter_ipv4.h> 19#include <linux/netfilter_ipv4.h>
20#include <linux/netfilter_ipv4/ip_conntrack_protocol.h> 20#include <linux/netfilter_ipv4/ip_conntrack_protocol.h>
21 21
22unsigned long ip_ct_udp_timeout = 30*HZ; 22unsigned int ip_ct_udp_timeout = 30*HZ;
23unsigned long ip_ct_udp_timeout_stream = 180*HZ; 23unsigned int ip_ct_udp_timeout_stream = 180*HZ;
24 24
25static int udp_pkt_to_tuple(const struct sk_buff *skb, 25static int udp_pkt_to_tuple(const struct sk_buff *skb,
26 unsigned int dataoff, 26 unsigned int dataoff,
diff --git a/net/ipv4/netfilter/ip_conntrack_standalone.c b/net/ipv4/netfilter/ip_conntrack_standalone.c
index 7ba97783e741..9dec1293f67a 100644
--- a/net/ipv4/netfilter/ip_conntrack_standalone.c
+++ b/net/ipv4/netfilter/ip_conntrack_standalone.c
@@ -544,28 +544,28 @@ extern int ip_conntrack_max;
544extern unsigned int ip_conntrack_htable_size; 544extern unsigned int ip_conntrack_htable_size;
545 545
546/* From ip_conntrack_proto_tcp.c */ 546/* From ip_conntrack_proto_tcp.c */
547extern unsigned long ip_ct_tcp_timeout_syn_sent; 547extern unsigned int ip_ct_tcp_timeout_syn_sent;
548extern unsigned long ip_ct_tcp_timeout_syn_recv; 548extern unsigned int ip_ct_tcp_timeout_syn_recv;
549extern unsigned long ip_ct_tcp_timeout_established; 549extern unsigned int ip_ct_tcp_timeout_established;
550extern unsigned long ip_ct_tcp_timeout_fin_wait; 550extern unsigned int ip_ct_tcp_timeout_fin_wait;
551extern unsigned long ip_ct_tcp_timeout_close_wait; 551extern unsigned int ip_ct_tcp_timeout_close_wait;
552extern unsigned long ip_ct_tcp_timeout_last_ack; 552extern unsigned int ip_ct_tcp_timeout_last_ack;
553extern unsigned long ip_ct_tcp_timeout_time_wait; 553extern unsigned int ip_ct_tcp_timeout_time_wait;
554extern unsigned long ip_ct_tcp_timeout_close; 554extern unsigned int ip_ct_tcp_timeout_close;
555extern unsigned long ip_ct_tcp_timeout_max_retrans; 555extern unsigned int ip_ct_tcp_timeout_max_retrans;
556extern int ip_ct_tcp_loose; 556extern int ip_ct_tcp_loose;
557extern int ip_ct_tcp_be_liberal; 557extern int ip_ct_tcp_be_liberal;
558extern int ip_ct_tcp_max_retrans; 558extern int ip_ct_tcp_max_retrans;
559 559
560/* From ip_conntrack_proto_udp.c */ 560/* From ip_conntrack_proto_udp.c */
561extern unsigned long ip_ct_udp_timeout; 561extern unsigned int ip_ct_udp_timeout;
562extern unsigned long ip_ct_udp_timeout_stream; 562extern unsigned int ip_ct_udp_timeout_stream;
563 563
564/* From ip_conntrack_proto_icmp.c */ 564/* From ip_conntrack_proto_icmp.c */
565extern unsigned long ip_ct_icmp_timeout; 565extern unsigned int ip_ct_icmp_timeout;
566 566
567/* From ip_conntrack_proto_icmp.c */ 567/* From ip_conntrack_proto_icmp.c */
568extern unsigned long ip_ct_generic_timeout; 568extern unsigned int ip_ct_generic_timeout;
569 569
570/* Log invalid packets of a given protocol */ 570/* Log invalid packets of a given protocol */
571static int log_invalid_proto_min = 0; 571static int log_invalid_proto_min = 0;
diff --git a/net/ipv4/netfilter/ip_nat_helper_pptp.c b/net/ipv4/netfilter/ip_nat_helper_pptp.c
index e546203f5662..ac004895781a 100644
--- a/net/ipv4/netfilter/ip_nat_helper_pptp.c
+++ b/net/ipv4/netfilter/ip_nat_helper_pptp.c
@@ -148,14 +148,14 @@ pptp_outbound_pkt(struct sk_buff **pskb,
148{ 148{
149 struct ip_ct_pptp_master *ct_pptp_info = &ct->help.ct_pptp_info; 149 struct ip_ct_pptp_master *ct_pptp_info = &ct->help.ct_pptp_info;
150 struct ip_nat_pptp *nat_pptp_info = &ct->nat.help.nat_pptp_info; 150 struct ip_nat_pptp *nat_pptp_info = &ct->nat.help.nat_pptp_info;
151 151 u_int16_t msg, new_callid;
152 u_int16_t msg, *cid = NULL, new_callid; 152 unsigned int cid_off;
153 153
154 new_callid = htons(ct_pptp_info->pns_call_id); 154 new_callid = htons(ct_pptp_info->pns_call_id);
155 155
156 switch (msg = ntohs(ctlh->messageType)) { 156 switch (msg = ntohs(ctlh->messageType)) {
157 case PPTP_OUT_CALL_REQUEST: 157 case PPTP_OUT_CALL_REQUEST:
158 cid = &pptpReq->ocreq.callID; 158 cid_off = offsetof(union pptp_ctrl_union, ocreq.callID);
159 /* FIXME: ideally we would want to reserve a call ID 159 /* FIXME: ideally we would want to reserve a call ID
160 * here. current netfilter NAT core is not able to do 160 * here. current netfilter NAT core is not able to do
161 * this :( For now we use TCP source port. This breaks 161 * this :( For now we use TCP source port. This breaks
@@ -172,10 +172,10 @@ pptp_outbound_pkt(struct sk_buff **pskb,
172 ct_pptp_info->pns_call_id = ntohs(new_callid); 172 ct_pptp_info->pns_call_id = ntohs(new_callid);
173 break; 173 break;
174 case PPTP_IN_CALL_REPLY: 174 case PPTP_IN_CALL_REPLY:
175 cid = &pptpReq->icreq.callID; 175 cid_off = offsetof(union pptp_ctrl_union, icreq.callID);
176 break; 176 break;
177 case PPTP_CALL_CLEAR_REQUEST: 177 case PPTP_CALL_CLEAR_REQUEST:
178 cid = &pptpReq->clrreq.callID; 178 cid_off = offsetof(union pptp_ctrl_union, clrreq.callID);
179 break; 179 break;
180 default: 180 default:
181 DEBUGP("unknown outbound packet 0x%04x:%s\n", msg, 181 DEBUGP("unknown outbound packet 0x%04x:%s\n", msg,
@@ -197,18 +197,15 @@ pptp_outbound_pkt(struct sk_buff **pskb,
197 197
198 /* only OUT_CALL_REQUEST, IN_CALL_REPLY, CALL_CLEAR_REQUEST pass 198 /* only OUT_CALL_REQUEST, IN_CALL_REPLY, CALL_CLEAR_REQUEST pass
199 * down to here */ 199 * down to here */
200
201 IP_NF_ASSERT(cid);
202
203 DEBUGP("altering call id from 0x%04x to 0x%04x\n", 200 DEBUGP("altering call id from 0x%04x to 0x%04x\n",
204 ntohs(*cid), ntohs(new_callid)); 201 ntohs(*(u_int16_t *)pptpReq + cid_off), ntohs(new_callid));
205 202
206 /* mangle packet */ 203 /* mangle packet */
207 if (ip_nat_mangle_tcp_packet(pskb, ct, ctinfo, 204 if (ip_nat_mangle_tcp_packet(pskb, ct, ctinfo,
208 (void *)cid - ((void *)ctlh - sizeof(struct pptp_pkt_hdr)), 205 cid_off + sizeof(struct pptp_pkt_hdr) +
209 sizeof(new_callid), 206 sizeof(struct PptpControlHeader),
210 (char *)&new_callid, 207 sizeof(new_callid), (char *)&new_callid,
211 sizeof(new_callid)) == 0) 208 sizeof(new_callid)) == 0)
212 return NF_DROP; 209 return NF_DROP;
213 210
214 return NF_ACCEPT; 211 return NF_ACCEPT;
@@ -299,31 +296,30 @@ pptp_inbound_pkt(struct sk_buff **pskb,
299 union pptp_ctrl_union *pptpReq) 296 union pptp_ctrl_union *pptpReq)
300{ 297{
301 struct ip_nat_pptp *nat_pptp_info = &ct->nat.help.nat_pptp_info; 298 struct ip_nat_pptp *nat_pptp_info = &ct->nat.help.nat_pptp_info;
302 u_int16_t msg, new_cid = 0, new_pcid, *pcid = NULL, *cid = NULL; 299 u_int16_t msg, new_cid = 0, new_pcid;
303 300 unsigned int pcid_off, cid_off = 0;
304 int ret = NF_ACCEPT, rv;
305 301
306 new_pcid = htons(nat_pptp_info->pns_call_id); 302 new_pcid = htons(nat_pptp_info->pns_call_id);
307 303
308 switch (msg = ntohs(ctlh->messageType)) { 304 switch (msg = ntohs(ctlh->messageType)) {
309 case PPTP_OUT_CALL_REPLY: 305 case PPTP_OUT_CALL_REPLY:
310 pcid = &pptpReq->ocack.peersCallID; 306 pcid_off = offsetof(union pptp_ctrl_union, ocack.peersCallID);
311 cid = &pptpReq->ocack.callID; 307 cid_off = offsetof(union pptp_ctrl_union, ocack.callID);
312 break; 308 break;
313 case PPTP_IN_CALL_CONNECT: 309 case PPTP_IN_CALL_CONNECT:
314 pcid = &pptpReq->iccon.peersCallID; 310 pcid_off = offsetof(union pptp_ctrl_union, iccon.peersCallID);
315 break; 311 break;
316 case PPTP_IN_CALL_REQUEST: 312 case PPTP_IN_CALL_REQUEST:
317 /* only need to nat in case PAC is behind NAT box */ 313 /* only need to nat in case PAC is behind NAT box */
318 break; 314 return NF_ACCEPT;
319 case PPTP_WAN_ERROR_NOTIFY: 315 case PPTP_WAN_ERROR_NOTIFY:
320 pcid = &pptpReq->wanerr.peersCallID; 316 pcid_off = offsetof(union pptp_ctrl_union, wanerr.peersCallID);
321 break; 317 break;
322 case PPTP_CALL_DISCONNECT_NOTIFY: 318 case PPTP_CALL_DISCONNECT_NOTIFY:
323 pcid = &pptpReq->disc.callID; 319 pcid_off = offsetof(union pptp_ctrl_union, disc.callID);
324 break; 320 break;
325 case PPTP_SET_LINK_INFO: 321 case PPTP_SET_LINK_INFO:
326 pcid = &pptpReq->setlink.peersCallID; 322 pcid_off = offsetof(union pptp_ctrl_union, setlink.peersCallID);
327 break; 323 break;
328 324
329 default: 325 default:
@@ -345,35 +341,26 @@ pptp_inbound_pkt(struct sk_buff **pskb,
345 * WAN_ERROR_NOTIFY, CALL_DISCONNECT_NOTIFY pass down here */ 341 * WAN_ERROR_NOTIFY, CALL_DISCONNECT_NOTIFY pass down here */
346 342
347 /* mangle packet */ 343 /* mangle packet */
348 IP_NF_ASSERT(pcid);
349 DEBUGP("altering peer call id from 0x%04x to 0x%04x\n", 344 DEBUGP("altering peer call id from 0x%04x to 0x%04x\n",
350 ntohs(*pcid), ntohs(new_pcid)); 345 ntohs(*(u_int16_t *)pptpReq + pcid_off), ntohs(new_pcid));
351 346
352 rv = ip_nat_mangle_tcp_packet(pskb, ct, ctinfo, 347 if (ip_nat_mangle_tcp_packet(pskb, ct, ctinfo,
353 (void *)pcid - ((void *)ctlh - sizeof(struct pptp_pkt_hdr)), 348 pcid_off + sizeof(struct pptp_pkt_hdr) +
354 sizeof(new_pcid), (char *)&new_pcid, 349 sizeof(struct PptpControlHeader),
355 sizeof(new_pcid)); 350 sizeof(new_pcid), (char *)&new_pcid,
356 if (rv != NF_ACCEPT) 351 sizeof(new_pcid)) == 0)
357 return rv; 352 return NF_DROP;
358 353
359 if (new_cid) { 354 if (new_cid) {
360 IP_NF_ASSERT(cid);
361 DEBUGP("altering call id from 0x%04x to 0x%04x\n", 355 DEBUGP("altering call id from 0x%04x to 0x%04x\n",
362 ntohs(*cid), ntohs(new_cid)); 356 ntohs(*(u_int16_t *)pptpReq + cid_off), ntohs(new_cid));
363 rv = ip_nat_mangle_tcp_packet(pskb, ct, ctinfo, 357 if (ip_nat_mangle_tcp_packet(pskb, ct, ctinfo,
364 (void *)cid - ((void *)ctlh - sizeof(struct pptp_pkt_hdr)), 358 cid_off + sizeof(struct pptp_pkt_hdr) +
365 sizeof(new_cid), 359 sizeof(struct PptpControlHeader),
366 (char *)&new_cid, 360 sizeof(new_cid), (char *)&new_cid,
367 sizeof(new_cid)); 361 sizeof(new_cid)) == 0)
368 if (rv != NF_ACCEPT) 362 return NF_DROP;
369 return rv;
370 } 363 }
371
372 /* check for earlier return value of 'switch' above */
373 if (ret != NF_ACCEPT)
374 return ret;
375
376 /* great, at least we don't need to resize packets */
377 return NF_ACCEPT; 364 return NF_ACCEPT;
378} 365}
379 366
diff --git a/net/ipv4/netfilter/ip_nat_proto_gre.c b/net/ipv4/netfilter/ip_nat_proto_gre.c
index f7cad7cf1aec..6c4899d8046a 100644
--- a/net/ipv4/netfilter/ip_nat_proto_gre.c
+++ b/net/ipv4/netfilter/ip_nat_proto_gre.c
@@ -151,42 +151,6 @@ gre_manip_pkt(struct sk_buff **pskb,
151 return 1; 151 return 1;
152} 152}
153 153
154/* print out a nat tuple */
155static unsigned int
156gre_print(char *buffer,
157 const struct ip_conntrack_tuple *match,
158 const struct ip_conntrack_tuple *mask)
159{
160 unsigned int len = 0;
161
162 if (mask->src.u.gre.key)
163 len += sprintf(buffer + len, "srckey=0x%x ",
164 ntohl(match->src.u.gre.key));
165
166 if (mask->dst.u.gre.key)
167 len += sprintf(buffer + len, "dstkey=0x%x ",
168 ntohl(match->src.u.gre.key));
169
170 return len;
171}
172
173/* print a range of keys */
174static unsigned int
175gre_print_range(char *buffer, const struct ip_nat_range *range)
176{
177 if (range->min.gre.key != 0
178 || range->max.gre.key != 0xFFFF) {
179 if (range->min.gre.key == range->max.gre.key)
180 return sprintf(buffer, "key 0x%x ",
181 ntohl(range->min.gre.key));
182 else
183 return sprintf(buffer, "keys 0x%u-0x%u ",
184 ntohl(range->min.gre.key),
185 ntohl(range->max.gre.key));
186 } else
187 return 0;
188}
189
190/* nat helper struct */ 154/* nat helper struct */
191static struct ip_nat_protocol gre = { 155static struct ip_nat_protocol gre = {
192 .name = "GRE", 156 .name = "GRE",
@@ -194,8 +158,6 @@ static struct ip_nat_protocol gre = {
194 .manip_pkt = gre_manip_pkt, 158 .manip_pkt = gre_manip_pkt,
195 .in_range = gre_in_range, 159 .in_range = gre_in_range,
196 .unique_tuple = gre_unique_tuple, 160 .unique_tuple = gre_unique_tuple,
197 .print = gre_print,
198 .print_range = gre_print_range,
199#if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ 161#if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \
200 defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) 162 defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE)
201 .range_to_nfattr = ip_nat_port_range_to_nfattr, 163 .range_to_nfattr = ip_nat_port_range_to_nfattr,
diff --git a/net/ipv4/netfilter/ip_nat_proto_icmp.c b/net/ipv4/netfilter/ip_nat_proto_icmp.c
index 938719043999..31a3f4ccb99c 100644
--- a/net/ipv4/netfilter/ip_nat_proto_icmp.c
+++ b/net/ipv4/netfilter/ip_nat_proto_icmp.c
@@ -74,38 +74,6 @@ icmp_manip_pkt(struct sk_buff **pskb,
74 return 1; 74 return 1;
75} 75}
76 76
77static unsigned int
78icmp_print(char *buffer,
79 const struct ip_conntrack_tuple *match,
80 const struct ip_conntrack_tuple *mask)
81{
82 unsigned int len = 0;
83
84 if (mask->src.u.icmp.id)
85 len += sprintf(buffer + len, "id=%u ",
86 ntohs(match->src.u.icmp.id));
87
88 if (mask->dst.u.icmp.type)
89 len += sprintf(buffer + len, "type=%u ",
90 ntohs(match->dst.u.icmp.type));
91
92 if (mask->dst.u.icmp.code)
93 len += sprintf(buffer + len, "code=%u ",
94 ntohs(match->dst.u.icmp.code));
95
96 return len;
97}
98
99static unsigned int
100icmp_print_range(char *buffer, const struct ip_nat_range *range)
101{
102 if (range->min.icmp.id != 0 || range->max.icmp.id != 0xFFFF)
103 return sprintf(buffer, "id %u-%u ",
104 ntohs(range->min.icmp.id),
105 ntohs(range->max.icmp.id));
106 else return 0;
107}
108
109struct ip_nat_protocol ip_nat_protocol_icmp = { 77struct ip_nat_protocol ip_nat_protocol_icmp = {
110 .name = "ICMP", 78 .name = "ICMP",
111 .protonum = IPPROTO_ICMP, 79 .protonum = IPPROTO_ICMP,
@@ -113,8 +81,6 @@ struct ip_nat_protocol ip_nat_protocol_icmp = {
113 .manip_pkt = icmp_manip_pkt, 81 .manip_pkt = icmp_manip_pkt,
114 .in_range = icmp_in_range, 82 .in_range = icmp_in_range,
115 .unique_tuple = icmp_unique_tuple, 83 .unique_tuple = icmp_unique_tuple,
116 .print = icmp_print,
117 .print_range = icmp_print_range,
118#if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ 84#if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \
119 defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) 85 defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE)
120 .range_to_nfattr = ip_nat_port_range_to_nfattr, 86 .range_to_nfattr = ip_nat_port_range_to_nfattr,
diff --git a/net/ipv4/netfilter/ip_nat_proto_tcp.c b/net/ipv4/netfilter/ip_nat_proto_tcp.c
index 1d381bf68574..a3d14079eba6 100644
--- a/net/ipv4/netfilter/ip_nat_proto_tcp.c
+++ b/net/ipv4/netfilter/ip_nat_proto_tcp.c
@@ -136,40 +136,6 @@ tcp_manip_pkt(struct sk_buff **pskb,
136 return 1; 136 return 1;
137} 137}
138 138
139static unsigned int
140tcp_print(char *buffer,
141 const struct ip_conntrack_tuple *match,
142 const struct ip_conntrack_tuple *mask)
143{
144 unsigned int len = 0;
145
146 if (mask->src.u.tcp.port)
147 len += sprintf(buffer + len, "srcpt=%u ",
148 ntohs(match->src.u.tcp.port));
149
150
151 if (mask->dst.u.tcp.port)
152 len += sprintf(buffer + len, "dstpt=%u ",
153 ntohs(match->dst.u.tcp.port));
154
155 return len;
156}
157
158static unsigned int
159tcp_print_range(char *buffer, const struct ip_nat_range *range)
160{
161 if (range->min.tcp.port != 0 || range->max.tcp.port != 0xFFFF) {
162 if (range->min.tcp.port == range->max.tcp.port)
163 return sprintf(buffer, "port %u ",
164 ntohs(range->min.tcp.port));
165 else
166 return sprintf(buffer, "ports %u-%u ",
167 ntohs(range->min.tcp.port),
168 ntohs(range->max.tcp.port));
169 }
170 else return 0;
171}
172
173struct ip_nat_protocol ip_nat_protocol_tcp = { 139struct ip_nat_protocol ip_nat_protocol_tcp = {
174 .name = "TCP", 140 .name = "TCP",
175 .protonum = IPPROTO_TCP, 141 .protonum = IPPROTO_TCP,
@@ -177,8 +143,6 @@ struct ip_nat_protocol ip_nat_protocol_tcp = {
177 .manip_pkt = tcp_manip_pkt, 143 .manip_pkt = tcp_manip_pkt,
178 .in_range = tcp_in_range, 144 .in_range = tcp_in_range,
179 .unique_tuple = tcp_unique_tuple, 145 .unique_tuple = tcp_unique_tuple,
180 .print = tcp_print,
181 .print_range = tcp_print_range,
182#if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ 146#if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \
183 defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) 147 defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE)
184 .range_to_nfattr = ip_nat_port_range_to_nfattr, 148 .range_to_nfattr = ip_nat_port_range_to_nfattr,
diff --git a/net/ipv4/netfilter/ip_nat_proto_udp.c b/net/ipv4/netfilter/ip_nat_proto_udp.c
index c4906e1aa24a..ec6053fdc867 100644
--- a/net/ipv4/netfilter/ip_nat_proto_udp.c
+++ b/net/ipv4/netfilter/ip_nat_proto_udp.c
@@ -122,40 +122,6 @@ udp_manip_pkt(struct sk_buff **pskb,
122 return 1; 122 return 1;
123} 123}
124 124
125static unsigned int
126udp_print(char *buffer,
127 const struct ip_conntrack_tuple *match,
128 const struct ip_conntrack_tuple *mask)
129{
130 unsigned int len = 0;
131
132 if (mask->src.u.udp.port)
133 len += sprintf(buffer + len, "srcpt=%u ",
134 ntohs(match->src.u.udp.port));
135
136
137 if (mask->dst.u.udp.port)
138 len += sprintf(buffer + len, "dstpt=%u ",
139 ntohs(match->dst.u.udp.port));
140
141 return len;
142}
143
144static unsigned int
145udp_print_range(char *buffer, const struct ip_nat_range *range)
146{
147 if (range->min.udp.port != 0 || range->max.udp.port != 0xFFFF) {
148 if (range->min.udp.port == range->max.udp.port)
149 return sprintf(buffer, "port %u ",
150 ntohs(range->min.udp.port));
151 else
152 return sprintf(buffer, "ports %u-%u ",
153 ntohs(range->min.udp.port),
154 ntohs(range->max.udp.port));
155 }
156 else return 0;
157}
158
159struct ip_nat_protocol ip_nat_protocol_udp = { 125struct ip_nat_protocol ip_nat_protocol_udp = {
160 .name = "UDP", 126 .name = "UDP",
161 .protonum = IPPROTO_UDP, 127 .protonum = IPPROTO_UDP,
@@ -163,8 +129,6 @@ struct ip_nat_protocol ip_nat_protocol_udp = {
163 .manip_pkt = udp_manip_pkt, 129 .manip_pkt = udp_manip_pkt,
164 .in_range = udp_in_range, 130 .in_range = udp_in_range,
165 .unique_tuple = udp_unique_tuple, 131 .unique_tuple = udp_unique_tuple,
166 .print = udp_print,
167 .print_range = udp_print_range,
168#if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ 132#if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \
169 defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) 133 defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE)
170 .range_to_nfattr = ip_nat_port_range_to_nfattr, 134 .range_to_nfattr = ip_nat_port_range_to_nfattr,
diff --git a/net/ipv4/netfilter/ip_nat_proto_unknown.c b/net/ipv4/netfilter/ip_nat_proto_unknown.c
index f0099a646a0b..3bf049517246 100644
--- a/net/ipv4/netfilter/ip_nat_proto_unknown.c
+++ b/net/ipv4/netfilter/ip_nat_proto_unknown.c
@@ -46,26 +46,10 @@ unknown_manip_pkt(struct sk_buff **pskb,
46 return 1; 46 return 1;
47} 47}
48 48
49static unsigned int
50unknown_print(char *buffer,
51 const struct ip_conntrack_tuple *match,
52 const struct ip_conntrack_tuple *mask)
53{
54 return 0;
55}
56
57static unsigned int
58unknown_print_range(char *buffer, const struct ip_nat_range *range)
59{
60 return 0;
61}
62
63struct ip_nat_protocol ip_nat_unknown_protocol = { 49struct ip_nat_protocol ip_nat_unknown_protocol = {
64 .name = "unknown", 50 .name = "unknown",
65 /* .me isn't set: getting a ref to this cannot fail. */ 51 /* .me isn't set: getting a ref to this cannot fail. */
66 .manip_pkt = unknown_manip_pkt, 52 .manip_pkt = unknown_manip_pkt,
67 .in_range = unknown_in_range, 53 .in_range = unknown_in_range,
68 .unique_tuple = unknown_unique_tuple, 54 .unique_tuple = unknown_unique_tuple,
69 .print = unknown_print,
70 .print_range = unknown_print_range
71}; 55};
diff --git a/net/ipv4/netfilter/ipt_mac.c b/net/ipv4/netfilter/ipt_mac.c
index 11a459e33f25..1b9bb4559f80 100644
--- a/net/ipv4/netfilter/ipt_mac.c
+++ b/net/ipv4/netfilter/ipt_mac.c
@@ -11,6 +11,7 @@
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/skbuff.h> 12#include <linux/skbuff.h>
13#include <linux/if_ether.h> 13#include <linux/if_ether.h>
14#include <linux/etherdevice.h>
14 15
15#include <linux/netfilter_ipv4/ipt_mac.h> 16#include <linux/netfilter_ipv4/ipt_mac.h>
16#include <linux/netfilter_ipv4/ip_tables.h> 17#include <linux/netfilter_ipv4/ip_tables.h>
@@ -33,8 +34,8 @@ match(const struct sk_buff *skb,
33 return (skb->mac.raw >= skb->head 34 return (skb->mac.raw >= skb->head
34 && (skb->mac.raw + ETH_HLEN) <= skb->data 35 && (skb->mac.raw + ETH_HLEN) <= skb->data
35 /* If so, compare... */ 36 /* If so, compare... */
36 && ((memcmp(eth_hdr(skb)->h_source, info->srcaddr, ETH_ALEN) 37 && ((!compare_ether_addr(eth_hdr(skb)->h_source, info->srcaddr))
37 == 0) ^ info->invert)); 38 ^ info->invert));
38} 39}
39 40
40static int 41static int
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
index 9bdbb7793971..0c56c52a3831 100644
--- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
+++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
@@ -277,7 +277,7 @@ static struct nf_hook_ops ipv4_conntrack_local_in_ops = {
277 277
278#ifdef CONFIG_SYSCTL 278#ifdef CONFIG_SYSCTL
279/* From nf_conntrack_proto_icmp.c */ 279/* From nf_conntrack_proto_icmp.c */
280extern unsigned long nf_ct_icmp_timeout; 280extern unsigned int nf_ct_icmp_timeout;
281static struct ctl_table_header *nf_ct_ipv4_sysctl_header; 281static struct ctl_table_header *nf_ct_ipv4_sysctl_header;
282 282
283static ctl_table nf_ct_sysctl_table[] = { 283static ctl_table nf_ct_sysctl_table[] = {
diff --git a/net/ipv6/Makefile b/net/ipv6/Makefile
index 9601fd7f9d66..bf18cff13120 100644
--- a/net/ipv6/Makefile
+++ b/net/ipv6/Makefile
@@ -8,8 +8,7 @@ ipv6-objs := af_inet6.o anycast.o ip6_output.o ip6_input.o addrconf.o sit.o \
8 route.o ip6_fib.o ipv6_sockglue.o ndisc.o udp.o raw.o \ 8 route.o ip6_fib.o ipv6_sockglue.o ndisc.o udp.o raw.o \
9 protocol.o icmp.o mcast.o reassembly.o tcp_ipv6.o \ 9 protocol.o icmp.o mcast.o reassembly.o tcp_ipv6.o \
10 exthdrs.o sysctl_net_ipv6.o datagram.o proc.o \ 10 exthdrs.o sysctl_net_ipv6.o datagram.o proc.o \
11 ip6_flowlabel.o ipv6_syms.o netfilter.o \ 11 ip6_flowlabel.o ipv6_syms.o inet6_connection_sock.o
12 inet6_connection_sock.o
13 12
14ipv6-$(CONFIG_XFRM) += xfrm6_policy.o xfrm6_state.o xfrm6_input.o \ 13ipv6-$(CONFIG_XFRM) += xfrm6_policy.o xfrm6_state.o xfrm6_input.o \
15 xfrm6_output.o 14 xfrm6_output.o
@@ -19,7 +18,7 @@ obj-$(CONFIG_INET6_AH) += ah6.o
19obj-$(CONFIG_INET6_ESP) += esp6.o 18obj-$(CONFIG_INET6_ESP) += esp6.o
20obj-$(CONFIG_INET6_IPCOMP) += ipcomp6.o 19obj-$(CONFIG_INET6_IPCOMP) += ipcomp6.o
21obj-$(CONFIG_INET6_TUNNEL) += xfrm6_tunnel.o 20obj-$(CONFIG_INET6_TUNNEL) += xfrm6_tunnel.o
22obj-$(CONFIG_NETFILTER) += netfilter/ 21obj-$(CONFIG_NETFILTER) += netfilter.o netfilter/
23 22
24obj-$(CONFIG_IPV6_TUNNEL) += ip6_tunnel.o 23obj-$(CONFIG_IPV6_TUNNEL) += ip6_tunnel.o
25 24
diff --git a/net/ipv6/netfilter.c b/net/ipv6/netfilter.c
index b63678328a3b..1ab62f033664 100644
--- a/net/ipv6/netfilter.c
+++ b/net/ipv6/netfilter.c
@@ -1,9 +1,5 @@
1#include <linux/config.h>
2#include <linux/init.h>
3
4#ifdef CONFIG_NETFILTER
5
6#include <linux/kernel.h> 1#include <linux/kernel.h>
2#include <linux/init.h>
7#include <linux/ipv6.h> 3#include <linux/ipv6.h>
8#include <linux/netfilter.h> 4#include <linux/netfilter.h>
9#include <linux/netfilter_ipv6.h> 5#include <linux/netfilter_ipv6.h>
@@ -94,18 +90,7 @@ int __init ipv6_netfilter_init(void)
94 return nf_register_queue_rerouter(PF_INET6, &ip6_reroute); 90 return nf_register_queue_rerouter(PF_INET6, &ip6_reroute);
95} 91}
96 92
97void ipv6_netfilter_fini(void) 93void __exit ipv6_netfilter_fini(void)
98{ 94{
99 nf_unregister_queue_rerouter(PF_INET6); 95 nf_unregister_queue_rerouter(PF_INET6);
100} 96}
101
102#else /* CONFIG_NETFILTER */
103int __init ipv6_netfilter_init(void)
104{
105 return 0;
106}
107
108void ipv6_netfilter_fini(void)
109{
110}
111#endif /* CONFIG_NETFILTER */
diff --git a/net/ipv6/netfilter/ip6t_mac.c b/net/ipv6/netfilter/ip6t_mac.c
index 526d43e37234..ae0b09291d17 100644
--- a/net/ipv6/netfilter/ip6t_mac.c
+++ b/net/ipv6/netfilter/ip6t_mac.c
@@ -34,8 +34,8 @@ match(const struct sk_buff *skb,
34 return (skb->mac.raw >= skb->head 34 return (skb->mac.raw >= skb->head
35 && (skb->mac.raw + ETH_HLEN) <= skb->data 35 && (skb->mac.raw + ETH_HLEN) <= skb->data
36 /* If so, compare... */ 36 /* If so, compare... */
37 && ((memcmp(eth_hdr(skb)->h_source, info->srcaddr, ETH_ALEN) 37 && ((!compare_ether_addr(eth_hdr(skb)->h_source, info->srcaddr))
38 == 0) ^ info->invert)); 38 ^ info->invert));
39} 39}
40 40
41static int 41static int
diff --git a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
index 704fbbe74874..e57d6fc9957a 100644
--- a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
+++ b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
@@ -335,10 +335,10 @@ static struct nf_hook_ops ipv6_conntrack_local_in_ops = {
335#ifdef CONFIG_SYSCTL 335#ifdef CONFIG_SYSCTL
336 336
337/* From nf_conntrack_proto_icmpv6.c */ 337/* From nf_conntrack_proto_icmpv6.c */
338extern unsigned long nf_ct_icmpv6_timeout; 338extern unsigned int nf_ct_icmpv6_timeout;
339 339
340/* From nf_conntrack_frag6.c */ 340/* From nf_conntrack_frag6.c */
341extern unsigned long nf_ct_frag6_timeout; 341extern unsigned int nf_ct_frag6_timeout;
342extern unsigned int nf_ct_frag6_low_thresh; 342extern unsigned int nf_ct_frag6_low_thresh;
343extern unsigned int nf_ct_frag6_high_thresh; 343extern unsigned int nf_ct_frag6_high_thresh;
344 344
diff --git a/net/netfilter/nf_conntrack_proto_generic.c b/net/netfilter/nf_conntrack_proto_generic.c
index 36425f6c833f..46bc27e2756d 100644
--- a/net/netfilter/nf_conntrack_proto_generic.c
+++ b/net/netfilter/nf_conntrack_proto_generic.c
@@ -17,7 +17,7 @@
17#include <linux/netfilter.h> 17#include <linux/netfilter.h>
18#include <net/netfilter/nf_conntrack_protocol.h> 18#include <net/netfilter/nf_conntrack_protocol.h>
19 19
20unsigned long nf_ct_generic_timeout = 600*HZ; 20unsigned int nf_ct_generic_timeout = 600*HZ;
21 21
22static int generic_pkt_to_tuple(const struct sk_buff *skb, 22static int generic_pkt_to_tuple(const struct sk_buff *skb,
23 unsigned int dataoff, 23 unsigned int dataoff,
diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c
index 3a600f77b4e0..cf798e61e379 100644
--- a/net/netfilter/nf_conntrack_proto_sctp.c
+++ b/net/netfilter/nf_conntrack_proto_sctp.c
@@ -62,15 +62,15 @@ static const char *sctp_conntrack_names[] = {
62#define HOURS * 60 MINS 62#define HOURS * 60 MINS
63#define DAYS * 24 HOURS 63#define DAYS * 24 HOURS
64 64
65static unsigned long nf_ct_sctp_timeout_closed = 10 SECS; 65static unsigned int nf_ct_sctp_timeout_closed = 10 SECS;
66static unsigned long nf_ct_sctp_timeout_cookie_wait = 3 SECS; 66static unsigned int nf_ct_sctp_timeout_cookie_wait = 3 SECS;
67static unsigned long nf_ct_sctp_timeout_cookie_echoed = 3 SECS; 67static unsigned int nf_ct_sctp_timeout_cookie_echoed = 3 SECS;
68static unsigned long nf_ct_sctp_timeout_established = 5 DAYS; 68static unsigned int nf_ct_sctp_timeout_established = 5 DAYS;
69static unsigned long nf_ct_sctp_timeout_shutdown_sent = 300 SECS / 1000; 69static unsigned int nf_ct_sctp_timeout_shutdown_sent = 300 SECS / 1000;
70static unsigned long nf_ct_sctp_timeout_shutdown_recd = 300 SECS / 1000; 70static unsigned int nf_ct_sctp_timeout_shutdown_recd = 300 SECS / 1000;
71static unsigned long nf_ct_sctp_timeout_shutdown_ack_sent = 3 SECS; 71static unsigned int nf_ct_sctp_timeout_shutdown_ack_sent = 3 SECS;
72 72
73static unsigned long * sctp_timeouts[] 73static unsigned int * sctp_timeouts[]
74= { NULL, /* SCTP_CONNTRACK_NONE */ 74= { NULL, /* SCTP_CONNTRACK_NONE */
75 &nf_ct_sctp_timeout_closed, /* SCTP_CONNTRACK_CLOSED */ 75 &nf_ct_sctp_timeout_closed, /* SCTP_CONNTRACK_CLOSED */
76 &nf_ct_sctp_timeout_cookie_wait, /* SCTP_CONNTRACK_COOKIE_WAIT */ 76 &nf_ct_sctp_timeout_cookie_wait, /* SCTP_CONNTRACK_COOKIE_WAIT */
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c
index 9a1348a51a0d..df99138c3b3b 100644
--- a/net/netfilter/nf_conntrack_proto_tcp.c
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
@@ -93,21 +93,21 @@ static const char *tcp_conntrack_names[] = {
93#define HOURS * 60 MINS 93#define HOURS * 60 MINS
94#define DAYS * 24 HOURS 94#define DAYS * 24 HOURS
95 95
96unsigned long nf_ct_tcp_timeout_syn_sent = 2 MINS; 96unsigned int nf_ct_tcp_timeout_syn_sent = 2 MINS;
97unsigned long nf_ct_tcp_timeout_syn_recv = 60 SECS; 97unsigned int nf_ct_tcp_timeout_syn_recv = 60 SECS;
98unsigned long nf_ct_tcp_timeout_established = 5 DAYS; 98unsigned int nf_ct_tcp_timeout_established = 5 DAYS;
99unsigned long nf_ct_tcp_timeout_fin_wait = 2 MINS; 99unsigned int nf_ct_tcp_timeout_fin_wait = 2 MINS;
100unsigned long nf_ct_tcp_timeout_close_wait = 60 SECS; 100unsigned int nf_ct_tcp_timeout_close_wait = 60 SECS;
101unsigned long nf_ct_tcp_timeout_last_ack = 30 SECS; 101unsigned int nf_ct_tcp_timeout_last_ack = 30 SECS;
102unsigned long nf_ct_tcp_timeout_time_wait = 2 MINS; 102unsigned int nf_ct_tcp_timeout_time_wait = 2 MINS;
103unsigned long nf_ct_tcp_timeout_close = 10 SECS; 103unsigned int nf_ct_tcp_timeout_close = 10 SECS;
104 104
105/* RFC1122 says the R2 limit should be at least 100 seconds. 105/* RFC1122 says the R2 limit should be at least 100 seconds.
106 Linux uses 15 packets as limit, which corresponds 106 Linux uses 15 packets as limit, which corresponds
107 to ~13-30min depending on RTO. */ 107 to ~13-30min depending on RTO. */
108unsigned long nf_ct_tcp_timeout_max_retrans = 5 MINS; 108unsigned int nf_ct_tcp_timeout_max_retrans = 5 MINS;
109 109
110static unsigned long * tcp_timeouts[] 110static unsigned int * tcp_timeouts[]
111= { NULL, /* TCP_CONNTRACK_NONE */ 111= { NULL, /* TCP_CONNTRACK_NONE */
112 &nf_ct_tcp_timeout_syn_sent, /* TCP_CONNTRACK_SYN_SENT, */ 112 &nf_ct_tcp_timeout_syn_sent, /* TCP_CONNTRACK_SYN_SENT, */
113 &nf_ct_tcp_timeout_syn_recv, /* TCP_CONNTRACK_SYN_RECV, */ 113 &nf_ct_tcp_timeout_syn_recv, /* TCP_CONNTRACK_SYN_RECV, */
diff --git a/net/netfilter/nf_conntrack_proto_udp.c b/net/netfilter/nf_conntrack_proto_udp.c
index 1a592a556182..4264dd079a16 100644
--- a/net/netfilter/nf_conntrack_proto_udp.c
+++ b/net/netfilter/nf_conntrack_proto_udp.c
@@ -27,8 +27,8 @@
27#include <linux/netfilter_ipv6.h> 27#include <linux/netfilter_ipv6.h>
28#include <net/netfilter/nf_conntrack_protocol.h> 28#include <net/netfilter/nf_conntrack_protocol.h>
29 29
30unsigned long nf_ct_udp_timeout = 30*HZ; 30unsigned int nf_ct_udp_timeout = 30*HZ;
31unsigned long nf_ct_udp_timeout_stream = 180*HZ; 31unsigned int nf_ct_udp_timeout_stream = 180*HZ;
32 32
33static int udp_pkt_to_tuple(const struct sk_buff *skb, 33static int udp_pkt_to_tuple(const struct sk_buff *skb,
34 unsigned int dataoff, 34 unsigned int dataoff,
diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c
index d17e42b28c79..3531d142f693 100644
--- a/net/netfilter/nf_conntrack_standalone.c
+++ b/net/netfilter/nf_conntrack_standalone.c
@@ -431,25 +431,25 @@ extern int nf_conntrack_max;
431extern unsigned int nf_conntrack_htable_size; 431extern unsigned int nf_conntrack_htable_size;
432 432
433/* From nf_conntrack_proto_tcp.c */ 433/* From nf_conntrack_proto_tcp.c */
434extern unsigned long nf_ct_tcp_timeout_syn_sent; 434extern unsigned int nf_ct_tcp_timeout_syn_sent;
435extern unsigned long nf_ct_tcp_timeout_syn_recv; 435extern unsigned int nf_ct_tcp_timeout_syn_recv;
436extern unsigned long nf_ct_tcp_timeout_established; 436extern unsigned int nf_ct_tcp_timeout_established;
437extern unsigned long nf_ct_tcp_timeout_fin_wait; 437extern unsigned int nf_ct_tcp_timeout_fin_wait;
438extern unsigned long nf_ct_tcp_timeout_close_wait; 438extern unsigned int nf_ct_tcp_timeout_close_wait;
439extern unsigned long nf_ct_tcp_timeout_last_ack; 439extern unsigned int nf_ct_tcp_timeout_last_ack;
440extern unsigned long nf_ct_tcp_timeout_time_wait; 440extern unsigned int nf_ct_tcp_timeout_time_wait;
441extern unsigned long nf_ct_tcp_timeout_close; 441extern unsigned int nf_ct_tcp_timeout_close;
442extern unsigned long nf_ct_tcp_timeout_max_retrans; 442extern unsigned int nf_ct_tcp_timeout_max_retrans;
443extern int nf_ct_tcp_loose; 443extern int nf_ct_tcp_loose;
444extern int nf_ct_tcp_be_liberal; 444extern int nf_ct_tcp_be_liberal;
445extern int nf_ct_tcp_max_retrans; 445extern int nf_ct_tcp_max_retrans;
446 446
447/* From nf_conntrack_proto_udp.c */ 447/* From nf_conntrack_proto_udp.c */
448extern unsigned long nf_ct_udp_timeout; 448extern unsigned int nf_ct_udp_timeout;
449extern unsigned long nf_ct_udp_timeout_stream; 449extern unsigned int nf_ct_udp_timeout_stream;
450 450
451/* From nf_conntrack_proto_generic.c */ 451/* From nf_conntrack_proto_generic.c */
452extern unsigned long nf_ct_generic_timeout; 452extern unsigned int nf_ct_generic_timeout;
453 453
454/* Log invalid packets of a given protocol */ 454/* Log invalid packets of a given protocol */
455static int log_invalid_proto_min = 0; 455static int log_invalid_proto_min = 0;
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index a67f1b44c9a3..bb50c8a9fcad 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1422,7 +1422,7 @@ static int netlink_rcv_skb(struct sk_buff *skb, int (*cb)(struct sk_buff *,
1422 while (skb->len >= nlmsg_total_size(0)) { 1422 while (skb->len >= nlmsg_total_size(0)) {
1423 nlh = (struct nlmsghdr *) skb->data; 1423 nlh = (struct nlmsghdr *) skb->data;
1424 1424
1425 if (skb->len < nlh->nlmsg_len) 1425 if (nlh->nlmsg_len < NLMSG_HDRLEN || skb->len < nlh->nlmsg_len)
1426 return 0; 1426 return 0;
1427 1427
1428 total_len = min(NLMSG_ALIGN(nlh->nlmsg_len), skb->len); 1428 total_len = min(NLMSG_ALIGN(nlh->nlmsg_len), skb->len);
diff --git a/net/rxrpc/connection.c b/net/rxrpc/connection.c
index 2ba14a75dbbe..0e0a4553499f 100644
--- a/net/rxrpc/connection.c
+++ b/net/rxrpc/connection.c
@@ -220,6 +220,7 @@ int rxrpc_connection_lookup(struct rxrpc_peer *peer,
220{ 220{
221 struct rxrpc_connection *conn, *candidate = NULL; 221 struct rxrpc_connection *conn, *candidate = NULL;
222 struct list_head *_p; 222 struct list_head *_p;
223 struct sk_buff *pkt = msg->pkt;
223 int ret, fresh = 0; 224 int ret, fresh = 0;
224 __be32 x_epoch, x_connid; 225 __be32 x_epoch, x_connid;
225 __be16 x_port, x_servid; 226 __be16 x_port, x_servid;
@@ -229,10 +230,10 @@ int rxrpc_connection_lookup(struct rxrpc_peer *peer,
229 _enter("%p{{%hu}},%u,%hu", 230 _enter("%p{{%hu}},%u,%hu",
230 peer, 231 peer,
231 peer->trans->port, 232 peer->trans->port,
232 ntohs(msg->pkt->h.uh->source), 233 ntohs(pkt->h.uh->source),
233 ntohs(msg->hdr.serviceId)); 234 ntohs(msg->hdr.serviceId));
234 235
235 x_port = msg->pkt->h.uh->source; 236 x_port = pkt->h.uh->source;
236 x_epoch = msg->hdr.epoch; 237 x_epoch = msg->hdr.epoch;
237 x_clflag = msg->hdr.flags & RXRPC_CLIENT_INITIATED; 238 x_clflag = msg->hdr.flags & RXRPC_CLIENT_INITIATED;
238 x_connid = htonl(ntohl(msg->hdr.cid) & RXRPC_CIDMASK); 239 x_connid = htonl(ntohl(msg->hdr.cid) & RXRPC_CIDMASK);
@@ -267,7 +268,7 @@ int rxrpc_connection_lookup(struct rxrpc_peer *peer,
267 /* fill in the specifics */ 268 /* fill in the specifics */
268 candidate->addr.sin_family = AF_INET; 269 candidate->addr.sin_family = AF_INET;
269 candidate->addr.sin_port = x_port; 270 candidate->addr.sin_port = x_port;
270 candidate->addr.sin_addr.s_addr = msg->pkt->nh.iph->saddr; 271 candidate->addr.sin_addr.s_addr = pkt->nh.iph->saddr;
271 candidate->in_epoch = x_epoch; 272 candidate->in_epoch = x_epoch;
272 candidate->out_epoch = x_epoch; 273 candidate->out_epoch = x_epoch;
273 candidate->in_clientflag = RXRPC_CLIENT_INITIATED; 274 candidate->in_clientflag = RXRPC_CLIENT_INITIATED;
@@ -675,6 +676,7 @@ int rxrpc_conn_receive_call_packet(struct rxrpc_connection *conn,
675 struct rxrpc_message *msg) 676 struct rxrpc_message *msg)
676{ 677{
677 struct rxrpc_message *pmsg; 678 struct rxrpc_message *pmsg;
679 struct dst_entry *dst;
678 struct list_head *_p; 680 struct list_head *_p;
679 unsigned cix, seq; 681 unsigned cix, seq;
680 int ret = 0; 682 int ret = 0;
@@ -710,10 +712,10 @@ int rxrpc_conn_receive_call_packet(struct rxrpc_connection *conn,
710 712
711 call->pkt_rcv_count++; 713 call->pkt_rcv_count++;
712 714
713 if (msg->pkt->dst && msg->pkt->dst->dev) 715 dst = msg->pkt->dst;
716 if (dst && dst->dev)
714 conn->peer->if_mtu = 717 conn->peer->if_mtu =
715 msg->pkt->dst->dev->mtu - 718 dst->dev->mtu - dst->dev->hard_header_len;
716 msg->pkt->dst->dev->hard_header_len;
717 719
718 /* queue on the call in seq order */ 720 /* queue on the call in seq order */
719 rxrpc_get_message(msg); 721 rxrpc_get_message(msg);
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index b19cc26fa9c2..a8bd34d47425 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -166,8 +166,8 @@ svc_create_thread(svc_thread_fn func, struct svc_serv *serv)
166 memset(rqstp, 0, sizeof(*rqstp)); 166 memset(rqstp, 0, sizeof(*rqstp));
167 init_waitqueue_head(&rqstp->rq_wait); 167 init_waitqueue_head(&rqstp->rq_wait);
168 168
169 if (!(rqstp->rq_argp = (u32 *) kmalloc(serv->sv_xdrsize, GFP_KERNEL)) 169 if (!(rqstp->rq_argp = kmalloc(serv->sv_xdrsize, GFP_KERNEL))
170 || !(rqstp->rq_resp = (u32 *) kmalloc(serv->sv_xdrsize, GFP_KERNEL)) 170 || !(rqstp->rq_resp = kmalloc(serv->sv_xdrsize, GFP_KERNEL))
171 || !svc_init_buffer(rqstp, serv->sv_bufsz)) 171 || !svc_init_buffer(rqstp, serv->sv_bufsz))
172 goto out_thread; 172 goto out_thread;
173 173