Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 97955
b: refs/heads/master
c: 513fd37
h: refs/heads/master
i:
  97953: bd4b3b9
  97951: 1b173ae
v: v3
  • Loading branch information
David S. Miller committed Jun 10, 2008
1 parent e3aae8e commit cfc749e
Show file tree
Hide file tree
Showing 19 changed files with 67 additions and 62 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: 68c2889834602f6efed195f44439ef5d526683a8
refs/heads/master: 513fd370e6832f81ab717df4645f5ce679e44f14
1 change: 0 additions & 1 deletion trunk/drivers/atm/eni.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "midway.h"


#define KERNEL_OFFSET 0xC0000000 /* kernel 0x0 is at phys 0xC0000000 */
#define DEV_LABEL "eni"

#define UBR_BUFFER (128*1024) /* UBR buffer size */
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/isdn/hardware/eicon/divasmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,6 @@ static int DIVA_INIT_FUNCTION divas_init(void)

if (!create_divas_proc()) {
#ifdef MODULE
remove_divas_proc();
divas_unregister_chrdev();
divasfunc_exit();
#endif
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/isdn/hardware/eicon/divasproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ static const struct file_operations divas_fops = {

int create_divas_proc(void)
{
proc_create(divas_proc_name, S_IFREG | S_IRUGO, proc_net_eicon,
&divas_fops);
divas_proc_entry = proc_create(divas_proc_name, S_IFREG | S_IRUGO,
proc_net_eicon, &divas_fops);
if (!divas_proc_entry)
return (0);

Expand Down
29 changes: 8 additions & 21 deletions trunk/drivers/isdn/hysdn/hysdn_procconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,30 +207,17 @@ hysdn_conf_write(struct file *file, const char __user *buf, size_t count, loff_t
/* read conf file -> output card info data */
/*******************************************/
static ssize_t
hysdn_conf_read(struct file *file, char __user *buf, size_t count, loff_t * off)
hysdn_conf_read(struct file *file, char __user *buf, size_t count, loff_t *off)
{
char *cp;
int i;

if (file->f_mode & FMODE_READ) {
if (!(cp = file->private_data))
return (-EFAULT); /* should never happen */
i = strlen(cp); /* get total string length */
if (*off < i) {
/* still bytes to transfer */
cp += *off; /* point to desired data offset */
i -= *off; /* remaining length */
if (i > count)
i = count; /* limit length to transfer */
if (copy_to_user(buf, cp, i))
return (-EFAULT); /* copy error */
*off += i; /* adjust offset */
} else
return (0);
} else
return (-EPERM); /* no permission to read */

return (i);
if (!(file->f_mode & FMODE_READ))
return -EPERM; /* no permission to read */

if (!(cp = file->private_data))
return -EFAULT; /* should never happen */

return simple_read_from_buffer(buf, count, off, cp, strlen(cp));
} /* hysdn_conf_read */

/******************/
Expand Down
37 changes: 20 additions & 17 deletions trunk/drivers/net/pppoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,6 @@ static int pppoe_rcv_core(struct sock *sk, struct sk_buff *skb)
struct pppox_sock *relay_po;

if (sk->sk_state & PPPOX_BOUND) {
struct pppoe_hdr *ph = pppoe_hdr(skb);
int len = ntohs(ph->length);
skb_pull_rcsum(skb, sizeof(struct pppoe_hdr));
if (pskb_trim_rcsum(skb, len))
goto abort_kfree;

ppp_input(&po->chan, skb);
} else if (sk->sk_state & PPPOX_RELAY) {
relay_po = get_item_by_addr(&po->pppoe_relay);
Expand All @@ -357,7 +351,6 @@ static int pppoe_rcv_core(struct sock *sk, struct sk_buff *skb)
if ((sk_pppox(relay_po)->sk_state & PPPOX_CONNECTED) == 0)
goto abort_put;

skb_pull(skb, sizeof(struct pppoe_hdr));
if (!__pppoe_xmit(sk_pppox(relay_po), skb))
goto abort_put;
} else {
Expand Down Expand Up @@ -388,6 +381,7 @@ static int pppoe_rcv(struct sk_buff *skb,
{
struct pppoe_hdr *ph;
struct pppox_sock *po;
int len;

if (!(skb = skb_share_check(skb, GFP_ATOMIC)))
goto out;
Expand All @@ -399,10 +393,21 @@ static int pppoe_rcv(struct sk_buff *skb,
goto drop;

ph = pppoe_hdr(skb);
len = ntohs(ph->length);

skb_pull_rcsum(skb, sizeof(*ph));
if (skb->len < len)
goto drop;

po = get_item(ph->sid, eth_hdr(skb)->h_source, dev->ifindex);
if (po != NULL)
return sk_receive_skb(sk_pppox(po), skb, 0);
if (!po)
goto drop;

if (pskb_trim_rcsum(skb, len))
goto drop;

return sk_receive_skb(sk_pppox(po), skb, 0);

drop:
kfree_skb(skb);
out:
Expand All @@ -427,12 +432,12 @@ static int pppoe_disc_rcv(struct sk_buff *skb,
if (dev_net(dev) != &init_net)
goto abort;

if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr)))
goto abort;

if (!(skb = skb_share_check(skb, GFP_ATOMIC)))
goto out;

if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr)))
goto abort;

ph = pppoe_hdr(skb);
if (ph->code != PADT_CODE)
goto abort;
Expand Down Expand Up @@ -937,12 +942,10 @@ static int pppoe_recvmsg(struct kiocb *iocb, struct socket *sock,
m->msg_namelen = 0;

if (skb) {
struct pppoe_hdr *ph = pppoe_hdr(skb);
const int len = ntohs(ph->length);

error = memcpy_toiovec(m->msg_iov, (unsigned char *) &ph->tag[0], len);
total_len = min(total_len, skb->len);
error = skb_copy_datagram_iovec(skb, 0, m->msg_iov, total_len);
if (error == 0)
error = len;
error = total_len;
}

kfree_skb(skb);
Expand Down
20 changes: 12 additions & 8 deletions trunk/drivers/net/pppol2tp.c
Original file line number Diff line number Diff line change
Expand Up @@ -783,14 +783,18 @@ static int pppol2tp_recvmsg(struct kiocb *iocb, struct socket *sock,
err = 0;
skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT,
flags & MSG_DONTWAIT, &err);
if (skb) {
err = memcpy_toiovec(msg->msg_iov, (unsigned char *) skb->data,
skb->len);
if (err < 0)
goto do_skb_free;
err = skb->len;
}
do_skb_free:
if (!skb)
goto end;

if (len > skb->len)
len = skb->len;
else if (len < skb->len)
msg->msg_flags |= MSG_TRUNC;

err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, len);
if (likely(err == 0))
err = len;

kfree_skb(skb);
end:
return err;
Expand Down
4 changes: 3 additions & 1 deletion trunk/include/linux/ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,10 @@ static inline struct request_sock *inet6_reqsk_alloc(struct request_sock_ops *op
{
struct request_sock *req = reqsk_alloc(ops);

if (req != NULL)
if (req != NULL) {
inet_rsk(req)->inet6_rsk_offset = inet6_rsk_offset(req);
inet6_rsk(req)->pktopts = NULL;
}

return req;
}
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/rtnetlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ enum rt_class_t
{
RT_TABLE_UNSPEC=0,
/* User defined values */
RT_TABLE_COMPAT=252,
RT_TABLE_DEFAULT=253,
RT_TABLE_MAIN=254,
RT_TABLE_LOCAL=255,
Expand Down
10 changes: 10 additions & 0 deletions trunk/include/net/inet_sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,4 +197,14 @@ static inline int inet_iif(const struct sk_buff *skb)
return skb->rtable->rt_iif;
}

static inline struct request_sock *inet_reqsk_alloc(struct request_sock_ops *ops)
{
struct request_sock *req = reqsk_alloc(ops);

if (req != NULL)
inet_rsk(req)->opt = NULL;

return req;
}

#endif /* _INET_SOCK_H */
1 change: 0 additions & 1 deletion trunk/include/net/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,6 @@ extern struct sk_buff * tcp_make_synack(struct sock *sk,

extern int tcp_disconnect(struct sock *sk, int flags);

extern void tcp_unhash(struct sock *sk);

/* From syncookies.c */
extern __u32 syncookie_secret[2][16-4+SHA_DIGEST_WORDS];
Expand Down
3 changes: 1 addition & 2 deletions trunk/net/dccp/ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1)
goto drop;

req = reqsk_alloc(&dccp_request_sock_ops);
req = inet_reqsk_alloc(&dccp_request_sock_ops);
if (req == NULL)
goto drop;

Expand All @@ -605,7 +605,6 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
ireq = inet_rsk(req);
ireq->loc_addr = ip_hdr(skb)->daddr;
ireq->rmt_addr = ip_hdr(skb)->saddr;
ireq->opt = NULL;

/*
* Step 3: Process LISTEN state
Expand Down
1 change: 0 additions & 1 deletion trunk/net/dccp/ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,6 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
ireq6 = inet6_rsk(req);
ipv6_addr_copy(&ireq6->rmt_addr, &ipv6_hdr(skb)->saddr);
ipv6_addr_copy(&ireq6->loc_addr, &ipv6_hdr(skb)->daddr);
ireq6->pktopts = NULL;

if (ipv6_opt_accepted(sk, skb) ||
np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo ||
Expand Down
5 changes: 4 additions & 1 deletion trunk/net/ipv4/fib_semantics.c
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,10 @@ int fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
rtm->rtm_dst_len = dst_len;
rtm->rtm_src_len = 0;
rtm->rtm_tos = tos;
rtm->rtm_table = tb_id;
if (tb_id < 256)
rtm->rtm_table = tb_id;
else
rtm->rtm_table = RT_TABLE_COMPAT;
NLA_PUT_U32(skb, RTA_TABLE, tb_id);
rtm->rtm_type = type;
rtm->rtm_flags = fi->fib_flags;
Expand Down
3 changes: 1 addition & 2 deletions trunk/net/ipv4/syncookies.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
cookie_check_timestamp(&tcp_opt);

ret = NULL;
req = reqsk_alloc(&tcp_request_sock_ops); /* for safety */
req = inet_reqsk_alloc(&tcp_request_sock_ops); /* for safety */
if (!req)
goto out;

Expand All @@ -301,7 +301,6 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
ireq->rmt_port = th->source;
ireq->loc_addr = ip_hdr(skb)->daddr;
ireq->rmt_addr = ip_hdr(skb)->saddr;
ireq->opt = NULL;
ireq->snd_wscale = tcp_opt.snd_wscale;
ireq->rcv_wscale = tcp_opt.rcv_wscale;
ireq->sack_ok = tcp_opt.sack_ok;
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 @@ -1285,7 +1285,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1)
goto drop;

req = reqsk_alloc(&tcp_request_sock_ops);
req = inet_reqsk_alloc(&tcp_request_sock_ops);
if (!req)
goto drop;

Expand Down
1 change: 0 additions & 1 deletion trunk/net/ipv6/syncookies.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)
ireq = inet_rsk(req);
ireq6 = inet6_rsk(req);
treq = tcp_rsk(req);
ireq6->pktopts = NULL;

if (security_inet_conn_request(sk, skb, req)) {
reqsk_free(req);
Expand Down
1 change: 0 additions & 1 deletion trunk/net/ipv6/tcp_ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,6 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
treq = inet6_rsk(req);
ipv6_addr_copy(&treq->rmt_addr, &ipv6_hdr(skb)->saddr);
ipv6_addr_copy(&treq->loc_addr, &ipv6_hdr(skb)->daddr);
treq->pktopts = NULL;
if (!want_cookie)
TCP_ECN_create_request(req, tcp_hdr(skb));

Expand Down
3 changes: 3 additions & 0 deletions trunk/net/key/af_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -3030,6 +3030,9 @@ static int key_notify_sa_expire(struct xfrm_state *x, struct km_event *c)

static int pfkey_send_notify(struct xfrm_state *x, struct km_event *c)
{
if (atomic_read(&pfkey_socks_nr) == 0)
return 0;

switch (c->event) {
case XFRM_MSG_EXPIRE:
return key_notify_sa_expire(x, c);
Expand Down

0 comments on commit cfc749e

Please sign in to comment.