Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

+188 -423
+7 -5
drivers/atm/zatm.c
··· 669 669 u32 *put; 670 670 int i; 671 671 672 - dsc = (u32 *) kmalloc(uPD98401_TXPD_SIZE*2+ 673 - uPD98401_TXBD_SIZE*ATM_SKB(skb)->iovcnt,GFP_ATOMIC); 672 + dsc = kmalloc(uPD98401_TXPD_SIZE * 2 + 673 + uPD98401_TXBD_SIZE * ATM_SKB(skb)->iovcnt, GFP_ATOMIC); 674 674 if (!dsc) { 675 - if (vcc->pop) vcc->pop(vcc,skb); 676 - else dev_kfree_skb_irq(skb); 675 + if (vcc->pop) 676 + vcc->pop(vcc, skb); 677 + else 678 + dev_kfree_skb_irq(skb); 677 679 return -EAGAIN; 678 680 } 679 681 /* @@@ should check alignment */ ··· 685 683 (ATM_SKB(skb)->atm_options & ATM_ATMOPT_CLP ? 686 684 uPD98401_CLPM_1 : uPD98401_CLPM_0)); 687 685 dsc[1] = 0; 688 - dsc[2] = ATM_SKB(skb)->iovcnt*uPD98401_TXBD_SIZE; 686 + dsc[2] = ATM_SKB(skb)->iovcnt * uPD98401_TXBD_SIZE; 689 687 dsc[3] = virt_to_bus(put); 690 688 for (i = 0; i < ATM_SKB(skb)->iovcnt; i++) { 691 689 *put++ = ((struct iovec *) skb->data)[i].iov_len;
+1 -2
drivers/net/irda/Kconfig
··· 1 - 2 1 menu "Infrared-port device drivers" 3 2 depends on IRDA!=n 4 3 ··· 155 156 156 157 config DONGLE_OLD 157 158 bool "Old Serial dongle support" 158 - depends on (IRTTY_OLD || IRPORT_SIR) && BROKEN_ON_SMP 159 + depends on IRPORT_SIR && BROKEN_ON_SMP 159 160 help 160 161 Say Y here if you have an infrared device that connects to your 161 162 computer's serial port. These devices are called dongles. Then say Y
+1 -1
drivers/net/irda/Makefile
··· 45 45 obj-$(CONFIG_MA600_DONGLE) += ma600-sir.o 46 46 47 47 # The SIR helper module 48 - sir-dev-objs := sir_core.o sir_dev.o sir_dongle.o sir_kthread.o 48 + sir-dev-objs := sir_dev.o sir_dongle.o sir_kthread.o
-2
drivers/net/irda/sir-dev.h
··· 133 133 134 134 extern void sirdev_enable_rx(struct sir_dev *dev); 135 135 extern int sirdev_schedule_request(struct sir_dev *dev, int state, unsigned param); 136 - extern int __init irda_thread_create(void); 137 - extern void __exit irda_thread_join(void); 138 136 139 137 /* inline helpers */ 140 138
-56
drivers/net/irda/sir_core.c
··· 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 - 24 - MODULE_AUTHOR("Martin Diehl <info@mdiehl.de>"); 25 - MODULE_DESCRIPTION("IrDA SIR core"); 26 - MODULE_LICENSE("GPL"); 27 - 28 - /***************************************************************************/ 29 - 30 - EXPORT_SYMBOL(irda_register_dongle); 31 - EXPORT_SYMBOL(irda_unregister_dongle); 32 - 33 - EXPORT_SYMBOL(sirdev_get_instance); 34 - EXPORT_SYMBOL(sirdev_put_instance); 35 - 36 - EXPORT_SYMBOL(sirdev_set_dongle); 37 - EXPORT_SYMBOL(sirdev_write_complete); 38 - EXPORT_SYMBOL(sirdev_receive); 39 - 40 - EXPORT_SYMBOL(sirdev_raw_write); 41 - EXPORT_SYMBOL(sirdev_raw_read); 42 - EXPORT_SYMBOL(sirdev_set_dtr_rts); 43 - 44 - static int __init sir_core_init(void) 45 - { 46 - return irda_thread_create(); 47 - } 48 - 49 - static void __exit sir_core_exit(void) 50 - { 51 - irda_thread_join(); 52 - } 53 - 54 - module_init(sir_core_init); 55 - module_exit(sir_core_exit); 56 -
+9 -1
drivers/net/irda/sir_dev.c
··· 60 60 up(&dev->fsm.sem); 61 61 return err; 62 62 } 63 + EXPORT_SYMBOL(sirdev_set_dongle); 63 64 64 65 /* used by dongle drivers for dongle programming */ 65 66 ··· 95 94 spin_unlock_irqrestore(&dev->tx_lock, flags); 96 95 return ret; 97 96 } 97 + EXPORT_SYMBOL(sirdev_raw_write); 98 98 99 99 /* seems some dongle drivers may need this */ 100 100 ··· 118 116 119 117 return count; 120 118 } 119 + EXPORT_SYMBOL(sirdev_raw_read); 121 120 122 121 int sirdev_set_dtr_rts(struct sir_dev *dev, int dtr, int rts) 123 122 { ··· 127 124 ret = dev->drv->set_dtr_rts(dev, dtr, rts); 128 125 return ret; 129 126 } 130 - 127 + EXPORT_SYMBOL(sirdev_set_dtr_rts); 128 + 131 129 /**********************************************************************/ 132 130 133 131 /* called from client driver - likely with bh-context - to indicate ··· 231 227 done: 232 228 spin_unlock_irqrestore(&dev->tx_lock, flags); 233 229 } 230 + EXPORT_SYMBOL(sirdev_write_complete); 234 231 235 232 /* called from client driver - likely with bh-context - to give us 236 233 * some more received bytes. We put them into the rx-buffer, ··· 284 279 285 280 return 0; 286 281 } 282 + EXPORT_SYMBOL(sirdev_receive); 287 283 288 284 /**********************************************************************/ 289 285 ··· 647 641 out: 648 642 return NULL; 649 643 } 644 + EXPORT_SYMBOL(sirdev_get_instance); 650 645 651 646 int sirdev_put_instance(struct sir_dev *dev) 652 647 { ··· 680 673 681 674 return 0; 682 675 } 676 + EXPORT_SYMBOL(sirdev_put_instance); 683 677
+2
drivers/net/irda/sir_dongle.c
··· 50 50 up(&dongle_list_lock); 51 51 return 0; 52 52 } 53 + EXPORT_SYMBOL(irda_register_dongle); 53 54 54 55 int irda_unregister_dongle(struct dongle_driver *drv) 55 56 { ··· 59 58 up(&dongle_list_lock); 60 59 return 0; 61 60 } 61 + EXPORT_SYMBOL(irda_unregister_dongle); 62 62 63 63 int sirdev_get_dongle(struct sir_dev *dev, IRDA_DONGLE type) 64 64 {
+9 -2
drivers/net/irda/sir_kthread.c
··· 466 466 return 0; 467 467 } 468 468 469 - int __init irda_thread_create(void) 469 + static int __init irda_thread_create(void) 470 470 { 471 471 struct completion startup; 472 472 int pid; ··· 488 488 return 0; 489 489 } 490 490 491 - void __exit irda_thread_join(void) 491 + static void __exit irda_thread_join(void) 492 492 { 493 493 if (irda_rq_queue.thread) { 494 494 flush_irda_queue(); ··· 498 498 wait_for_completion(&irda_rq_queue.exit); 499 499 } 500 500 } 501 + 502 + module_init(irda_thread_create); 503 + module_exit(irda_thread_join); 504 + 505 + MODULE_AUTHOR("Martin Diehl <info@mdiehl.de>"); 506 + MODULE_DESCRIPTION("IrDA SIR core"); 507 + MODULE_LICENSE("GPL"); 501 508
-7
include/linux/netfilter_ipv4/ip_nat_protocol.h
··· 42 42 enum ip_nat_manip_type maniptype, 43 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 45 int (*range_to_nfattr)(struct sk_buff *skb, 53 46 const struct ip_nat_range *range); 54 47
+5
include/linux/netfilter_ipv6.h
··· 72 72 NF_IP6_PRI_LAST = INT_MAX, 73 73 }; 74 74 75 + #ifdef CONFIG_NETFILTER 75 76 extern int ipv6_netfilter_init(void); 76 77 extern void ipv6_netfilter_fini(void); 78 + #else /* CONFIG_NETFILTER */ 79 + static inline int ipv6_netfilter_init(void) { return 0; } 80 + static inline void ipv6_netfilter_fini(void) { return; } 81 + #endif /* CONFIG_NETFILTER */ 77 82 78 83 #endif /*__LINUX_IP6_NETFILTER_H*/
+2 -2
include/net/inet_connection_sock.h
··· 83 83 struct timer_list icsk_delack_timer; 84 84 __u32 icsk_rto; 85 85 __u32 icsk_pmtu_cookie; 86 - struct tcp_congestion_ops *icsk_ca_ops; 87 - struct inet_connection_sock_af_ops *icsk_af_ops; 86 + const struct tcp_congestion_ops *icsk_ca_ops; 87 + const struct inet_connection_sock_af_ops *icsk_af_ops; 88 88 unsigned int (*icsk_sync_mss)(struct sock *sk, u32 pmtu); 89 89 __u8 icsk_ca_state; 90 90 __u8 icsk_retransmits;
+1 -1
net/8021q/vlan_dev.c
··· 214 214 * This allows the VLAN to have a different MAC than the underlying 215 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 218 /* It is for our (changed) MAC-address! */ 219 219 skb->pkt_type = PACKET_HOST; 220 220 }
+2 -2
net/atm/br2684.c
··· 296 296 eth = eth_hdr(skb); 297 297 298 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 300 skb->pkt_type = PACKET_BROADCAST; 301 301 else 302 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 306 skb->pkt_type = PACKET_OTHERHOST; 307 307 308 308 if (ntohs(eth->h_proto) >= 1536)
+3 -3
net/atm/lec.c
··· 1321 1321 struct sk_buff *skb; 1322 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 1325 return (0); /* not our mac address */ 1326 1326 1327 1327 kfree(priv->tlvs); /* NULL if there was no previous association */ ··· 1798 1798 1799 1799 to_return = priv->lec_arp_tables[place]; 1800 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 1802 return to_return; 1803 1803 } 1804 1804 to_return = to_return->next; ··· 2002 2002 return priv->mcast_vcc; 2003 2003 break; 2004 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 2006 return priv->mcast_vcc; 2007 2007 break; 2008 2008 default:
+1 -1
net/atm/mpc.c
··· 552 552 goto non_ip; /* Multi-Protocol Over ATM :-) */ 553 553 554 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 556 if ( send_via_shortcut(skb, mpc) == 0 ) /* try shortcut */ 557 557 return 0; /* success! */ 558 558 i++;
+3 -3
net/bluetooth/bnep/core.c
··· 75 75 76 76 list_for_each(p, &bnep_session_list) { 77 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 79 return s; 80 80 } 81 81 return NULL; ··· 420 420 iv[il++] = (struct kvec) { &type, 1 }; 421 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 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 427 type |= 0x02; 428 428 429 429 if (type)
+1 -1
net/bluetooth/hci_conn.c
··· 403 403 404 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 407 return -ENOMEM; 408 408 409 409 if (!(hdev = hci_dev_get(req.dev_id))) {
+3
net/bridge/netfilter/ebt_ip.c
··· 15 15 #include <linux/netfilter_bridge/ebtables.h> 16 16 #include <linux/netfilter_bridge/ebt_ip.h> 17 17 #include <linux/ip.h> 18 + #include <net/ip.h> 18 19 #include <linux/in.h> 19 20 #include <linux/module.h> 20 21 ··· 52 51 if (!(info->bitmask & EBT_IP_DPORT) && 53 52 !(info->bitmask & EBT_IP_SPORT)) 54 53 return EBT_MATCH; 54 + if (ntohs(ih->frag_off) & IP_OFFSET) 55 + return EBT_NOMATCH; 55 56 pptr = skb_header_pointer(skb, ih->ihl*4, 56 57 sizeof(_ports), &_ports); 57 58 if (pptr == NULL)
+2 -2
net/bridge/netfilter/ebt_stp.c
··· 164 164 if (datalen != len) 165 165 return -EINVAL; 166 166 /* Make sure the match only receives stp frames */ 167 - if (memcmp(e->destmac, bridge_ula, ETH_ALEN) || 168 - memcmp(e->destmsk, msk, ETH_ALEN) || !(e->bitmask & EBT_DESTMAC)) 167 + if (compare_ether_addr(e->destmac, bridge_ula) || 168 + compare_ether_addr(e->destmsk, msk) || !(e->bitmask & EBT_DESTMAC)) 169 169 return -EINVAL; 170 170 171 171 return 0;
+1 -1
net/core/dv.c
··· 457 457 unsigned char *skb_data_end = skb->data + skb->len; 458 458 459 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 461 return; 462 462 463 463 /* proto is not IP, do nothing */
+1 -1
net/core/wireless.c
··· 1506 1506 1507 1507 /* Update all records that match */ 1508 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 1510 memcpy(&(spydata->spy_stat[i]), wstats, 1511 1511 sizeof(struct iw_quality)); 1512 1512 match = i;
+7 -7
net/ieee80211/ieee80211_rx.c
··· 76 76 77 77 if (entry->skb != NULL && entry->seq == seq && 78 78 (entry->last_frag + 1 == frag || frag == -1) && 79 - memcmp(entry->src_addr, src, ETH_ALEN) == 0 && 80 - memcmp(entry->dst_addr, dst, ETH_ALEN) == 0) 79 + !compare_ether_addr(entry->src_addr, src) && 80 + !compare_ether_addr(entry->dst_addr, dst)) 81 81 return entry; 82 82 } 83 83 ··· 243 243 /* check that the frame is unicast frame to us */ 244 244 if ((fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) == 245 245 IEEE80211_FCTL_TODS && 246 - memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN) == 0 && 247 - memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN) == 0) { 246 + !compare_ether_addr(hdr->addr1, dev->dev_addr) && 247 + !compare_ether_addr(hdr->addr3, dev->dev_addr)) { 248 248 /* ToDS frame with own addr BSSID and DA */ 249 249 } else if ((fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) == 250 250 IEEE80211_FCTL_FROMDS && 251 - memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN) == 0) { 251 + !compare_ether_addr(hdr->addr1, dev->dev_addr)) { 252 252 /* FromDS frame with own addr as DA */ 253 253 } else 254 254 return 0; ··· 505 505 if (ieee->iw_mode == IW_MODE_MASTER && !wds && 506 506 (fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) == 507 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 509 /* Frame from BSSID of the AP for which we are a client */ 510 510 skb->dev = dev = ieee->stadev; 511 511 stats = hostap_get_stats(dev); ··· 1231 1231 * as one network */ 1232 1232 return ((src->ssid_len == dst->ssid_len) && 1233 1233 (src->channel == dst->channel) && 1234 - !memcmp(src->bssid, dst->bssid, ETH_ALEN) && 1234 + !compare_ether_addr(src->bssid, dst->bssid) && 1235 1235 !memcmp(src->ssid, dst->ssid, src->ssid_len)); 1236 1236 } 1237 1237
+2 -2
net/ipv4/Makefile
··· 9 9 tcp.o tcp_input.o tcp_output.o tcp_timer.o tcp_ipv4.o \ 10 10 tcp_minisocks.o tcp_cong.o \ 11 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 14 14 obj-$(CONFIG_IP_FIB_HASH) += fib_hash.o 15 15 obj-$(CONFIG_IP_FIB_TRIE) += fib_trie.o ··· 28 28 obj-$(CONFIG_IP_ROUTE_MULTIPATH_RANDOM) += multipath_random.o 29 29 obj-$(CONFIG_IP_ROUTE_MULTIPATH_WRANDOM) += multipath_wrandom.o 30 30 obj-$(CONFIG_IP_ROUTE_MULTIPATH_DRR) += multipath_drr.o 31 - obj-$(CONFIG_NETFILTER) += netfilter/ 31 + obj-$(CONFIG_NETFILTER) += netfilter.o netfilter/ 32 32 obj-$(CONFIG_IP_VS) += ipvs/ 33 33 obj-$(CONFIG_INET_DIAG) += inet_diag.o 34 34 obj-$(CONFIG_IP_ROUTE_MULTIPATH_CACHED) += multipath.o
-10
net/ipv4/netfilter.c
··· 1 1 /* IPv4 specific functions of netfilter core */ 2 - 3 - #include <linux/config.h> 4 - #ifdef CONFIG_NETFILTER 5 - 6 2 #include <linux/kernel.h> 7 3 #include <linux/netfilter.h> 8 4 #include <linux/netfilter_ipv4.h> 9 - 10 5 #include <linux/ip.h> 11 - #include <linux/tcp.h> 12 - #include <linux/udp.h> 13 - #include <linux/icmp.h> 14 6 #include <net/route.h> 15 7 #include <net/xfrm.h> 16 8 #include <net/ip.h> ··· 138 146 139 147 module_init(init); 140 148 module_exit(fini); 141 - 142 - #endif /* CONFIG_NETFILTER */
+1 -1
net/ipv4/netfilter/ip_conntrack_proto_generic.c
··· 12 12 #include <linux/netfilter.h> 13 13 #include <linux/netfilter_ipv4/ip_conntrack_protocol.h> 14 14 15 - unsigned long ip_ct_generic_timeout = 600*HZ; 15 + unsigned int ip_ct_generic_timeout = 600*HZ; 16 16 17 17 static int generic_pkt_to_tuple(const struct sk_buff *skb, 18 18 unsigned int dataoff,
+1 -1
net/ipv4/netfilter/ip_conntrack_proto_icmp.c
··· 22 22 #include <linux/netfilter_ipv4/ip_conntrack_core.h> 23 23 #include <linux/netfilter_ipv4/ip_conntrack_protocol.h> 24 24 25 - unsigned long ip_ct_icmp_timeout = 30*HZ; 25 + unsigned int ip_ct_icmp_timeout = 30*HZ; 26 26 27 27 #if 0 28 28 #define DEBUGP printk
+8 -8
net/ipv4/netfilter/ip_conntrack_proto_sctp.c
··· 58 58 #define HOURS * 60 MINS 59 59 #define DAYS * 24 HOURS 60 60 61 - static unsigned long ip_ct_sctp_timeout_closed = 10 SECS; 62 - static unsigned long ip_ct_sctp_timeout_cookie_wait = 3 SECS; 63 - static unsigned long ip_ct_sctp_timeout_cookie_echoed = 3 SECS; 64 - static unsigned long ip_ct_sctp_timeout_established = 5 DAYS; 65 - static unsigned long ip_ct_sctp_timeout_shutdown_sent = 300 SECS / 1000; 66 - static unsigned long ip_ct_sctp_timeout_shutdown_recd = 300 SECS / 1000; 67 - static unsigned long ip_ct_sctp_timeout_shutdown_ack_sent = 3 SECS; 61 + static unsigned int ip_ct_sctp_timeout_closed = 10 SECS; 62 + static unsigned int ip_ct_sctp_timeout_cookie_wait = 3 SECS; 63 + static unsigned int ip_ct_sctp_timeout_cookie_echoed = 3 SECS; 64 + static unsigned int ip_ct_sctp_timeout_established = 5 DAYS; 65 + static unsigned int ip_ct_sctp_timeout_shutdown_sent = 300 SECS / 1000; 66 + static unsigned int ip_ct_sctp_timeout_shutdown_recd = 300 SECS / 1000; 67 + static unsigned int ip_ct_sctp_timeout_shutdown_ack_sent = 3 SECS; 68 68 69 - static const unsigned long * sctp_timeouts[] 69 + static const unsigned int * sctp_timeouts[] 70 70 = { NULL, /* SCTP_CONNTRACK_NONE */ 71 71 &ip_ct_sctp_timeout_closed, /* SCTP_CONNTRACK_CLOSED */ 72 72 &ip_ct_sctp_timeout_cookie_wait, /* SCTP_CONNTRACK_COOKIE_WAIT */
+10 -10
net/ipv4/netfilter/ip_conntrack_proto_tcp.c
··· 85 85 #define HOURS * 60 MINS 86 86 #define DAYS * 24 HOURS 87 87 88 - unsigned long ip_ct_tcp_timeout_syn_sent = 2 MINS; 89 - unsigned long ip_ct_tcp_timeout_syn_recv = 60 SECS; 90 - unsigned long ip_ct_tcp_timeout_established = 5 DAYS; 91 - unsigned long ip_ct_tcp_timeout_fin_wait = 2 MINS; 92 - unsigned long ip_ct_tcp_timeout_close_wait = 60 SECS; 93 - unsigned long ip_ct_tcp_timeout_last_ack = 30 SECS; 94 - unsigned long ip_ct_tcp_timeout_time_wait = 2 MINS; 95 - unsigned long ip_ct_tcp_timeout_close = 10 SECS; 88 + unsigned int ip_ct_tcp_timeout_syn_sent = 2 MINS; 89 + unsigned int ip_ct_tcp_timeout_syn_recv = 60 SECS; 90 + unsigned int ip_ct_tcp_timeout_established = 5 DAYS; 91 + unsigned int ip_ct_tcp_timeout_fin_wait = 2 MINS; 92 + unsigned int ip_ct_tcp_timeout_close_wait = 60 SECS; 93 + unsigned int ip_ct_tcp_timeout_last_ack = 30 SECS; 94 + unsigned int ip_ct_tcp_timeout_time_wait = 2 MINS; 95 + unsigned int ip_ct_tcp_timeout_close = 10 SECS; 96 96 97 97 /* RFC1122 says the R2 limit should be at least 100 seconds. 98 98 Linux uses 15 packets as limit, which corresponds 99 99 to ~13-30min depending on RTO. */ 100 - unsigned long ip_ct_tcp_timeout_max_retrans = 5 MINS; 100 + unsigned int ip_ct_tcp_timeout_max_retrans = 5 MINS; 101 101 102 - static const unsigned long * tcp_timeouts[] 102 + static const unsigned int * tcp_timeouts[] 103 103 = { NULL, /* TCP_CONNTRACK_NONE */ 104 104 &ip_ct_tcp_timeout_syn_sent, /* TCP_CONNTRACK_SYN_SENT, */ 105 105 &ip_ct_tcp_timeout_syn_recv, /* TCP_CONNTRACK_SYN_RECV, */
+2 -2
net/ipv4/netfilter/ip_conntrack_proto_udp.c
··· 19 19 #include <linux/netfilter_ipv4.h> 20 20 #include <linux/netfilter_ipv4/ip_conntrack_protocol.h> 21 21 22 - unsigned long ip_ct_udp_timeout = 30*HZ; 23 - unsigned long ip_ct_udp_timeout_stream = 180*HZ; 22 + unsigned int ip_ct_udp_timeout = 30*HZ; 23 + unsigned int ip_ct_udp_timeout_stream = 180*HZ; 24 24 25 25 static int udp_pkt_to_tuple(const struct sk_buff *skb, 26 26 unsigned int dataoff,
+13 -13
net/ipv4/netfilter/ip_conntrack_standalone.c
··· 544 544 extern unsigned int ip_conntrack_htable_size; 545 545 546 546 /* From ip_conntrack_proto_tcp.c */ 547 - extern unsigned long ip_ct_tcp_timeout_syn_sent; 548 - extern unsigned long ip_ct_tcp_timeout_syn_recv; 549 - extern unsigned long ip_ct_tcp_timeout_established; 550 - extern unsigned long ip_ct_tcp_timeout_fin_wait; 551 - extern unsigned long ip_ct_tcp_timeout_close_wait; 552 - extern unsigned long ip_ct_tcp_timeout_last_ack; 553 - extern unsigned long ip_ct_tcp_timeout_time_wait; 554 - extern unsigned long ip_ct_tcp_timeout_close; 555 - extern unsigned long ip_ct_tcp_timeout_max_retrans; 547 + extern unsigned int ip_ct_tcp_timeout_syn_sent; 548 + extern unsigned int ip_ct_tcp_timeout_syn_recv; 549 + extern unsigned int ip_ct_tcp_timeout_established; 550 + extern unsigned int ip_ct_tcp_timeout_fin_wait; 551 + extern unsigned int ip_ct_tcp_timeout_close_wait; 552 + extern unsigned int ip_ct_tcp_timeout_last_ack; 553 + extern unsigned int ip_ct_tcp_timeout_time_wait; 554 + extern unsigned int ip_ct_tcp_timeout_close; 555 + extern unsigned int ip_ct_tcp_timeout_max_retrans; 556 556 extern int ip_ct_tcp_loose; 557 557 extern int ip_ct_tcp_be_liberal; 558 558 extern int ip_ct_tcp_max_retrans; 559 559 560 560 /* From ip_conntrack_proto_udp.c */ 561 - extern unsigned long ip_ct_udp_timeout; 562 - extern unsigned long ip_ct_udp_timeout_stream; 561 + extern unsigned int ip_ct_udp_timeout; 562 + extern unsigned int ip_ct_udp_timeout_stream; 563 563 564 564 /* From ip_conntrack_proto_icmp.c */ 565 - extern unsigned long ip_ct_icmp_timeout; 565 + extern unsigned int ip_ct_icmp_timeout; 566 566 567 567 /* From ip_conntrack_proto_icmp.c */ 568 - extern unsigned long ip_ct_generic_timeout; 568 + extern unsigned int ip_ct_generic_timeout; 569 569 570 570 /* Log invalid packets of a given protocol */ 571 571 static int log_invalid_proto_min = 0;
+34 -47
net/ipv4/netfilter/ip_nat_helper_pptp.c
··· 148 148 { 149 149 struct ip_ct_pptp_master *ct_pptp_info = &ct->help.ct_pptp_info; 150 150 struct ip_nat_pptp *nat_pptp_info = &ct->nat.help.nat_pptp_info; 151 - 152 - u_int16_t msg, *cid = NULL, new_callid; 151 + u_int16_t msg, new_callid; 152 + unsigned int cid_off; 153 153 154 154 new_callid = htons(ct_pptp_info->pns_call_id); 155 155 156 156 switch (msg = ntohs(ctlh->messageType)) { 157 157 case PPTP_OUT_CALL_REQUEST: 158 - cid = &pptpReq->ocreq.callID; 158 + cid_off = offsetof(union pptp_ctrl_union, ocreq.callID); 159 159 /* FIXME: ideally we would want to reserve a call ID 160 160 * here. current netfilter NAT core is not able to do 161 161 * this :( For now we use TCP source port. This breaks ··· 172 172 ct_pptp_info->pns_call_id = ntohs(new_callid); 173 173 break; 174 174 case PPTP_IN_CALL_REPLY: 175 - cid = &pptpReq->icreq.callID; 175 + cid_off = offsetof(union pptp_ctrl_union, icreq.callID); 176 176 break; 177 177 case PPTP_CALL_CLEAR_REQUEST: 178 - cid = &pptpReq->clrreq.callID; 178 + cid_off = offsetof(union pptp_ctrl_union, clrreq.callID); 179 179 break; 180 180 default: 181 181 DEBUGP("unknown outbound packet 0x%04x:%s\n", msg, ··· 197 197 198 198 /* only OUT_CALL_REQUEST, IN_CALL_REPLY, CALL_CLEAR_REQUEST pass 199 199 * down to here */ 200 - 201 - IP_NF_ASSERT(cid); 202 - 203 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 203 /* mangle packet */ 207 204 if (ip_nat_mangle_tcp_packet(pskb, ct, ctinfo, 208 - (void *)cid - ((void *)ctlh - sizeof(struct pptp_pkt_hdr)), 209 - sizeof(new_callid), 210 - (char *)&new_callid, 211 - sizeof(new_callid)) == 0) 205 + cid_off + sizeof(struct pptp_pkt_hdr) + 206 + sizeof(struct PptpControlHeader), 207 + sizeof(new_callid), (char *)&new_callid, 208 + sizeof(new_callid)) == 0) 212 209 return NF_DROP; 213 210 214 211 return NF_ACCEPT; ··· 296 299 union pptp_ctrl_union *pptpReq) 297 300 { 298 301 struct ip_nat_pptp *nat_pptp_info = &ct->nat.help.nat_pptp_info; 299 - u_int16_t msg, new_cid = 0, new_pcid, *pcid = NULL, *cid = NULL; 300 - 301 - int ret = NF_ACCEPT, rv; 302 + u_int16_t msg, new_cid = 0, new_pcid; 303 + unsigned int pcid_off, cid_off = 0; 302 304 303 305 new_pcid = htons(nat_pptp_info->pns_call_id); 304 306 305 307 switch (msg = ntohs(ctlh->messageType)) { 306 308 case PPTP_OUT_CALL_REPLY: 307 - pcid = &pptpReq->ocack.peersCallID; 308 - cid = &pptpReq->ocack.callID; 309 + pcid_off = offsetof(union pptp_ctrl_union, ocack.peersCallID); 310 + cid_off = offsetof(union pptp_ctrl_union, ocack.callID); 309 311 break; 310 312 case PPTP_IN_CALL_CONNECT: 311 - pcid = &pptpReq->iccon.peersCallID; 313 + pcid_off = offsetof(union pptp_ctrl_union, iccon.peersCallID); 312 314 break; 313 315 case PPTP_IN_CALL_REQUEST: 314 316 /* only need to nat in case PAC is behind NAT box */ 315 - break; 317 + return NF_ACCEPT; 316 318 case PPTP_WAN_ERROR_NOTIFY: 317 - pcid = &pptpReq->wanerr.peersCallID; 319 + pcid_off = offsetof(union pptp_ctrl_union, wanerr.peersCallID); 318 320 break; 319 321 case PPTP_CALL_DISCONNECT_NOTIFY: 320 - pcid = &pptpReq->disc.callID; 322 + pcid_off = offsetof(union pptp_ctrl_union, disc.callID); 321 323 break; 322 324 case PPTP_SET_LINK_INFO: 323 - pcid = &pptpReq->setlink.peersCallID; 325 + pcid_off = offsetof(union pptp_ctrl_union, setlink.peersCallID); 324 326 break; 325 327 326 328 default: ··· 341 345 * WAN_ERROR_NOTIFY, CALL_DISCONNECT_NOTIFY pass down here */ 342 346 343 347 /* mangle packet */ 344 - IP_NF_ASSERT(pcid); 345 348 DEBUGP("altering peer call id from 0x%04x to 0x%04x\n", 346 - ntohs(*pcid), ntohs(new_pcid)); 347 - 348 - rv = ip_nat_mangle_tcp_packet(pskb, ct, ctinfo, 349 - (void *)pcid - ((void *)ctlh - sizeof(struct pptp_pkt_hdr)), 350 - sizeof(new_pcid), (char *)&new_pcid, 351 - sizeof(new_pcid)); 352 - if (rv != NF_ACCEPT) 353 - return rv; 349 + ntohs(*(u_int16_t *)pptpReq + pcid_off), ntohs(new_pcid)); 350 + 351 + if (ip_nat_mangle_tcp_packet(pskb, ct, ctinfo, 352 + pcid_off + sizeof(struct pptp_pkt_hdr) + 353 + sizeof(struct PptpControlHeader), 354 + sizeof(new_pcid), (char *)&new_pcid, 355 + sizeof(new_pcid)) == 0) 356 + return NF_DROP; 354 357 355 358 if (new_cid) { 356 - IP_NF_ASSERT(cid); 357 359 DEBUGP("altering call id from 0x%04x to 0x%04x\n", 358 - ntohs(*cid), ntohs(new_cid)); 359 - rv = ip_nat_mangle_tcp_packet(pskb, ct, ctinfo, 360 - (void *)cid - ((void *)ctlh - sizeof(struct pptp_pkt_hdr)), 361 - sizeof(new_cid), 362 - (char *)&new_cid, 363 - sizeof(new_cid)); 364 - if (rv != NF_ACCEPT) 365 - return rv; 360 + ntohs(*(u_int16_t *)pptpReq + cid_off), ntohs(new_cid)); 361 + if (ip_nat_mangle_tcp_packet(pskb, ct, ctinfo, 362 + cid_off + sizeof(struct pptp_pkt_hdr) + 363 + sizeof(struct PptpControlHeader), 364 + sizeof(new_cid), (char *)&new_cid, 365 + sizeof(new_cid)) == 0) 366 + return NF_DROP; 366 367 } 367 - 368 - /* check for earlier return value of 'switch' above */ 369 - if (ret != NF_ACCEPT) 370 - return ret; 371 - 372 - /* great, at least we don't need to resize packets */ 373 368 return NF_ACCEPT; 374 369 } 375 370
-38
net/ipv4/netfilter/ip_nat_proto_gre.c
··· 151 151 return 1; 152 152 } 153 153 154 - /* print out a nat tuple */ 155 - static unsigned int 156 - gre_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 */ 174 - static unsigned int 175 - gre_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 154 /* nat helper struct */ 191 155 static struct ip_nat_protocol gre = { 192 156 .name = "GRE", ··· 158 194 .manip_pkt = gre_manip_pkt, 159 195 .in_range = gre_in_range, 160 196 .unique_tuple = gre_unique_tuple, 161 - .print = gre_print, 162 - .print_range = gre_print_range, 163 197 #if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ 164 198 defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) 165 199 .range_to_nfattr = ip_nat_port_range_to_nfattr,
-34
net/ipv4/netfilter/ip_nat_proto_icmp.c
··· 74 74 return 1; 75 75 } 76 76 77 - static unsigned int 78 - icmp_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 - 99 - static unsigned int 100 - icmp_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 - 109 77 struct ip_nat_protocol ip_nat_protocol_icmp = { 110 78 .name = "ICMP", 111 79 .protonum = IPPROTO_ICMP, ··· 81 113 .manip_pkt = icmp_manip_pkt, 82 114 .in_range = icmp_in_range, 83 115 .unique_tuple = icmp_unique_tuple, 84 - .print = icmp_print, 85 - .print_range = icmp_print_range, 86 116 #if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ 87 117 defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) 88 118 .range_to_nfattr = ip_nat_port_range_to_nfattr,
-36
net/ipv4/netfilter/ip_nat_proto_tcp.c
··· 136 136 return 1; 137 137 } 138 138 139 - static unsigned int 140 - tcp_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 - 158 - static unsigned int 159 - tcp_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 - 173 139 struct ip_nat_protocol ip_nat_protocol_tcp = { 174 140 .name = "TCP", 175 141 .protonum = IPPROTO_TCP, ··· 143 177 .manip_pkt = tcp_manip_pkt, 144 178 .in_range = tcp_in_range, 145 179 .unique_tuple = tcp_unique_tuple, 146 - .print = tcp_print, 147 - .print_range = tcp_print_range, 148 180 #if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ 149 181 defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) 150 182 .range_to_nfattr = ip_nat_port_range_to_nfattr,
-36
net/ipv4/netfilter/ip_nat_proto_udp.c
··· 122 122 return 1; 123 123 } 124 124 125 - static unsigned int 126 - udp_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 - 144 - static unsigned int 145 - udp_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 - 159 125 struct ip_nat_protocol ip_nat_protocol_udp = { 160 126 .name = "UDP", 161 127 .protonum = IPPROTO_UDP, ··· 129 163 .manip_pkt = udp_manip_pkt, 130 164 .in_range = udp_in_range, 131 165 .unique_tuple = udp_unique_tuple, 132 - .print = udp_print, 133 - .print_range = udp_print_range, 134 166 #if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ 135 167 defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) 136 168 .range_to_nfattr = ip_nat_port_range_to_nfattr,
-16
net/ipv4/netfilter/ip_nat_proto_unknown.c
··· 46 46 return 1; 47 47 } 48 48 49 - static unsigned int 50 - unknown_print(char *buffer, 51 - const struct ip_conntrack_tuple *match, 52 - const struct ip_conntrack_tuple *mask) 53 - { 54 - return 0; 55 - } 56 - 57 - static unsigned int 58 - unknown_print_range(char *buffer, const struct ip_nat_range *range) 59 - { 60 - return 0; 61 - } 62 - 63 49 struct ip_nat_protocol ip_nat_unknown_protocol = { 64 50 .name = "unknown", 65 51 /* .me isn't set: getting a ref to this cannot fail. */ 66 52 .manip_pkt = unknown_manip_pkt, 67 53 .in_range = unknown_in_range, 68 54 .unique_tuple = unknown_unique_tuple, 69 - .print = unknown_print, 70 - .print_range = unknown_print_range 71 55 };
+3 -2
net/ipv4/netfilter/ipt_mac.c
··· 11 11 #include <linux/module.h> 12 12 #include <linux/skbuff.h> 13 13 #include <linux/if_ether.h> 14 + #include <linux/etherdevice.h> 14 15 15 16 #include <linux/netfilter_ipv4/ipt_mac.h> 16 17 #include <linux/netfilter_ipv4/ip_tables.h> ··· 34 33 return (skb->mac.raw >= skb->head 35 34 && (skb->mac.raw + ETH_HLEN) <= skb->data 36 35 /* If so, compare... */ 37 - && ((memcmp(eth_hdr(skb)->h_source, info->srcaddr, ETH_ALEN) 38 - == 0) ^ info->invert)); 36 + && ((!compare_ether_addr(eth_hdr(skb)->h_source, info->srcaddr)) 37 + ^ info->invert)); 39 38 } 40 39 41 40 static int
+1 -1
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
··· 277 277 278 278 #ifdef CONFIG_SYSCTL 279 279 /* From nf_conntrack_proto_icmp.c */ 280 - extern unsigned long nf_ct_icmp_timeout; 280 + extern unsigned int nf_ct_icmp_timeout; 281 281 static struct ctl_table_header *nf_ct_ipv4_sysctl_header; 282 282 283 283 static ctl_table nf_ct_sysctl_table[] = {
+2 -3
net/ipv6/Makefile
··· 8 8 route.o ip6_fib.o ipv6_sockglue.o ndisc.o udp.o raw.o \ 9 9 protocol.o icmp.o mcast.o reassembly.o tcp_ipv6.o \ 10 10 exthdrs.o sysctl_net_ipv6.o datagram.o proc.o \ 11 - ip6_flowlabel.o ipv6_syms.o netfilter.o \ 12 - inet6_connection_sock.o 11 + ip6_flowlabel.o ipv6_syms.o inet6_connection_sock.o 13 12 14 13 ipv6-$(CONFIG_XFRM) += xfrm6_policy.o xfrm6_state.o xfrm6_input.o \ 15 14 xfrm6_output.o ··· 18 19 obj-$(CONFIG_INET6_ESP) += esp6.o 19 20 obj-$(CONFIG_INET6_IPCOMP) += ipcomp6.o 20 21 obj-$(CONFIG_INET6_TUNNEL) += xfrm6_tunnel.o 21 - obj-$(CONFIG_NETFILTER) += netfilter/ 22 + obj-$(CONFIG_NETFILTER) += netfilter.o netfilter/ 22 23 23 24 obj-$(CONFIG_IPV6_TUNNEL) += ip6_tunnel.o 24 25
+2 -17
net/ipv6/netfilter.c
··· 1 - #include <linux/config.h> 2 - #include <linux/init.h> 3 - 4 - #ifdef CONFIG_NETFILTER 5 - 6 1 #include <linux/kernel.h> 2 + #include <linux/init.h> 7 3 #include <linux/ipv6.h> 8 4 #include <linux/netfilter.h> 9 5 #include <linux/netfilter_ipv6.h> ··· 90 94 return nf_register_queue_rerouter(PF_INET6, &ip6_reroute); 91 95 } 92 96 93 - void ipv6_netfilter_fini(void) 97 + void __exit ipv6_netfilter_fini(void) 94 98 { 95 99 nf_unregister_queue_rerouter(PF_INET6); 96 100 } 97 - 98 - #else /* CONFIG_NETFILTER */ 99 - int __init ipv6_netfilter_init(void) 100 - { 101 - return 0; 102 - } 103 - 104 - void ipv6_netfilter_fini(void) 105 - { 106 - } 107 - #endif /* CONFIG_NETFILTER */
+2 -2
net/ipv6/netfilter/ip6t_mac.c
··· 34 34 return (skb->mac.raw >= skb->head 35 35 && (skb->mac.raw + ETH_HLEN) <= skb->data 36 36 /* If so, compare... */ 37 - && ((memcmp(eth_hdr(skb)->h_source, info->srcaddr, ETH_ALEN) 38 - == 0) ^ info->invert)); 37 + && ((!compare_ether_addr(eth_hdr(skb)->h_source, info->srcaddr)) 38 + ^ info->invert)); 39 39 } 40 40 41 41 static int
+2 -2
net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
··· 335 335 #ifdef CONFIG_SYSCTL 336 336 337 337 /* From nf_conntrack_proto_icmpv6.c */ 338 - extern unsigned long nf_ct_icmpv6_timeout; 338 + extern unsigned int nf_ct_icmpv6_timeout; 339 339 340 340 /* From nf_conntrack_frag6.c */ 341 - extern unsigned long nf_ct_frag6_timeout; 341 + extern unsigned int nf_ct_frag6_timeout; 342 342 extern unsigned int nf_ct_frag6_low_thresh; 343 343 extern unsigned int nf_ct_frag6_high_thresh; 344 344
+1 -1
net/netfilter/nf_conntrack_proto_generic.c
··· 17 17 #include <linux/netfilter.h> 18 18 #include <net/netfilter/nf_conntrack_protocol.h> 19 19 20 - unsigned long nf_ct_generic_timeout = 600*HZ; 20 + unsigned int nf_ct_generic_timeout = 600*HZ; 21 21 22 22 static int generic_pkt_to_tuple(const struct sk_buff *skb, 23 23 unsigned int dataoff,
+8 -8
net/netfilter/nf_conntrack_proto_sctp.c
··· 62 62 #define HOURS * 60 MINS 63 63 #define DAYS * 24 HOURS 64 64 65 - static unsigned long nf_ct_sctp_timeout_closed = 10 SECS; 66 - static unsigned long nf_ct_sctp_timeout_cookie_wait = 3 SECS; 67 - static unsigned long nf_ct_sctp_timeout_cookie_echoed = 3 SECS; 68 - static unsigned long nf_ct_sctp_timeout_established = 5 DAYS; 69 - static unsigned long nf_ct_sctp_timeout_shutdown_sent = 300 SECS / 1000; 70 - static unsigned long nf_ct_sctp_timeout_shutdown_recd = 300 SECS / 1000; 71 - static unsigned long nf_ct_sctp_timeout_shutdown_ack_sent = 3 SECS; 65 + static unsigned int nf_ct_sctp_timeout_closed = 10 SECS; 66 + static unsigned int nf_ct_sctp_timeout_cookie_wait = 3 SECS; 67 + static unsigned int nf_ct_sctp_timeout_cookie_echoed = 3 SECS; 68 + static unsigned int nf_ct_sctp_timeout_established = 5 DAYS; 69 + static unsigned int nf_ct_sctp_timeout_shutdown_sent = 300 SECS / 1000; 70 + static unsigned int nf_ct_sctp_timeout_shutdown_recd = 300 SECS / 1000; 71 + static unsigned int nf_ct_sctp_timeout_shutdown_ack_sent = 3 SECS; 72 72 73 - static unsigned long * sctp_timeouts[] 73 + static unsigned int * sctp_timeouts[] 74 74 = { NULL, /* SCTP_CONNTRACK_NONE */ 75 75 &nf_ct_sctp_timeout_closed, /* SCTP_CONNTRACK_CLOSED */ 76 76 &nf_ct_sctp_timeout_cookie_wait, /* SCTP_CONNTRACK_COOKIE_WAIT */
+10 -10
net/netfilter/nf_conntrack_proto_tcp.c
··· 93 93 #define HOURS * 60 MINS 94 94 #define DAYS * 24 HOURS 95 95 96 - unsigned long nf_ct_tcp_timeout_syn_sent = 2 MINS; 97 - unsigned long nf_ct_tcp_timeout_syn_recv = 60 SECS; 98 - unsigned long nf_ct_tcp_timeout_established = 5 DAYS; 99 - unsigned long nf_ct_tcp_timeout_fin_wait = 2 MINS; 100 - unsigned long nf_ct_tcp_timeout_close_wait = 60 SECS; 101 - unsigned long nf_ct_tcp_timeout_last_ack = 30 SECS; 102 - unsigned long nf_ct_tcp_timeout_time_wait = 2 MINS; 103 - unsigned long nf_ct_tcp_timeout_close = 10 SECS; 96 + unsigned int nf_ct_tcp_timeout_syn_sent = 2 MINS; 97 + unsigned int nf_ct_tcp_timeout_syn_recv = 60 SECS; 98 + unsigned int nf_ct_tcp_timeout_established = 5 DAYS; 99 + unsigned int nf_ct_tcp_timeout_fin_wait = 2 MINS; 100 + unsigned int nf_ct_tcp_timeout_close_wait = 60 SECS; 101 + unsigned int nf_ct_tcp_timeout_last_ack = 30 SECS; 102 + unsigned int nf_ct_tcp_timeout_time_wait = 2 MINS; 103 + unsigned int nf_ct_tcp_timeout_close = 10 SECS; 104 104 105 105 /* RFC1122 says the R2 limit should be at least 100 seconds. 106 106 Linux uses 15 packets as limit, which corresponds 107 107 to ~13-30min depending on RTO. */ 108 - unsigned long nf_ct_tcp_timeout_max_retrans = 5 MINS; 108 + unsigned int nf_ct_tcp_timeout_max_retrans = 5 MINS; 109 109 110 - static unsigned long * tcp_timeouts[] 110 + static unsigned int * tcp_timeouts[] 111 111 = { NULL, /* TCP_CONNTRACK_NONE */ 112 112 &nf_ct_tcp_timeout_syn_sent, /* TCP_CONNTRACK_SYN_SENT, */ 113 113 &nf_ct_tcp_timeout_syn_recv, /* TCP_CONNTRACK_SYN_RECV, */
+2 -2
net/netfilter/nf_conntrack_proto_udp.c
··· 27 27 #include <linux/netfilter_ipv6.h> 28 28 #include <net/netfilter/nf_conntrack_protocol.h> 29 29 30 - unsigned long nf_ct_udp_timeout = 30*HZ; 31 - unsigned long nf_ct_udp_timeout_stream = 180*HZ; 30 + unsigned int nf_ct_udp_timeout = 30*HZ; 31 + unsigned int nf_ct_udp_timeout_stream = 180*HZ; 32 32 33 33 static int udp_pkt_to_tuple(const struct sk_buff *skb, 34 34 unsigned int dataoff,
+12 -12
net/netfilter/nf_conntrack_standalone.c
··· 431 431 extern unsigned int nf_conntrack_htable_size; 432 432 433 433 /* From nf_conntrack_proto_tcp.c */ 434 - extern unsigned long nf_ct_tcp_timeout_syn_sent; 435 - extern unsigned long nf_ct_tcp_timeout_syn_recv; 436 - extern unsigned long nf_ct_tcp_timeout_established; 437 - extern unsigned long nf_ct_tcp_timeout_fin_wait; 438 - extern unsigned long nf_ct_tcp_timeout_close_wait; 439 - extern unsigned long nf_ct_tcp_timeout_last_ack; 440 - extern unsigned long nf_ct_tcp_timeout_time_wait; 441 - extern unsigned long nf_ct_tcp_timeout_close; 442 - extern unsigned long nf_ct_tcp_timeout_max_retrans; 434 + extern unsigned int nf_ct_tcp_timeout_syn_sent; 435 + extern unsigned int nf_ct_tcp_timeout_syn_recv; 436 + extern unsigned int nf_ct_tcp_timeout_established; 437 + extern unsigned int nf_ct_tcp_timeout_fin_wait; 438 + extern unsigned int nf_ct_tcp_timeout_close_wait; 439 + extern unsigned int nf_ct_tcp_timeout_last_ack; 440 + extern unsigned int nf_ct_tcp_timeout_time_wait; 441 + extern unsigned int nf_ct_tcp_timeout_close; 442 + extern unsigned int nf_ct_tcp_timeout_max_retrans; 443 443 extern int nf_ct_tcp_loose; 444 444 extern int nf_ct_tcp_be_liberal; 445 445 extern int nf_ct_tcp_max_retrans; 446 446 447 447 /* From nf_conntrack_proto_udp.c */ 448 - extern unsigned long nf_ct_udp_timeout; 449 - extern unsigned long nf_ct_udp_timeout_stream; 448 + extern unsigned int nf_ct_udp_timeout; 449 + extern unsigned int nf_ct_udp_timeout_stream; 450 450 451 451 /* From nf_conntrack_proto_generic.c */ 452 - extern unsigned long nf_ct_generic_timeout; 452 + extern unsigned int nf_ct_generic_timeout; 453 453 454 454 /* Log invalid packets of a given protocol */ 455 455 static int log_invalid_proto_min = 0;
+1 -1
net/netlink/af_netlink.c
··· 1422 1422 while (skb->len >= nlmsg_total_size(0)) { 1423 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 1426 return 0; 1427 1427 1428 1428 total_len = min(NLMSG_ALIGN(nlh->nlmsg_len), skb->len);
+8 -6
net/rxrpc/connection.c
··· 220 220 { 221 221 struct rxrpc_connection *conn, *candidate = NULL; 222 222 struct list_head *_p; 223 + struct sk_buff *pkt = msg->pkt; 223 224 int ret, fresh = 0; 224 225 __be32 x_epoch, x_connid; 225 226 __be16 x_port, x_servid; ··· 230 229 _enter("%p{{%hu}},%u,%hu", 231 230 peer, 232 231 peer->trans->port, 233 - ntohs(msg->pkt->h.uh->source), 232 + ntohs(pkt->h.uh->source), 234 233 ntohs(msg->hdr.serviceId)); 235 234 236 - x_port = msg->pkt->h.uh->source; 235 + x_port = pkt->h.uh->source; 237 236 x_epoch = msg->hdr.epoch; 238 237 x_clflag = msg->hdr.flags & RXRPC_CLIENT_INITIATED; 239 238 x_connid = htonl(ntohl(msg->hdr.cid) & RXRPC_CIDMASK); ··· 268 267 /* fill in the specifics */ 269 268 candidate->addr.sin_family = AF_INET; 270 269 candidate->addr.sin_port = x_port; 271 - candidate->addr.sin_addr.s_addr = msg->pkt->nh.iph->saddr; 270 + candidate->addr.sin_addr.s_addr = pkt->nh.iph->saddr; 272 271 candidate->in_epoch = x_epoch; 273 272 candidate->out_epoch = x_epoch; 274 273 candidate->in_clientflag = RXRPC_CLIENT_INITIATED; ··· 676 675 struct rxrpc_message *msg) 677 676 { 678 677 struct rxrpc_message *pmsg; 678 + struct dst_entry *dst; 679 679 struct list_head *_p; 680 680 unsigned cix, seq; 681 681 int ret = 0; ··· 712 710 713 711 call->pkt_rcv_count++; 714 712 715 - if (msg->pkt->dst && msg->pkt->dst->dev) 713 + dst = msg->pkt->dst; 714 + if (dst && dst->dev) 716 715 conn->peer->if_mtu = 717 - msg->pkt->dst->dev->mtu - 718 - msg->pkt->dst->dev->hard_header_len; 716 + dst->dev->mtu - dst->dev->hard_header_len; 719 717 720 718 /* queue on the call in seq order */ 721 719 rxrpc_get_message(msg);
+2 -2
net/sunrpc/svc.c
··· 166 166 memset(rqstp, 0, sizeof(*rqstp)); 167 167 init_waitqueue_head(&rqstp->rq_wait); 168 168 169 - if (!(rqstp->rq_argp = (u32 *) kmalloc(serv->sv_xdrsize, GFP_KERNEL)) 170 - || !(rqstp->rq_resp = (u32 *) kmalloc(serv->sv_xdrsize, GFP_KERNEL)) 169 + if (!(rqstp->rq_argp = kmalloc(serv->sv_xdrsize, GFP_KERNEL)) 170 + || !(rqstp->rq_resp = kmalloc(serv->sv_xdrsize, GFP_KERNEL)) 171 171 || !svc_init_buffer(rqstp, serv->sv_bufsz)) 172 172 goto out_thread; 173 173