Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 110231
b: refs/heads/master
c: 36010ff
h: refs/heads/master
i:
  110229: 8f67597
  110227: af8f4fb
  110223: 3a78bf0
v: v3
  • Loading branch information
Marcel Holtmann committed Oct 6, 2008
1 parent ac10c3a commit bf78cb4
Show file tree
Hide file tree
Showing 17 changed files with 54 additions and 124 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 53240c208776d557dba9d7afedbcdbf512774c16
refs/heads/master: 36010ff6788a058147ae15a1aebf97fd30fa51a9
2 changes: 0 additions & 2 deletions trunk/drivers/bluetooth/bpa10x.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ static inline int bpa10x_submit_intr_urb(struct hci_dev *hdev)
BT_ERR("%s urb %p submission failed (%d)",
hdev->name, urb, -err);
usb_unanchor_urb(urb);
kfree(buf);
}

usb_free_urb(urb);
Expand Down Expand Up @@ -298,7 +297,6 @@ static inline int bpa10x_submit_bulk_urb(struct hci_dev *hdev)
BT_ERR("%s urb %p submission failed (%d)",
hdev->name, urb, -err);
usb_unanchor_urb(urb);
kfree(buf);
}

usb_free_urb(urb);
Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/bluetooth/btusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ static int btusb_submit_intr_urb(struct hci_dev *hdev)
BT_ERR("%s urb %p submission failed (%d)",
hdev->name, urb, -err);
usb_unanchor_urb(urb);
kfree(buf);
}

usb_free_urb(urb);
Expand Down Expand Up @@ -354,7 +353,6 @@ static int btusb_submit_bulk_urb(struct hci_dev *hdev)
BT_ERR("%s urb %p submission failed (%d)",
hdev->name, urb, -err);
usb_unanchor_urb(urb);
kfree(buf);
}

usb_free_urb(urb);
Expand Down Expand Up @@ -475,7 +473,6 @@ static int btusb_submit_isoc_urb(struct hci_dev *hdev)
BT_ERR("%s urb %p submission failed (%d)",
hdev->name, urb, -err);
usb_unanchor_urb(urb);
kfree(buf);
}

usb_free_urb(urb);
Expand Down
3 changes: 0 additions & 3 deletions trunk/include/net/sctp/sm.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,6 @@ struct sctp_chunk *sctp_make_abort_violation(const struct sctp_association *,
const struct sctp_chunk *,
const __u8 *,
const size_t );
struct sctp_chunk *sctp_make_violation_paramlen(const struct sctp_association *,
const struct sctp_chunk *,
struct sctp_paramhdr *);
struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *,
const struct sctp_transport *,
const void *payload,
Expand Down
3 changes: 0 additions & 3 deletions trunk/net/ax25/af_ax25.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,6 @@ void ax25_destroy_socket(ax25_cb *ax25)
/* Queue the unaccepted socket for death */
sock_orphan(skb->sk);

/* 9A4GL: hack to release unaccepted sockets */
skb->sk->sk_state = TCP_LISTEN;

ax25_start_heartbeat(sax25);
sax25->state = AX25_STATE_0;
}
Expand Down
8 changes: 3 additions & 5 deletions trunk/net/ax25/ax25_std_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@ void ax25_std_heartbeat_expiry(ax25_cb *ax25)

switch (ax25->state) {
case AX25_STATE_0:
/* Magic here: If we listen() and a new link dies before it
is accepted() it isn't 'dead' so doesn't get removed. */
if (!sk || sock_flag(sk, SOCK_DESTROY) ||
(sk->sk_state == TCP_LISTEN &&
sock_flag(sk, SOCK_DEAD))) {
if (!sk ||
sock_flag(sk, SOCK_DESTROY) ||
sock_flag(sk, SOCK_DEAD)) {
if (sk) {
sock_hold(sk);
ax25_destroy_socket(ax25);
Expand Down
16 changes: 6 additions & 10 deletions trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2918,12 +2918,6 @@ int netdev_set_master(struct net_device *slave, struct net_device *master)
return 0;
}

static void dev_change_rx_flags(struct net_device *dev, int flags)
{
if (dev->flags & IFF_UP && dev->change_rx_flags)
dev->change_rx_flags(dev, flags);
}

static int __dev_set_promiscuity(struct net_device *dev, int inc)
{
unsigned short old_flags = dev->flags;
Expand Down Expand Up @@ -2961,7 +2955,8 @@ static int __dev_set_promiscuity(struct net_device *dev, int inc)
current->uid, current->gid,
audit_get_sessionid(current));

dev_change_rx_flags(dev, IFF_PROMISC);
if (dev->change_rx_flags)
dev->change_rx_flags(dev, IFF_PROMISC);
}
return 0;
}
Expand Down Expand Up @@ -3027,7 +3022,8 @@ int dev_set_allmulti(struct net_device *dev, int inc)
}
}
if (dev->flags ^ old_flags) {
dev_change_rx_flags(dev, IFF_ALLMULTI);
if (dev->change_rx_flags)
dev->change_rx_flags(dev, IFF_ALLMULTI);
dev_set_rx_mode(dev);
}
return 0;
Expand Down Expand Up @@ -3351,8 +3347,8 @@ int dev_change_flags(struct net_device *dev, unsigned flags)
* Load in the correct multicast list now the flags have changed.
*/

if ((old_flags ^ flags) & IFF_MULTICAST)
dev_change_rx_flags(dev, IFF_MULTICAST);
if (dev->change_rx_flags && (old_flags ^ flags) & IFF_MULTICAST)
dev->change_rx_flags(dev, IFF_MULTICAST);

dev_set_rx_mode(dev);

Expand Down
3 changes: 1 addition & 2 deletions trunk/net/ipv4/tcp_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -4879,8 +4879,7 @@ int tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
goto no_ack;
}

if (!copied_early || tp->rcv_nxt != tp->rcv_wup)
__tcp_ack_snd_check(sk, 0);
__tcp_ack_snd_check(sk, 0);
no_ack:
#ifdef CONFIG_NET_DMA
if (copied_early)
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/tcp_ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ static void tcp_v4_send_ack(struct sk_buff *skb, u32 seq, u32 ack,
];
} rep;
struct ip_reply_arg arg;
struct net *net = dev_net(skb->dst->dev);
struct net *net = dev_net(skb->dev);

memset(&rep.th, 0, sizeof(struct tcphdr));
memset(&arg, 0, sizeof(arg));
Expand Down
2 changes: 0 additions & 2 deletions trunk/net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -2688,8 +2688,6 @@ int __init ip6_route_init(void)
if (ret)
goto out_kmem_cache;

ip6_dst_blackhole_ops.kmem_cachep = ip6_dst_ops_template.kmem_cachep;

/* Registering of the loopback is done before this portion of code,
* the loopback reference in rt6_info will not be taken, do it
* manually for init_net */
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv6/tcp_ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,7 @@ static void tcp_v6_send_ack(struct sk_buff *skb, u32 seq, u32 ack, u32 win, u32
struct tcphdr *th = tcp_hdr(skb), *t1;
struct sk_buff *buff;
struct flowi fl;
struct net *net = dev_net(skb->dst->dev);
struct net *net = dev_net(skb->dev);
struct sock *ctl_sk = net->ipv6.tcp_sk;
unsigned int tot_len = sizeof(struct tcphdr);
__be32 *topt;
Expand Down
3 changes: 1 addition & 2 deletions trunk/net/iucv/iucv.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ static int iucv_enable(void)
get_online_cpus();
for_each_online_cpu(cpu)
smp_call_function_single(cpu, iucv_declare_cpu, NULL, 1);
preempt_enable();
if (cpus_empty(iucv_buffer_cpumask))
/* No cpu could declare an iucv buffer. */
goto out_path;
Expand All @@ -546,9 +547,7 @@ static int iucv_enable(void)
*/
static void iucv_disable(void)
{
get_online_cpus();
on_each_cpu(iucv_retrieve_cpu, NULL, 1);
put_online_cpus();
kfree(iucv_path_table);
}

Expand Down
30 changes: 11 additions & 19 deletions trunk/net/key/af_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,22 @@ static int pfkey_can_dump(struct sock *sk)
return 0;
}

static void pfkey_terminate_dump(struct pfkey_sock *pfk)
static int pfkey_do_dump(struct pfkey_sock *pfk)
{
if (pfk->dump.dump) {
pfk->dump.done(pfk);
pfk->dump.dump = NULL;
pfk->dump.done = NULL;
}
int rc;

rc = pfk->dump.dump(pfk);
if (rc == -ENOBUFS)
return 0;

pfk->dump.done(pfk);
pfk->dump.dump = NULL;
pfk->dump.done = NULL;
return rc;
}

static void pfkey_sock_destruct(struct sock *sk)
{
pfkey_terminate_dump(pfkey_sk(sk));
skb_queue_purge(&sk->sk_receive_queue);

if (!sock_flag(sk, SOCK_DEAD)) {
Expand Down Expand Up @@ -306,18 +310,6 @@ static int pfkey_broadcast(struct sk_buff *skb, gfp_t allocation,
return err;
}

static int pfkey_do_dump(struct pfkey_sock *pfk)
{
int rc;

rc = pfk->dump.dump(pfk);
if (rc == -ENOBUFS)
return 0;

pfkey_terminate_dump(pfk);
return rc;
}

static inline void pfkey_hdr_dup(struct sadb_msg *new, struct sadb_msg *orig)
{
*new = *orig;
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/netrom/af_netrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,6 @@ static int nr_release(struct socket *sock)
if (sk == NULL) return 0;

sock_hold(sk);
sock_orphan(sk);
lock_sock(sk);
nr = nr_sk(sk);

Expand All @@ -549,6 +548,7 @@ static int nr_release(struct socket *sock)
sk->sk_state = TCP_CLOSE;
sk->sk_shutdown |= SEND_SHUTDOWN;
sk->sk_state_change(sk);
sock_orphan(sk);
sock_set_flag(sk, SOCK_DESTROY);
break;

Expand Down
37 changes: 13 additions & 24 deletions trunk/net/sctp/sm_make_chunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1012,29 +1012,6 @@ struct sctp_chunk *sctp_make_abort_violation(
return retval;
}

struct sctp_chunk *sctp_make_violation_paramlen(
const struct sctp_association *asoc,
const struct sctp_chunk *chunk,
struct sctp_paramhdr *param)
{
struct sctp_chunk *retval;
static const char error[] = "The following parameter had invalid length:";
size_t payload_len = sizeof(error) + sizeof(sctp_errhdr_t) +
sizeof(sctp_paramhdr_t);

retval = sctp_make_abort(asoc, chunk, payload_len);
if (!retval)
goto nodata;

sctp_init_cause(retval, SCTP_ERROR_PROTO_VIOLATION,
sizeof(error) + sizeof(sctp_paramhdr_t));
sctp_addto_chunk(retval, sizeof(error), error);
sctp_addto_param(retval, sizeof(sctp_paramhdr_t), param);

nodata:
return retval;
}

/* Make a HEARTBEAT chunk. */
struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *asoc,
const struct sctp_transport *transport,
Expand Down Expand Up @@ -1805,14 +1782,26 @@ static int sctp_process_inv_paramlength(const struct sctp_association *asoc,
const struct sctp_chunk *chunk,
struct sctp_chunk **errp)
{
static const char error[] = "The following parameter had invalid length:";
size_t payload_len = WORD_ROUND(sizeof(error)) +
sizeof(sctp_paramhdr_t);


/* This is a fatal error. Any accumulated non-fatal errors are
* not reported.
*/
if (*errp)
sctp_chunk_free(*errp);

/* Create an error chunk and fill it in with our payload. */
*errp = sctp_make_violation_paramlen(asoc, chunk, param);
*errp = sctp_make_op_error_space(asoc, chunk, payload_len);

if (*errp) {
sctp_init_cause(*errp, SCTP_ERROR_PROTO_VIOLATION,
sizeof(error) + sizeof(sctp_paramhdr_t));
sctp_addto_chunk(*errp, sizeof(error), error);
sctp_addto_param(*errp, sizeof(sctp_paramhdr_t), param);
}

return 0;
}
Expand Down
48 changes: 11 additions & 37 deletions trunk/net/sctp/sm_statefuns.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static sctp_disposition_t sctp_sf_violation_paramlen(
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg, void *ext,
void *arg,
sctp_cmd_seq_t *commands);

static sctp_disposition_t sctp_sf_violation_ctsn(
Expand Down Expand Up @@ -3425,16 +3425,16 @@ sctp_disposition_t sctp_sf_do_asconf(const struct sctp_endpoint *ep,
addr_param = (union sctp_addr_param *)hdr->params;
length = ntohs(addr_param->p.length);
if (length < sizeof(sctp_paramhdr_t))
return sctp_sf_violation_paramlen(ep, asoc, type, arg,
return sctp_sf_violation_paramlen(ep, asoc, type,
(void *)addr_param, commands);

/* Verify the ASCONF chunk before processing it. */
if (!sctp_verify_asconf(asoc,
(sctp_paramhdr_t *)((void *)addr_param + length),
(void *)chunk->chunk_end,
&err_param))
return sctp_sf_violation_paramlen(ep, asoc, type, arg,
(void *)err_param, commands);
return sctp_sf_violation_paramlen(ep, asoc, type,
(void *)&err_param, commands);

/* ADDIP 5.2 E1) Compare the value of the serial number to the value
* the endpoint stored in a new association variable
Expand Down Expand Up @@ -3542,8 +3542,8 @@ sctp_disposition_t sctp_sf_do_asconf_ack(const struct sctp_endpoint *ep,
(sctp_paramhdr_t *)addip_hdr->params,
(void *)asconf_ack->chunk_end,
&err_param))
return sctp_sf_violation_paramlen(ep, asoc, type, arg,
(void *)err_param, commands);
return sctp_sf_violation_paramlen(ep, asoc, type,
(void *)&err_param, commands);

if (last_asconf) {
addip_hdr = (sctp_addiphdr_t *)last_asconf->subh.addip_hdr;
Expand Down Expand Up @@ -4240,38 +4240,12 @@ static sctp_disposition_t sctp_sf_violation_paramlen(
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg, void *ext,
sctp_cmd_seq_t *commands)
{
struct sctp_chunk *chunk = arg;
struct sctp_paramhdr *param = ext;
struct sctp_chunk *abort = NULL;

if (sctp_auth_recv_cid(SCTP_CID_ABORT, asoc))
goto discard;

/* Make the abort chunk. */
abort = sctp_make_violation_paramlen(asoc, chunk, param);
if (!abort)
goto nomem;

sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(abort));
SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);

sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
SCTP_ERROR(ECONNABORTED));
sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
SCTP_PERR(SCTP_ERROR_PROTO_VIOLATION));
SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);

discard:
sctp_sf_pdiscard(ep, asoc, SCTP_ST_CHUNK(0), arg, commands);

SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
void *arg,
sctp_cmd_seq_t *commands) {
static const char err_str[] = "The following parameter had invalid length:";

return SCTP_DISPOSITION_ABORT;
nomem:
return SCTP_DISPOSITION_NOMEM;
return sctp_sf_abort_violation(ep, asoc, arg, commands, err_str,
sizeof(err_str));
}

/* Handle a protocol violation when the peer trying to advance the
Expand Down
Loading

0 comments on commit bf78cb4

Please sign in to comment.