Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/net-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/net-2.6: (41 commits)
  [XFRM]: Fix leak of expired xfrm_states
  [ATM]: [he] initialize lock and tasklet earlier
  [IPV4]: Remove bogus ifdef mess in arp_process
  [SKBUFF]: Free old skb properly in skb_morph
  [IPV4]: Fix memory leak in inet_hashtables.h when NUMA is on
  [IPSEC]: Temporarily remove locks around copying of non-atomic fields
  [TCP] MTUprobe: Cleanup send queue check (no need to loop)
  [TCP]: MTUprobe: receiver window & data available checks fixed
  [MAINTAINERS]: tlan list is subscribers-only
  [SUNRPC]: Remove SPIN_LOCK_UNLOCKED
  [SUNRPC]: Make xprtsock.c:xs_setup_{udp,tcp}() static
  [PFKEY]: Sending an SADB_GET responds with an SADB_GET
  [IRDA]: Compilation for CONFIG_INET=n case
  [IPVS]: Fix compiler warning about unused register_ip_vs_protocol
  [ARP]: Fix arp reply when sender ip 0
  [IPV6] TCPMD5: Fix deleting key operation.
  [IPV6] TCPMD5: Check return value of tcp_alloc_md5sig_pool().
  [IPV4] TCPMD5: Use memmove() instead of memcpy() because we have overlaps.
  [IPV4] TCPMD5: Omit redundant NULL check for kfree() argument.
  ieee80211: Stop net_ratelimit/IEEE80211_DEBUG_DROP log pollution
  ...
  • Loading branch information
Linus Torvalds committed Nov 27, 2007
2 parents 8912858 + 5dba479 commit 8c27eba
Show file tree
Hide file tree
Showing 43 changed files with 122 additions and 206 deletions.
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3725,7 +3725,7 @@ S: Maintained
TLAN NETWORK DRIVER
P: Samuel Chessman
M: [email protected]
L: [email protected]
L: [email protected] (subscribers-only)
W: http://sourceforge.net/projects/tlan/
S: Maintained

Expand Down
10 changes: 5 additions & 5 deletions drivers/atm/he.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,11 @@ he_init_one(struct pci_dev *pci_dev, const struct pci_device_id *pci_ent)
he_dev->atm_dev->dev_data = he_dev;
atm_dev->dev_data = he_dev;
he_dev->number = atm_dev->number;
#ifdef USE_TASKLET
tasklet_init(&he_dev->tasklet, he_tasklet, (unsigned long) he_dev);
#endif
spin_lock_init(&he_dev->global_lock);

if (he_start(atm_dev)) {
he_stop(he_dev);
err = -ENODEV;
Expand Down Expand Up @@ -1173,11 +1178,6 @@ he_start(struct atm_dev *dev)
if ((err = he_init_irq(he_dev)) != 0)
return err;

#ifdef USE_TASKLET
tasklet_init(&he_dev->tasklet, he_tasklet, (unsigned long) he_dev);
#endif
spin_lock_init(&he_dev->global_lock);

/* 4.11 enable pci bus controller state machines */
host_cntl |= (OUTFF_ENB | CMDFF_ENB |
QUICK_RD_RETRY | QUICK_WR_RETRY | PERR_INT_ENB);
Expand Down
7 changes: 3 additions & 4 deletions drivers/net/wireless/rt2x00/rt2500usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,7 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
}

static int rt2500usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev,
int maxpacket, struct sk_buff *skb)
struct sk_buff *skb)
{
int length;

Expand All @@ -1041,7 +1041,7 @@ static int rt2500usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev,
* but it must _not_ be a multiple of the USB packet size.
*/
length = roundup(skb->len, 2);
length += (2 * !(length % maxpacket));
length += (2 * !(length % rt2x00dev->usb_maxpacket));

return length;
}
Expand Down Expand Up @@ -1643,7 +1643,6 @@ static int rt2500usb_beacon_update(struct ieee80211_hw *hw,
struct data_entry *beacon;
struct data_entry *guardian;
int pipe = usb_sndbulkpipe(usb_dev, 1);
int max_packet = usb_maxpacket(usb_dev, pipe, 1);
int length;

/*
Expand Down Expand Up @@ -1672,7 +1671,7 @@ static int rt2500usb_beacon_update(struct ieee80211_hw *hw,
ring->desc_size),
skb->len - ring->desc_size, control);

length = rt2500usb_get_tx_data_len(rt2x00dev, max_packet, skb);
length = rt2500usb_get_tx_data_len(rt2x00dev, skb);

usb_fill_bulk_urb(beacon->priv, usb_dev, pipe,
skb->data, length, rt2500usb_beacondone, beacon);
Expand Down
7 changes: 6 additions & 1 deletion drivers/net/wireless/rt2x00/rt2x00.h
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ struct rt2x00lib_ops {
int (*write_tx_data) (struct rt2x00_dev *rt2x00dev,
struct data_ring *ring, struct sk_buff *skb,
struct ieee80211_tx_control *control);
int (*get_tx_data_len) (struct rt2x00_dev *rt2x00dev, int maxpacket,
int (*get_tx_data_len) (struct rt2x00_dev *rt2x00dev,
struct sk_buff *skb);
void (*kick_tx_queue) (struct rt2x00_dev *rt2x00dev,
unsigned int queue);
Expand Down Expand Up @@ -598,6 +598,11 @@ struct rt2x00_dev {
*/
u32 *rf;

/*
* USB Max frame size (for rt2500usb & rt73usb).
*/
u16 usb_maxpacket;

/*
* Current TX power value.
*/
Expand Down
9 changes: 6 additions & 3 deletions drivers/net/wireless/rt2x00/rt2x00usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev,
interface_to_usbdev(rt2x00dev_usb(rt2x00dev));
struct data_entry *entry = rt2x00_get_data_entry(ring);
int pipe = usb_sndbulkpipe(usb_dev, 1);
int max_packet = usb_maxpacket(usb_dev, pipe, 1);
u32 length;

if (rt2x00_ring_full(ring)) {
Expand Down Expand Up @@ -194,8 +193,7 @@ int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev,
* length of the data to usb_fill_bulk_urb. Pass the skb
* to the driver to determine what the length should be.
*/
length = rt2x00dev->ops->lib->get_tx_data_len(rt2x00dev,
max_packet, skb);
length = rt2x00dev->ops->lib->get_tx_data_len(rt2x00dev, skb);

/*
* Initialize URB and send the frame to the device.
Expand Down Expand Up @@ -490,6 +488,11 @@ int rt2x00usb_probe(struct usb_interface *usb_intf,
rt2x00dev->ops = ops;
rt2x00dev->hw = hw;

rt2x00dev->usb_maxpacket =
usb_maxpacket(usb_dev, usb_sndbulkpipe(usb_dev, 1), 1);
if (!rt2x00dev->usb_maxpacket)
rt2x00dev->usb_maxpacket = 1;

retval = rt2x00usb_alloc_reg(rt2x00dev);
if (retval)
goto exit_free_device;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/rt2x00/rt73usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,7 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
}

static int rt73usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev,
int maxpacket, struct sk_buff *skb)
struct sk_buff *skb)
{
int length;

Expand All @@ -1260,7 +1260,7 @@ static int rt73usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev,
* but it must _not_ be a multiple of the USB packet size.
*/
length = roundup(skb->len, 4);
length += (4 * !(length % maxpacket));
length += (4 * !(length % rt2x00dev->usb_maxpacket));

return length;
}
Expand Down
1 change: 0 additions & 1 deletion include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ static inline struct sk_buff *alloc_skb_fclone(unsigned int size,
return __alloc_skb(size, priority, 1, -1);
}

extern void kfree_skbmem(struct sk_buff *skb);
extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src);
extern struct sk_buff *skb_clone(struct sk_buff *skb,
gfp_t priority);
Expand Down
8 changes: 8 additions & 0 deletions include/net/ieee80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,16 @@ extern u32 ieee80211_debug_level;
do { if (ieee80211_debug_level & (level)) \
printk(KERN_DEBUG "ieee80211: %c %s " fmt, \
in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0)
static inline bool ieee80211_ratelimit_debug(u32 level)
{
return (ieee80211_debug_level & level) && net_ratelimit();
}
#else
#define IEEE80211_DEBUG(level, fmt, args...) do {} while (0)
static inline bool ieee80211_ratelimit_debug(u32 level)
{
return false;
}
#endif /* CONFIG_IEEE80211_DEBUG */

/* escape_essid() is intended to be used in debug (and possibly error)
Expand Down
3 changes: 1 addition & 2 deletions include/net/inet_hashtables.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,8 @@ static inline void inet_ehash_locks_free(struct inet_hashinfo *hashinfo)
if (size > PAGE_SIZE)
vfree(hashinfo->ehash_locks);
else
#else
kfree(hashinfo->ehash_locks);
#endif
kfree(hashinfo->ehash_locks);
hashinfo->ehash_locks = NULL;
}
}
Expand Down
34 changes: 0 additions & 34 deletions include/net/ip_vs.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,40 +327,6 @@ extern int ip_vs_get_debug_level(void);
#define FTPPORT __constant_htons(21)
#define FTPDATA __constant_htons(20)

/*
* IPVS sysctl variables under the /proc/sys/net/ipv4/vs/
*/
#define NET_IPV4_VS 21

enum {
NET_IPV4_VS_DEBUG_LEVEL=1,
NET_IPV4_VS_AMEMTHRESH=2,
NET_IPV4_VS_AMDROPRATE=3,
NET_IPV4_VS_DROP_ENTRY=4,
NET_IPV4_VS_DROP_PACKET=5,
NET_IPV4_VS_SECURE_TCP=6,
NET_IPV4_VS_TO_ES=7,
NET_IPV4_VS_TO_SS=8,
NET_IPV4_VS_TO_SR=9,
NET_IPV4_VS_TO_FW=10,
NET_IPV4_VS_TO_TW=11,
NET_IPV4_VS_TO_CL=12,
NET_IPV4_VS_TO_CW=13,
NET_IPV4_VS_TO_LA=14,
NET_IPV4_VS_TO_LI=15,
NET_IPV4_VS_TO_SA=16,
NET_IPV4_VS_TO_UDP=17,
NET_IPV4_VS_TO_ICMP=18,
NET_IPV4_VS_LBLC_EXPIRE=19,
NET_IPV4_VS_LBLCR_EXPIRE=20,
NET_IPV4_VS_CACHE_BYPASS=22,
NET_IPV4_VS_EXPIRE_NODEST_CONN=23,
NET_IPV4_VS_SYNC_THRESHOLD=24,
NET_IPV4_VS_NAT_ICMP_SEND=25,
NET_IPV4_VS_EXPIRE_QUIESCENT_TEMPLATE=26,
NET_IPV4_VS_LAST
};

/*
* TCP State Values
*/
Expand Down
3 changes: 3 additions & 0 deletions include/net/sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -1236,6 +1236,9 @@ static inline struct sk_buff *sk_stream_alloc_pskb(struct sock *sk,
{
struct sk_buff *skb;

/* The TCP header must be at least 32-bit aligned. */
size = ALIGN(size, 4);

skb = alloc_skb_fclone(size + sk->sk_prot->max_header, gfp);
if (skb) {
skb->truesize += mem;
Expand Down
3 changes: 3 additions & 0 deletions include/net/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -1288,6 +1288,9 @@ static inline void tcp_insert_write_queue_before(struct sk_buff *new,
struct sock *sk)
{
__skb_insert(new, skb->prev, skb, &sk->sk_write_queue);

if (sk->sk_send_head == skb)
sk->sk_send_head = new;
}

static inline void tcp_unlink_write_queue(struct sk_buff *skb, struct sock *sk)
Expand Down
31 changes: 0 additions & 31 deletions kernel/sysctl_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,36 +234,6 @@ static struct trans_ctl_table trans_net_ipv4_conf_table[] = {
{}
};


static struct trans_ctl_table trans_net_ipv4_vs_table[] = {
{ NET_IPV4_VS_AMEMTHRESH, "amemthresh" },
{ NET_IPV4_VS_DEBUG_LEVEL, "debug_level" },
{ NET_IPV4_VS_AMDROPRATE, "am_droprate" },
{ NET_IPV4_VS_DROP_ENTRY, "drop_entry" },
{ NET_IPV4_VS_DROP_PACKET, "drop_packet" },
{ NET_IPV4_VS_SECURE_TCP, "secure_tcp" },
{ NET_IPV4_VS_TO_ES, "timeout_established" },
{ NET_IPV4_VS_TO_SS, "timeout_synsent" },
{ NET_IPV4_VS_TO_SR, "timeout_synrecv" },
{ NET_IPV4_VS_TO_FW, "timeout_finwait" },
{ NET_IPV4_VS_TO_TW, "timeout_timewait" },
{ NET_IPV4_VS_TO_CL, "timeout_close" },
{ NET_IPV4_VS_TO_CW, "timeout_closewait" },
{ NET_IPV4_VS_TO_LA, "timeout_lastack" },
{ NET_IPV4_VS_TO_LI, "timeout_listen" },
{ NET_IPV4_VS_TO_SA, "timeout_synack" },
{ NET_IPV4_VS_TO_UDP, "timeout_udp" },
{ NET_IPV4_VS_TO_ICMP, "timeout_icmp" },
{ NET_IPV4_VS_CACHE_BYPASS, "cache_bypass" },
{ NET_IPV4_VS_EXPIRE_NODEST_CONN, "expire_nodest_conn" },
{ NET_IPV4_VS_EXPIRE_QUIESCENT_TEMPLATE, "expire_quiescent_template" },
{ NET_IPV4_VS_SYNC_THRESHOLD, "sync_threshold" },
{ NET_IPV4_VS_NAT_ICMP_SEND, "nat_icmp_send" },
{ NET_IPV4_VS_LBLC_EXPIRE, "lblc_expiration" },
{ NET_IPV4_VS_LBLCR_EXPIRE, "lblcr_expiration" },
{}
};

static struct trans_ctl_table trans_net_neigh_vars_table[] = {
{ NET_NEIGH_MCAST_SOLICIT, "mcast_solicit" },
{ NET_NEIGH_UCAST_SOLICIT, "ucast_solicit" },
Expand Down Expand Up @@ -338,7 +308,6 @@ static struct trans_ctl_table trans_net_ipv4_table[] = {
{ NET_IPV4_ROUTE, "route", trans_net_ipv4_route_table },
/* NET_IPV4_FIB_HASH unused */
{ NET_IPV4_NETFILTER, "netfilter", trans_net_ipv4_netfilter_table },
{ NET_IPV4_VS, "vs", trans_net_ipv4_vs_table },

{ NET_IPV4_TCP_TIMESTAMPS, "tcp_timestamps" },
{ NET_IPV4_TCP_WINDOW_SCALING, "tcp_window_scaling" },
Expand Down
2 changes: 1 addition & 1 deletion net/bridge/netfilter/ebt_among.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ static int ebt_among_check(const char *tablename, unsigned int hookmask,

if (datalen != EBT_ALIGN(expected_length)) {
printk(KERN_WARNING
"ebtables: among: wrong size: %d"
"ebtables: among: wrong size: %d "
"against expected %d, rounded to %Zd\n",
datalen, expected_length,
EBT_ALIGN(expected_length));
Expand Down
2 changes: 0 additions & 2 deletions net/core/pktgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -2463,8 +2463,6 @@ static int pktgen_output_ipsec(struct sk_buff *skb, struct pktgen_dev *pkt_dev)

x->curlft.bytes +=skb->len;
x->curlft.packets++;
spin_unlock(&x->lock);

error:
spin_unlock(&x->lock);
return err;
Expand Down
31 changes: 18 additions & 13 deletions net/core/skbuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,11 @@ static void skb_release_data(struct sk_buff *skb)
/*
* Free an skbuff by memory without cleaning the state.
*/
void kfree_skbmem(struct sk_buff *skb)
static void kfree_skbmem(struct sk_buff *skb)
{
struct sk_buff *other;
atomic_t *fclone_ref;

skb_release_data(skb);
switch (skb->fclone) {
case SKB_FCLONE_UNAVAILABLE:
kmem_cache_free(skbuff_head_cache, skb);
Expand All @@ -307,16 +306,8 @@ void kfree_skbmem(struct sk_buff *skb)
}
}

/**
* __kfree_skb - private function
* @skb: buffer
*
* Free an sk_buff. Release anything attached to the buffer.
* Clean the state. This is an internal helper function. Users should
* always call kfree_skb
*/

void __kfree_skb(struct sk_buff *skb)
/* Free everything but the sk_buff shell. */
static void skb_release_all(struct sk_buff *skb)
{
dst_release(skb->dst);
#ifdef CONFIG_XFRM
Expand All @@ -340,7 +331,21 @@ void __kfree_skb(struct sk_buff *skb)
skb->tc_verd = 0;
#endif
#endif
skb_release_data(skb);
}

/**
* __kfree_skb - private function
* @skb: buffer
*
* Free an sk_buff. Release anything attached to the buffer.
* Clean the state. This is an internal helper function. Users should
* always call kfree_skb
*/

void __kfree_skb(struct sk_buff *skb)
{
skb_release_all(skb);
kfree_skbmem(skb);
}

Expand Down Expand Up @@ -441,7 +446,7 @@ static struct sk_buff *__skb_clone(struct sk_buff *n, struct sk_buff *skb)
*/
struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src)
{
skb_release_data(dst);
skb_release_all(dst);
return __skb_clone(dst, src);
}
EXPORT_SYMBOL_GPL(skb_morph);
Expand Down
2 changes: 1 addition & 1 deletion net/dccp/ccids/lib/loss_interval.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ static u32 dccp_li_calc_first_li(struct sock *sk,
}

if (unlikely(interval == 0)) {
DCCP_WARN("%s(%p), Could not find a win_count interval > 0."
DCCP_WARN("%s(%p), Could not find a win_count interval > 0. "
"Defaulting to 1\n", dccp_role(sk), sk);
interval = 1;
}
Expand Down
2 changes: 1 addition & 1 deletion net/ieee80211/ieee80211_crypt_ccmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
pos += 8;

if (ccmp_replay_check(pn, key->rx_pn)) {
if (net_ratelimit()) {
if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) {
IEEE80211_DEBUG_DROP("CCMP: replay detected: STA=%s "
"previous PN %02x%02x%02x%02x%02x%02x "
"received PN %02x%02x%02x%02x%02x%02x\n",
Expand Down
4 changes: 2 additions & 2 deletions net/ieee80211/ieee80211_crypt_tkip.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
pos += 8;

if (tkip_replay_check(iv32, iv16, tkey->rx_iv32, tkey->rx_iv16)) {
if (net_ratelimit()) {
if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) {
IEEE80211_DEBUG_DROP("TKIP: replay detected: STA=%s"
" previous TSC %08x%04x received TSC "
"%08x%04x\n", print_mac(mac, hdr->addr2),
Expand Down Expand Up @@ -504,7 +504,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
* it needs to be recalculated for the next packet. */
tkey->rx_phase1_done = 0;
}
if (net_ratelimit()) {
if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) {
IEEE80211_DEBUG_DROP("TKIP: ICV error detected: STA="
"%s\n", print_mac(mac, hdr->addr2));
}
Expand Down
Loading

0 comments on commit 8c27eba

Please sign in to comment.