Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  [IRDA]: irda parameters warning fixes.
  [IRDA]: stir4200 fixes.
  [IRDA]: irlmp_unregister_link() needs to free lsaps.
  [IRDA]: mcs7780 needs to free allocated rx buffer.
  [IRDA]: Race between open and disconnect in irda-usb.
  [SCTP]: Flush fragment queue when exiting partial delivery.
  [AX25]: Locking dependencies fix in ax25_disconnect().
  [IPV4]: Make tcp_input_metrics() get minimum RTO via tcp_rto_min()
  [IPV6]: Fix the return value of ipv6_getsockopt
  [BRIDGE]: Assign random address.
  [IPV4]: Updates to nfsroot documentation
  [ATM]: Fix compiler warning noise with FORE200E driver
  [NETFILTER]: bridge: fix missing link layer headers on outgoing routed packets
  [SYNCPPP]: Endianness and 64bit fixes.
  [TIPC]: Fix semaphore handling.
  [NETFILTER]: xt_hashlimit should use time_after_eq()
  [XFRM]: Display the audited SPI value in host byte order.
  [NETFILTER]: ip_tables: fix compat copy race
  [NETFILTER]: ctnetlink: set expected bit for related conntracks
  • Loading branch information
Linus Torvalds committed Dec 17, 2007
2 parents de29cba + a26e01d commit aa62a86
Show file tree
Hide file tree
Showing 21 changed files with 118 additions and 114 deletions.
12 changes: 9 additions & 3 deletions Documentation/nfsroot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,14 @@ ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>
autoconfiguration.

The <autoconf> parameter can appear alone as the value to the `ip'
parameter (without all the ':' characters before) in which case auto-
configuration is used.
parameter (without all the ':' characters before). If the value is
"ip=off" or "ip=none", no autoconfiguration will take place, otherwise
autoconfiguration will take place. The most common way to use this
is "ip=dhcp".

Note that "ip=off" is not the same thing as "ip=::::::off", because in
the latter autoconfiguration will take place if any of DHCP, BOOTP or RARP
are compiled in the kernel.

<client-ip> IP address of the client.

Expand Down Expand Up @@ -142,7 +148,7 @@ ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>
into the kernel will be used, regardless of the value of
this option.

off or none: don't use autoconfiguration (default)
off or none: don't use autoconfiguration
on or any: use any protocol available in the kernel
dhcp: use DHCP
bootp: use BOOTP
Expand Down
3 changes: 1 addition & 2 deletions drivers/atm/fore200e.c
Original file line number Diff line number Diff line change
Expand Up @@ -2689,7 +2689,7 @@ fore200e_init(struct fore200e* fore200e)
return 0;
}


#ifdef CONFIG_ATM_FORE200E_PCA
static int __devinit
fore200e_pca_detect(struct pci_dev *pci_dev, const struct pci_device_id *pci_ent)
{
Expand Down Expand Up @@ -2756,7 +2756,6 @@ static void __devexit fore200e_pca_remove_one(struct pci_dev *pci_dev)
}


#ifdef CONFIG_ATM_FORE200E_PCA
static struct pci_device_id fore200e_pca_tbl[] = {
{ PCI_VENDOR_ID_FORE, PCI_DEVICE_ID_FORE_PCA200E, PCI_ANY_ID, PCI_ANY_ID,
0, 0, (unsigned long) &fore200e_bus[0] },
Expand Down
5 changes: 5 additions & 0 deletions drivers/net/irda/irda-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,7 @@ static int stir421x_patch_device(struct irda_usb_cb *self)
static int irda_usb_net_open(struct net_device *netdev)
{
struct irda_usb_cb *self;
unsigned long flags;
char hwname[16];
int i;

Expand All @@ -1177,13 +1178,16 @@ static int irda_usb_net_open(struct net_device *netdev)
self = (struct irda_usb_cb *) netdev->priv;
IRDA_ASSERT(self != NULL, return -1;);

spin_lock_irqsave(&self->lock, flags);
/* Can only open the device if it's there */
if(!self->present) {
spin_unlock_irqrestore(&self->lock, flags);
IRDA_WARNING("%s(), device not present!\n", __FUNCTION__);
return -1;
}

if(self->needspatch) {
spin_unlock_irqrestore(&self->lock, flags);
IRDA_WARNING("%s(), device needs patch\n", __FUNCTION__) ;
return -EIO ;
}
Expand All @@ -1198,6 +1202,7 @@ static int irda_usb_net_open(struct net_device *netdev)
/* To do *before* submitting Rx urbs and starting net Tx queue
* Jean II */
self->netopen = 1;
spin_unlock_irqrestore(&self->lock, flags);

/*
* Now that everything should be initialized properly,
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/irda/mcs7780.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,8 @@ static int mcs_net_close(struct net_device *netdev)
/* Stop transmit processing */
netif_stop_queue(netdev);

kfree_skb(mcs->rx_buff.skb);

/* kill and free the receive and transmit URBs */
usb_kill_urb(mcs->rx_urb);
usb_free_urb(mcs->rx_urb);
Expand Down
10 changes: 6 additions & 4 deletions drivers/net/irda/stir4200.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,6 @@ enum StirCtrl2Mask {
};

enum StirFifoCtlMask {
FIFOCTL_EOF = 0x80,
FIFOCTL_UNDER = 0x40,
FIFOCTL_OVER = 0x20,
FIFOCTL_DIR = 0x10,
FIFOCTL_CLR = 0x08,
FIFOCTL_EMPTY = 0x04,
Expand Down Expand Up @@ -594,9 +591,10 @@ static int fifo_txwait(struct stir_cb *stir, int space)
{
int err;
unsigned long count, status;
unsigned long prev_count = 0x1fff;

/* Read FIFO status and count */
for(;;) {
for (;; prev_count = count) {
err = read_reg(stir, REG_FIFOCTL, stir->fifo_status,
FIFO_REGS_SIZE);
if (unlikely(err != FIFO_REGS_SIZE)) {
Expand Down Expand Up @@ -629,6 +627,10 @@ static int fifo_txwait(struct stir_cb *stir, int space)
if (space >= 0 && STIR_FIFO_SIZE - 4 > space + count)
return 0;

/* queue confused */
if (prev_count < count)
break;

/* estimate transfer time for remaining chars */
msleep((count * 8000) / stir->speed);
}
Expand Down
35 changes: 17 additions & 18 deletions drivers/net/wan/syncppp.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,24 +107,24 @@
struct ppp_header {
u8 address;
u8 control;
u16 protocol;
__be16 protocol;
};
#define PPP_HEADER_LEN sizeof (struct ppp_header)

struct lcp_header {
u8 type;
u8 ident;
u16 len;
__be16 len;
};
#define LCP_HEADER_LEN sizeof (struct lcp_header)

struct cisco_packet {
u32 type;
u32 par1;
u32 par2;
u16 rel;
u16 time0;
u16 time1;
__be32 type;
__be32 par1;
__be32 par2;
__be16 rel;
__be16 time0;
__be16 time1;
};
#define CISCO_PACKET_LEN 18
#define CISCO_BIG_PACKET_LEN 20
Expand All @@ -139,7 +139,7 @@ static struct sk_buff_head tx_queue;
static void sppp_keepalive (unsigned long dummy);
static void sppp_cp_send (struct sppp *sp, u16 proto, u8 type,
u8 ident, u16 len, void *data);
static void sppp_cisco_send (struct sppp *sp, int type, long par1, long par2);
static void sppp_cisco_send (struct sppp *sp, int type, u32 par1, u32 par2);
static void sppp_lcp_input (struct sppp *sp, struct sk_buff *m);
static void sppp_cisco_input (struct sppp *sp, struct sk_buff *m);
static void sppp_ipcp_input (struct sppp *sp, struct sk_buff *m);
Expand Down Expand Up @@ -447,7 +447,7 @@ static void sppp_keepalive (unsigned long dummy)
sppp_cisco_send (sp, CISCO_KEEPALIVE_REQ, ++sp->pp_seq,
sp->pp_rseq);
else if (sp->lcp.state == LCP_STATE_OPENED) {
long nmagic = htonl (sp->lcp.magic);
__be32 nmagic = htonl (sp->lcp.magic);
sp->lcp.echoid = ++sp->pp_seq;
sppp_cp_send (sp, PPP_LCP, LCP_ECHO_REQ,
sp->lcp.echoid, 4, &nmagic);
Expand Down Expand Up @@ -667,7 +667,7 @@ static void sppp_lcp_input (struct sppp *sp, struct sk_buff *skb)
dev->name, len);
break;
}
if (ntohl (*(long*)(h+1)) == sp->lcp.magic) {
if (ntohl (*(__be32*)(h+1)) == sp->lcp.magic) {
/* Line loopback mode detected. */
printk (KERN_WARNING "%s: loopback\n", dev->name);
if_down (dev);
Expand All @@ -680,7 +680,7 @@ static void sppp_lcp_input (struct sppp *sp, struct sk_buff *skb)
sppp_lcp_open (sp);
break;
}
*(long*)(h+1) = htonl (sp->lcp.magic);
*(__be32 *)(h+1) = htonl (sp->lcp.magic);
sppp_cp_send (sp, PPP_LCP, LCP_ECHO_REPLY, h->ident, len-4, h+1);
break;
case LCP_ECHO_REPLY:
Expand All @@ -692,7 +692,7 @@ static void sppp_lcp_input (struct sppp *sp, struct sk_buff *skb)
dev->name, len);
break;
}
if (ntohl (*(long*)(h+1)) != sp->lcp.magic)
if (ntohl(*(__be32 *)(h+1)) != sp->lcp.magic)
sp->pp_alivecnt = 0;
break;
}
Expand Down Expand Up @@ -765,7 +765,7 @@ static void sppp_cisco_input (struct sppp *sp, struct sk_buff *skb)
{
struct in_device *in_dev;
struct in_ifaddr *ifa;
__be32 addr = 0, mask = ~0; /* FIXME: is the mask correct? */
__be32 addr = 0, mask = htonl(~0U); /* FIXME: is the mask correct? */
#ifdef CONFIG_INET
rcu_read_lock();
if ((in_dev = __in_dev_get_rcu(dev)) != NULL)
Expand All @@ -782,8 +782,7 @@ static void sppp_cisco_input (struct sppp *sp, struct sk_buff *skb)
}
rcu_read_unlock();
#endif
/* I hope both addr and mask are in the net order */
sppp_cisco_send (sp, CISCO_ADDR_REPLY, addr, mask);
sppp_cisco_send (sp, CISCO_ADDR_REPLY, ntohl(addr), ntohl(mask));
break;
}
}
Expand Down Expand Up @@ -844,7 +843,7 @@ static void sppp_cp_send (struct sppp *sp, u16 proto, u8 type,
* Send Cisco keepalive packet.
*/

static void sppp_cisco_send (struct sppp *sp, int type, long par1, long par2)
static void sppp_cisco_send (struct sppp *sp, int type, u32 par1, u32 par2)
{
struct ppp_header *h;
struct cisco_packet *ch;
Expand All @@ -868,7 +867,7 @@ static void sppp_cisco_send (struct sppp *sp, int type, long par1, long par2)
ch->type = htonl (type);
ch->par1 = htonl (par1);
ch->par2 = htonl (par2);
ch->rel = -1;
ch->rel = htons(0xffff);
ch->time0 = htons ((u16) (t >> 16));
ch->time1 = htons ((u16) t);

Expand Down
3 changes: 2 additions & 1 deletion include/linux/netfilter_bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ enum nf_br_hook_priorities {
extern int nf_bridge_copy_header(struct sk_buff *skb);
static inline int nf_bridge_maybe_copy_header(struct sk_buff *skb)
{
if (skb->nf_bridge)
if (skb->nf_bridge &&
skb->nf_bridge->mask & (BRNF_BRIDGED | BRNF_BRIDGED_DNAT))
return nf_bridge_copy_header(skb);
return 0;
}
Expand Down
2 changes: 2 additions & 0 deletions net/ax25/ax25_subr.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ void ax25_disconnect(ax25_cb *ax25, int reason)
ax25_link_failed(ax25, reason);

if (ax25->sk != NULL) {
local_bh_disable();
bh_lock_sock(ax25->sk);
ax25->sk->sk_state = TCP_CLOSE;
ax25->sk->sk_err = reason;
Expand All @@ -288,5 +289,6 @@ void ax25_disconnect(ax25_cb *ax25, int reason)
sock_set_flag(ax25->sk, SOCK_DEAD);
}
bh_unlock_sock(ax25->sk);
local_bh_enable();
}
}
3 changes: 1 addition & 2 deletions net/bridge/br_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ static struct ethtool_ops br_ethtool_ops = {

void br_dev_setup(struct net_device *dev)
{
memset(dev->dev_addr, 0, ETH_ALEN);

random_ether_addr(dev->dev_addr);
ether_setup(dev);

dev->do_ioctl = br_dev_ioctl;
Expand Down
20 changes: 1 addition & 19 deletions net/ipv4/ipconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -1396,25 +1396,7 @@ late_initcall(ip_auto_config);

/*
* Decode any IP configuration options in the "ip=" or "nfsaddrs=" kernel
* command line parameter. It consists of option fields separated by colons in
* the following order:
*
* <client-ip>:<server-ip>:<gw-ip>:<netmask>:<host name>:<device>:<PROTO>
*
* Any of the fields can be empty which means to use a default value:
* <client-ip> - address given by BOOTP or RARP
* <server-ip> - address of host returning BOOTP or RARP packet
* <gw-ip> - none, or the address returned by BOOTP
* <netmask> - automatically determined from <client-ip>, or the
* one returned by BOOTP
* <host name> - <client-ip> in ASCII notation, or the name returned
* by BOOTP
* <device> - use all available devices
* <PROTO>:
* off|none - don't do autoconfig at all (DEFAULT)
* on|any - use any configured protocol
* dhcp|bootp|rarp - use only the specified protocol
* both - use both BOOTP and RARP (not DHCP)
* command line parameter. See Documentation/nfsroot.txt.
*/
static int __init ic_proto_name(char *name)
{
Expand Down
57 changes: 12 additions & 45 deletions net/ipv4/netfilter/ip_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -1492,8 +1492,10 @@ static inline int compat_copy_match_to_user(struct ipt_entry_match *m,
return xt_compat_match_to_user(m, dstptr, size);
}

static int compat_copy_entry_to_user(struct ipt_entry *e,
void __user **dstptr, compat_uint_t *size)
static int
compat_copy_entry_to_user(struct ipt_entry *e, void __user **dstptr,
compat_uint_t *size, struct xt_counters *counters,
unsigned int *i)
{
struct ipt_entry_target *t;
struct compat_ipt_entry __user *ce;
Expand All @@ -1507,6 +1509,9 @@ static int compat_copy_entry_to_user(struct ipt_entry *e,
if (copy_to_user(ce, e, sizeof(struct ipt_entry)))
goto out;

if (copy_to_user(&ce->counters, &counters[*i], sizeof(counters[*i])))
goto out;

*dstptr += sizeof(struct compat_ipt_entry);
ret = IPT_MATCH_ITERATE(e, compat_copy_match_to_user, dstptr, size);
target_offset = e->target_offset - (origsize - *size);
Expand All @@ -1522,6 +1527,8 @@ static int compat_copy_entry_to_user(struct ipt_entry *e,
goto out;
if (put_user(next_offset, &ce->next_offset))
goto out;

(*i)++;
return 0;
out:
return ret;
Expand Down Expand Up @@ -1937,14 +1944,13 @@ struct compat_ipt_get_entries
static int compat_copy_entries_to_user(unsigned int total_size,
struct xt_table *table, void __user *userptr)
{
unsigned int off, num;
struct compat_ipt_entry e;
struct xt_counters *counters;
struct xt_table_info *private = table->private;
void __user *pos;
unsigned int size;
int ret = 0;
void *loc_cpu_entry;
unsigned int i = 0;

counters = alloc_counters(table);
if (IS_ERR(counters))
Expand All @@ -1958,48 +1964,9 @@ static int compat_copy_entries_to_user(unsigned int total_size,
pos = userptr;
size = total_size;
ret = IPT_ENTRY_ITERATE(loc_cpu_entry, total_size,
compat_copy_entry_to_user, &pos, &size);
if (ret)
goto free_counters;

/* ... then go back and fix counters and names */
for (off = 0, num = 0; off < size; off += e.next_offset, num++) {
unsigned int i;
struct ipt_entry_match m;
struct ipt_entry_target t;
compat_copy_entry_to_user,
&pos, &size, counters, &i);

ret = -EFAULT;
if (copy_from_user(&e, userptr + off,
sizeof(struct compat_ipt_entry)))
goto free_counters;
if (copy_to_user(userptr + off +
offsetof(struct compat_ipt_entry, counters),
&counters[num], sizeof(counters[num])))
goto free_counters;

for (i = sizeof(struct compat_ipt_entry);
i < e.target_offset; i += m.u.match_size) {
if (copy_from_user(&m, userptr + off + i,
sizeof(struct ipt_entry_match)))
goto free_counters;
if (copy_to_user(userptr + off + i +
offsetof(struct ipt_entry_match, u.user.name),
m.u.kernel.match->name,
strlen(m.u.kernel.match->name) + 1))
goto free_counters;
}

if (copy_from_user(&t, userptr + off + e.target_offset,
sizeof(struct ipt_entry_target)))
goto free_counters;
if (copy_to_user(userptr + off + e.target_offset +
offsetof(struct ipt_entry_target, u.user.name),
t.u.kernel.target->name,
strlen(t.u.kernel.target->name) + 1))
goto free_counters;
}
ret = 0;
free_counters:
vfree(counters);
return ret;
}
Expand Down
Loading

0 comments on commit aa62a86

Please sign in to comment.