Skip to content

Commit

Permalink
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/…
Browse files Browse the repository at this point in the history
…davem/net-2.6

* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (24 commits)
  [IPSEC]: Add xfrm_sysctl.txt.
  [BRIDGE]: Round off STP perodic timers.
  [BRIDGE]: Reduce frequency of forwarding cleanup timer in bridge.
  [TCP] tcp_probe: use GCC printf attribute
  [TCP] tcp_probe: a trivial fix for mismatched number of printl arguments.
  [IPV6] ADDRCONF: Fix conflicts in DEVCONF_xxx constant.
  [NET] napi: Call __netif_rx_complete in netif_rx_complete
  [TCP]: Consolidate checking for tcp orphan count being too big.
  [SOCK]: Shrink struct sock by 8 bytes on 64-bit.
  [AF_PACKET]: Kill CONFIG_PACKET_SOCKET.
  [IPV6]: Fix build warning.
  [AF_PACKET]: Kill bogus CONFIG_PACKET_MULTICAST
  [IPV4]: Kill references to bogus non-existent CONFIG_IP_NOSIOCRT
  [IPSEC]: Fix panic when using inter address familiy IPsec on loopback.
  [NET]: parse ip:port strings correctly in in4_pton
  [IPV6] ROUTE: No longer handle ::/0 specially.
  [IPSEC]: Fix IPv6 AH calculation in outbound
  [XFRM]: xfrm_larval_drop sysctl should be __read_mostly.
  [XFRM]: Allow XFRM_ACQ_EXPIRES to be tunable via sysctl.
  [CASSINI]: Fix printk message typo.
  ...
  • Loading branch information
Linus Torvalds committed May 31, 2007
2 parents 0c27011 + 85553dd commit b9066c2
Show file tree
Hide file tree
Showing 27 changed files with 93 additions and 121 deletions.
4 changes: 4 additions & 0 deletions Documentation/networking/xfrm_sysctl.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/proc/sys/net/core/xfrm_* Variables:

xfrm_acq_expires - INTEGER
default 30 - hard timeout in seconds for acquire requests
2 changes: 1 addition & 1 deletion drivers/net/cassini.c
Original file line number Diff line number Diff line change
Expand Up @@ -4920,7 +4920,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
pci_cmd |= PCI_COMMAND_PARITY;
pci_write_config_word(pdev, PCI_COMMAND, pci_cmd);
if (pci_set_mwi(pdev))
printk(KERN_WARNING PFX "Could enable MWI for %s\n",
printk(KERN_WARNING PFX "Could not enable MWI for %s\n",
pci_name(pdev));

/*
Expand Down
3 changes: 1 addition & 2 deletions include/linux/ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,8 @@ enum {
DEVCONF_RTR_PROBE_INTERVAL,
DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN,
DEVCONF_PROXY_NDP,
__DEVCONF_OPTIMISTIC_DAD,
DEVCONF_ACCEPT_SOURCE_ROUTE,
DEVCONF_OPTIMISTIC_DAD,
DEVCONF_ACCEPT_SOURCE_ROUTE,
DEVCONF_MAX
};

Expand Down
27 changes: 12 additions & 15 deletions include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,17 @@ static inline int netif_rx_reschedule(struct net_device *dev, int undo)
return 0;
}

/* same as netif_rx_complete, except that local_irq_save(flags)
* has already been issued
*/
static inline void __netif_rx_complete(struct net_device *dev)
{
BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state));
list_del(&dev->poll_list);
smp_mb__before_clear_bit();
clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
}

/* Remove interface from poll list: it must be in the poll list
* on current cpu. This primitive is called by dev->poll(), when
* it completes the work. The device cannot be out of poll list at this
Expand All @@ -920,10 +931,7 @@ static inline void netif_rx_complete(struct net_device *dev)
unsigned long flags;

local_irq_save(flags);
BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state));
list_del(&dev->poll_list);
smp_mb__before_clear_bit();
clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
__netif_rx_complete(dev);
local_irq_restore(flags);
}

Expand All @@ -940,17 +948,6 @@ static inline void netif_poll_enable(struct net_device *dev)
clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
}

/* same as netif_rx_complete, except that local_irq_save(flags)
* has already been issued
*/
static inline void __netif_rx_complete(struct net_device *dev)
{
BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state));
list_del(&dev->poll_list);
smp_mb__before_clear_bit();
clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
}

static inline void netif_tx_lock(struct net_device *dev)
{
spin_lock(&dev->_xmit_lock);
Expand Down
2 changes: 1 addition & 1 deletion include/net/sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,13 @@ struct sock {
atomic_t sk_rmem_alloc;
atomic_t sk_wmem_alloc;
atomic_t sk_omem_alloc;
int sk_sndbuf;
struct sk_buff_head sk_receive_queue;
struct sk_buff_head sk_write_queue;
struct sk_buff_head sk_async_wait_queue;
int sk_wmem_queued;
int sk_forward_alloc;
gfp_t sk_allocation;
int sk_sndbuf;
int sk_route_caps;
int sk_gso_type;
int sk_rcvlowat;
Expand Down
6 changes: 6 additions & 0 deletions include/net/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,12 @@ static inline int between(__u32 seq1, __u32 seq2, __u32 seq3)
return seq3 - seq2 >= seq1 - seq2;
}

static inline int tcp_too_many_orphans(struct sock *sk, int num)
{
return (num > sysctl_tcp_max_orphans) ||
(sk->sk_wmem_queued > SOCK_MIN_SNDBUF &&
atomic_read(&tcp_memory_allocated) > sysctl_tcp_mem[2]);
}

extern struct proto tcp_prot;

Expand Down
1 change: 0 additions & 1 deletion include/net/xfrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ extern int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo);
extern int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo);
extern void km_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c);
extern void km_state_notify(struct xfrm_state *x, struct km_event *c);
#define XFRM_ACQ_EXPIRES 30

struct xfrm_tmpl;
extern int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *pol);
Expand Down
14 changes: 11 additions & 3 deletions net/bridge/br_fdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ void br_fdb_cleanup(unsigned long _data)
{
struct net_bridge *br = (struct net_bridge *)_data;
unsigned long delay = hold_time(br);
unsigned long next_timer = jiffies + br->forward_delay;
int i;

spin_lock_bh(&br->hash_lock);
Expand All @@ -129,14 +130,21 @@ void br_fdb_cleanup(unsigned long _data)
struct hlist_node *h, *n;

hlist_for_each_entry_safe(f, h, n, &br->hash[i], hlist) {
if (!f->is_static &&
time_before_eq(f->ageing_timer + delay, jiffies))
unsigned long this_timer;
if (f->is_static)
continue;
this_timer = f->ageing_timer + delay;
if (time_before_eq(this_timer, jiffies))
fdb_delete(f);
else if (this_timer < next_timer)
next_timer = this_timer;
}
}
spin_unlock_bh(&br->hash_lock);

mod_timer(&br->gc_timer, jiffies + HZ/10);
/* Add HZ/4 to ensure we round the jiffies upwards to be after the next
* timer, otherwise we might round down and will have no-op run. */
mod_timer(&br->gc_timer, round_jiffies(next_timer + HZ/4));
}

/* Completely flush all dynamic entries in forwarding database.*/
Expand Down
3 changes: 2 additions & 1 deletion net/bridge/br_stp.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ void br_transmit_config(struct net_bridge_port *p)
br_send_config_bpdu(p, &bpdu);
p->topology_change_ack = 0;
p->config_pending = 0;
mod_timer(&p->hold_timer, jiffies + BR_HOLD_TIME);
mod_timer(&p->hold_timer,
round_jiffies(jiffies + BR_HOLD_TIME));
}
}

Expand Down
2 changes: 1 addition & 1 deletion net/bridge/br_stp_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static void br_hello_timer_expired(unsigned long arg)
if (br->dev->flags & IFF_UP) {
br_config_bpdu_generation(br);

mod_timer(&br->hello_timer, jiffies + br->hello_time);
mod_timer(&br->hello_timer, round_jiffies(jiffies + br->hello_time));
}
spin_unlock(&br->lock);
}
Expand Down
9 changes: 9 additions & 0 deletions net/core/sysctl_net_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ extern int sysctl_core_destroy_delay;
extern u32 sysctl_xfrm_aevent_etime;
extern u32 sysctl_xfrm_aevent_rseqth;
extern int sysctl_xfrm_larval_drop;
extern u32 sysctl_xfrm_acq_expires;
#endif

ctl_table core_table[] = {
Expand Down Expand Up @@ -127,6 +128,14 @@ ctl_table core_table[] = {
.mode = 0644,
.proc_handler = &proc_dointvec
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "xfrm_acq_expires",
.data = &sysctl_xfrm_acq_expires,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec
},
#endif /* CONFIG_XFRM */
#endif /* CONFIG_NET */
{
Expand Down
6 changes: 3 additions & 3 deletions net/core/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,16 @@ int in4_pton(const char *src, int srclen,
while(1) {
int c;
c = xdigit2bin(srclen > 0 ? *s : '\0', delim);
if (!(c & (IN6PTON_DIGIT | IN6PTON_DOT | IN6PTON_DELIM))) {
if (!(c & (IN6PTON_DIGIT | IN6PTON_DOT | IN6PTON_DELIM | IN6PTON_COLON_MASK))) {
goto out;
}
if (c & (IN6PTON_DOT | IN6PTON_DELIM)) {
if (c & (IN6PTON_DOT | IN6PTON_DELIM | IN6PTON_COLON_MASK)) {
if (w == 0)
goto out;
*d++ = w & 0xff;
w = 0;
i++;
if (c & IN6PTON_DELIM) {
if (c & (IN6PTON_DELIM | IN6PTON_COLON_MASK)) {
if (i != 4)
goto out;
break;
Expand Down
11 changes: 0 additions & 11 deletions net/ipv4/fib_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,6 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
return -EINVAL;
}

#ifndef CONFIG_IP_NOSIOCRT

static inline __be32 sk_extract_addr(struct sockaddr *addr)
{
return ((struct sockaddr_in *) addr)->sin_addr.s_addr;
Expand Down Expand Up @@ -443,15 +441,6 @@ int ip_rt_ioctl(unsigned int cmd, void __user *arg)
return -EINVAL;
}

#else

int ip_rt_ioctl(unsigned int cmd, void *arg)
{
return -EINVAL;
}

#endif

struct nla_policy rtm_ipv4_policy[RTA_MAX+1] __read_mostly = {
[RTA_DST] = { .type = NLA_U32 },
[RTA_SRC] = { .type = NLA_U32 },
Expand Down
5 changes: 2 additions & 3 deletions net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1674,9 +1674,8 @@ void tcp_close(struct sock *sk, long timeout)
}
if (sk->sk_state != TCP_CLOSE) {
sk_stream_mem_reclaim(sk);
if (atomic_read(sk->sk_prot->orphan_count) > sysctl_tcp_max_orphans ||
(sk->sk_wmem_queued > SOCK_MIN_SNDBUF &&
atomic_read(&tcp_memory_allocated) > sysctl_tcp_mem[2])) {
if (tcp_too_many_orphans(sk,
atomic_read(sk->sk_prot->orphan_count))) {
if (net_ratelimit())
printk(KERN_INFO "TCP: too many of orphaned "
"sockets\n");
Expand Down
5 changes: 3 additions & 2 deletions net/ipv4/tcp_probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ static void printl(const char *fmt, ...)

kfifo_put(tcpw.fifo, tbuf, len);
wake_up(&tcpw.wait);
}
} __attribute__ ((format (printf, 1, 2)));


/*
* Hook inserted to be called before each receive packet.
Expand All @@ -95,7 +96,7 @@ static int jtcp_rcv_established(struct sock *sk, struct sk_buff *skb,
/* Only update if port matches */
if ((port == 0 || ntohs(inet->dport) == port || ntohs(inet->sport) == port)
&& (full || tp->snd_cwnd != tcpw.lastcwnd)) {
printl("%d.%d.%d.%d:%u %d.%d.%d.%d:%u %d %#x %#x %u %u %u\n",
printl("%d.%d.%d.%d:%u %d.%d.%d.%d:%u %d %#x %#x %u %u %u %u\n",
NIPQUAD(inet->saddr), ntohs(inet->sport),
NIPQUAD(inet->daddr), ntohs(inet->dport),
skb->len, tp->snd_nxt, tp->snd_una,
Expand Down
4 changes: 1 addition & 3 deletions net/ipv4/tcp_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ static int tcp_out_of_resources(struct sock *sk, int do_reset)
if (sk->sk_err_soft)
orphans <<= 1;

if (orphans >= sysctl_tcp_max_orphans ||
(sk->sk_wmem_queued > SOCK_MIN_SNDBUF &&
atomic_read(&tcp_memory_allocated) > sysctl_tcp_mem[2])) {
if (tcp_too_many_orphans(sk, orphans)) {
if (net_ratelimit())
printk(KERN_INFO "Out of socket memory\n");

Expand Down
6 changes: 2 additions & 4 deletions net/ipv4/xfrm4_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,8 @@ int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type)
nf_reset(skb);

if (decaps) {
if (!(skb->dev->flags&IFF_LOOPBACK)) {
dst_release(skb->dst);
skb->dst = NULL;
}
dst_release(skb->dst);
skb->dst = NULL;
netif_rx(skb);
return 0;
} else {
Expand Down
2 changes: 2 additions & 0 deletions net/ipv4/xfrm4_mode_tunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ static int xfrm4_tunnel_output(struct xfrm_state *x, struct sk_buff *skb)
top_iph->saddr = x->props.saddr.a4;
top_iph->daddr = x->id.daddr.a4;

skb->protocol = htons(ETH_P_IP);

memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/ah6.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ static int ah6_output(struct xfrm_state *x, struct sk_buff *skb)
memcpy(tmp_base, top_iph, sizeof(tmp_base));

tmp_ext = NULL;
extlen = skb_transport_offset(skb) + sizeof(struct ipv6hdr);
extlen = skb_transport_offset(skb) - sizeof(struct ipv6hdr);
if (extlen) {
extlen += sizeof(*tmp_ext);
tmp_ext = kmalloc(extlen, GFP_ATOMIC);
Expand Down
9 changes: 0 additions & 9 deletions net/ipv6/ip6_fib.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,14 +619,6 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt,

ins = &fn->leaf;

if (fn->fn_flags&RTN_TL_ROOT &&
fn->leaf == &ip6_null_entry &&
!(rt->rt6i_flags & (RTF_DEFAULT | RTF_ADDRCONF)) ){
fn->leaf = rt;
rt->u.dst.rt6_next = NULL;
goto out;
}

for (iter = fn->leaf; iter; iter=iter->u.dst.rt6_next) {
/*
* Search for duplicates
Expand Down Expand Up @@ -666,7 +658,6 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt,
* insert node
*/

out:
rt->u.dst.rt6_next = iter;
*ins = rt;
rt->rt6i_node = fn;
Expand Down
6 changes: 2 additions & 4 deletions net/ipv6/xfrm6_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,8 @@ int xfrm6_rcv_spi(struct sk_buff *skb, __be32 spi)
nf_reset(skb);

if (decaps) {
if (!(skb->dev->flags&IFF_LOOPBACK)) {
dst_release(skb->dst);
skb->dst = NULL;
}
dst_release(skb->dst);
skb->dst = NULL;
netif_rx(skb);
return -1;
} else {
Expand Down
1 change: 1 addition & 0 deletions net/ipv6/xfrm6_mode_tunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ static int xfrm6_tunnel_output(struct xfrm_state *x, struct sk_buff *skb)
top_iph->hop_limit = dst_metric(dst->child, RTAX_HOPLIMIT);
ipv6_addr_copy(&top_iph->saddr, (struct in6_addr *)&x->props.saddr);
ipv6_addr_copy(&top_iph->daddr, (struct in6_addr *)&x->id.daddr);
skb->protocol = htons(ETH_P_IPV6);
return 0;
}

Expand Down
6 changes: 5 additions & 1 deletion net/mac80211/ieee80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -2474,6 +2474,8 @@ static int ieee80211_open(struct net_device *dev)
if (sdata->type == IEEE80211_IF_TYPE_STA &&
!local->user_space_mlme)
netif_carrier_off(dev);
else
netif_carrier_on(dev);

netif_start_queue(dev);
return 0;
Expand Down Expand Up @@ -3278,8 +3280,10 @@ ieee80211_rx_h_defragment(struct ieee80211_txrx_data *rx)
return TXRX_DROP;
}
}
while ((skb = __skb_dequeue(&entry->skb_list)))
while ((skb = __skb_dequeue(&entry->skb_list))) {
memcpy(skb_put(rx->skb, skb->len), skb->data, skb->len);
dev_kfree_skb(skb);
}

/* Complete frame has been reassembled - process it now */
rx->fragmented = 1;
Expand Down
4 changes: 3 additions & 1 deletion net/mac80211/ieee80211_sta.c
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,8 @@ static void ieee80211_rx_mgmt_assoc_resp(struct net_device *dev,
if (status_code != WLAN_STATUS_SUCCESS) {
printk(KERN_DEBUG "%s: AP denied association (code=%d)\n",
dev->name, status_code);
if (status_code == WLAN_STATUS_REASSOC_NO_ASSOC)
ifsta->prev_bssid_set = 0;
return;
}

Expand Down Expand Up @@ -2995,7 +2997,7 @@ struct sta_info * ieee80211_ibss_add_sta(struct net_device *dev,
{
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
struct sta_info *sta;
struct ieee80211_sub_if_data *sdata = NULL;
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);

/* TODO: Could consider removing the least recently used entry and
* allow new one to be added. */
Expand Down
Loading

0 comments on commit b9066c2

Please sign in to comment.