Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 89981
b: refs/heads/master
c: 4a80f27
h: refs/heads/master
i:
  89979: 5c9352f
v: v3
  • Loading branch information
David S. Miller committed Feb 29, 2008
1 parent 099c748 commit 09f3811
Show file tree
Hide file tree
Showing 45 changed files with 489 additions and 386 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: e4861829072c61883114c64a3af61f305a789ff0
refs/heads/master: 4a80f2788952055a627f2093a0174537d70aec1b
2 changes: 1 addition & 1 deletion trunk/include/linux/icmpv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ extern void icmpv6_send(struct sk_buff *skb,
__u32 info,
struct net_device *dev);

extern int icmpv6_init(struct net_proto_family *ops);
extern int icmpv6_init(void);
extern int icmpv6_err_convert(int type, int code,
int *err);
extern void icmpv6_cleanup(void);
Expand Down
3 changes: 2 additions & 1 deletion trunk/include/linux/xfrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ enum
{
XFRM_POLICY_TYPE_MAIN = 0,
XFRM_POLICY_TYPE_SUB = 1,
XFRM_POLICY_TYPE_MAX = 2
XFRM_POLICY_TYPE_MAX = 2,
XFRM_POLICY_TYPE_ANY = 255
};

enum
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/net/icmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct sk_buff;
extern void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info);
extern int icmp_rcv(struct sk_buff *skb);
extern int icmp_ioctl(struct sock *sk, int cmd, unsigned long arg);
extern void icmp_init(struct net_proto_family *ops);
extern int icmp_init(void);
extern void icmp_out_count(unsigned char type);

/* Move into dst.h ? */
Expand Down
5 changes: 0 additions & 5 deletions trunk/include/net/llc_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,6 @@ static inline int llc_mac_null(const u8 *mac)
return is_zero_ether_addr(mac);
}

static inline int llc_addrany(const struct llc_addr *addr)
{
return llc_mac_null(addr->mac) && !addr->lsap;
}

static inline int llc_mac_multicast(const u8 *mac)
{
return is_multicast_ether_addr(mac);
Expand Down
4 changes: 2 additions & 2 deletions trunk/include/net/ndisc.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ struct nd_opt_hdr {
} __attribute__((__packed__));


extern int ndisc_init(struct net_proto_family *ops);
extern int ndisc_init(void);

extern void ndisc_cleanup(void);

Expand Down Expand Up @@ -107,7 +107,7 @@ extern int ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *d
/*
* IGMP
*/
extern int igmp6_init(struct net_proto_family *ops);
extern int igmp6_init(void);

extern void igmp6_cleanup(void);

Expand Down
2 changes: 2 additions & 0 deletions trunk/include/net/netns/ipv4.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ struct netns_ipv4 {
struct hlist_head *fib_table_hash;
struct sock *fibnl;

struct sock **icmp_sk;

struct netns_frags frags;
#ifdef CONFIG_NETFILTER
struct xt_table *iptable_filter;
Expand Down
1 change: 1 addition & 0 deletions trunk/include/net/netns/ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ struct netns_ipv6 {
struct xt_table *ip6table_mangle;
struct xt_table *ip6table_raw;
#endif
struct sock **icmp_sk;
};
#endif
3 changes: 1 addition & 2 deletions trunk/include/net/request_sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ struct request_sock_ops {
int obj_size;
struct kmem_cache *slab;
int (*rtx_syn_ack)(struct sock *sk,
struct request_sock *req,
struct dst_entry *dst);
struct request_sock *req);
void (*send_ack)(struct sk_buff *skb,
struct request_sock *req);
void (*send_reset)(struct sock *sk,
Expand Down
5 changes: 0 additions & 5 deletions trunk/include/net/sctp/sctp.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,6 @@ void sctp_sysctl_unregister(void);
#else
static inline void sctp_sysctl_register(void) { return; }
static inline void sctp_sysctl_unregister(void) { return; }
static inline int sctp_sysctl_jiffies_ms(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen) {
return -ENOSYS;
}
#endif

/* Size of Supported Address Parameter for 'x' address types. */
Expand Down
8 changes: 8 additions & 0 deletions trunk/include/net/sctp/structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1661,6 +1661,9 @@ struct sctp_association {
/* Transport to which SHUTDOWN chunk was last sent. */
struct sctp_transport *shutdown_last_sent_to;

/* How many times have we resent a SHUTDOWN */
int shutdown_retries;

/* Transport to which INIT chunk was last sent. */
struct sctp_transport *init_last_sent_to;

Expand Down Expand Up @@ -1695,6 +1698,11 @@ struct sctp_association {
*/
__u16 unack_data;

/* The total number of data chunks that we've had to retransmit
* as the result of a T3 timer expiration
*/
__u32 rtx_data_chunks;

/* This is the association's receive buffer space. This value is used
* to set a_rwnd field in an INIT or a SACK chunk.
*/
Expand Down
13 changes: 13 additions & 0 deletions trunk/include/net/sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,7 @@ extern struct sock *sk_alloc(struct net *net, int family,
gfp_t priority,
struct proto *prot);
extern void sk_free(struct sock *sk);
extern void sk_release_kernel(struct sock *sk);
extern struct sock *sk_clone(const struct sock *sk,
const gfp_t priority);

Expand Down Expand Up @@ -1333,6 +1334,18 @@ static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb, int copied_e
}
#endif

/*
* Kernel sockets, f.e. rtnl or icmp_socket, are a part of a namespace.
* They should not hold a referrence to a namespace in order to allow
* to stop it.
* Sockets after sk_change_net should be released using sk_release_kernel
*/
static inline void sk_change_net(struct sock *sk, struct net *net)
{
put_net(sk->sk_net);
sk->sk_net = net;
}

extern void sock_enable_timestamp(struct sock *sk);
extern int sock_get_timestamp(struct sock *, struct timeval __user *);
extern int sock_get_timestampns(struct sock *, struct timespec __user *);
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/net/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -1373,7 +1373,7 @@ struct tcp_request_sock_ops {
#endif
};

extern void tcp_v4_init(struct net_proto_family *ops);
extern void tcp_v4_init(void);
extern void tcp_init(void);

#endif /* _TCP_H */
52 changes: 50 additions & 2 deletions trunk/include/net/xfrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ extern struct mutex xfrm_cfg_mutex;
struct xfrm_state
{
/* Note: bydst is re-used during gc */
struct list_head all;
struct hlist_node bydst;
struct hlist_node bysrc;
struct hlist_node byspi;
Expand Down Expand Up @@ -424,6 +425,7 @@ struct xfrm_tmpl
struct xfrm_policy
{
struct xfrm_policy *next;
struct list_head bytype;
struct hlist_node bydst;
struct hlist_node byidx;

Expand Down Expand Up @@ -1160,6 +1162,18 @@ struct xfrm6_tunnel {
int priority;
};

struct xfrm_state_walk {
struct xfrm_state *state;
int count;
u8 proto;
};

struct xfrm_policy_walk {
struct xfrm_policy *policy;
int count;
u8 type, cur_type;
};

extern void xfrm_init(void);
extern void xfrm4_init(void);
extern void xfrm_state_init(void);
Expand All @@ -1184,7 +1198,23 @@ static inline void xfrm6_fini(void)
extern int xfrm_proc_init(void);
#endif

extern int xfrm_state_walk(u8 proto, int (*func)(struct xfrm_state *, int, void*), void *);
static inline void xfrm_state_walk_init(struct xfrm_state_walk *walk, u8 proto)
{
walk->proto = proto;
walk->state = NULL;
walk->count = 0;
}

static inline void xfrm_state_walk_done(struct xfrm_state_walk *walk)
{
if (walk->state != NULL) {
xfrm_state_put(walk->state);
walk->state = NULL;
}
}

extern int xfrm_state_walk(struct xfrm_state_walk *walk,
int (*func)(struct xfrm_state *, int, void*), void *);
extern struct xfrm_state *xfrm_state_alloc(void);
extern struct xfrm_state *xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr,
struct flowi *fl, struct xfrm_tmpl *tmpl,
Expand Down Expand Up @@ -1306,7 +1336,25 @@ static inline int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb)
#endif

struct xfrm_policy *xfrm_policy_alloc(gfp_t gfp);
extern int xfrm_policy_walk(u8 type, int (*func)(struct xfrm_policy *, int, int, void*), void *);

static inline void xfrm_policy_walk_init(struct xfrm_policy_walk *walk, u8 type)
{
walk->cur_type = XFRM_POLICY_TYPE_MAIN;
walk->type = type;
walk->policy = NULL;
walk->count = 0;
}

static inline void xfrm_policy_walk_done(struct xfrm_policy_walk *walk)
{
if (walk->policy != NULL) {
xfrm_pol_put(walk->policy);
walk->policy = NULL;
}
}

extern int xfrm_policy_walk(struct xfrm_policy_walk *walk,
int (*func)(struct xfrm_policy *, int, int, void*), void *);
int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl);
struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir,
struct xfrm_selector *sel,
Expand Down
21 changes: 2 additions & 19 deletions trunk/net/appletalk/aarp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1033,25 +1033,8 @@ static const struct seq_operations aarp_seq_ops = {

static int aarp_seq_open(struct inode *inode, struct file *file)
{
struct seq_file *seq;
int rc = -ENOMEM;
struct aarp_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL);

if (!s)
goto out;

rc = seq_open(file, &aarp_seq_ops);
if (rc)
goto out_kfree;

seq = file->private_data;
seq->private = s;
memset(s, 0, sizeof(*s));
out:
return rc;
out_kfree:
kfree(s);
goto out;
return seq_open_private(file, &aarp_seq_ops,
sizeof(struct aarp_iter_state));
}

const struct file_operations atalk_seq_arp_fops = {
Expand Down
29 changes: 2 additions & 27 deletions trunk/net/atm/lec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1169,40 +1169,15 @@ static const struct seq_operations lec_seq_ops = {

static int lec_seq_open(struct inode *inode, struct file *file)
{
struct lec_state *state;
struct seq_file *seq;
int rc = -EAGAIN;

state = kmalloc(sizeof(*state), GFP_KERNEL);
if (!state) {
rc = -ENOMEM;
goto out;
}

rc = seq_open(file, &lec_seq_ops);
if (rc)
goto out_kfree;
seq = file->private_data;
seq->private = state;
out:
return rc;

out_kfree:
kfree(state);
goto out;
}

static int lec_seq_release(struct inode *inode, struct file *file)
{
return seq_release_private(inode, file);
return seq_open_private(file, &lec_seq_ops, sizeof(struct lec_state));
}

static const struct file_operations lec_seq_fops = {
.owner = THIS_MODULE,
.open = lec_seq_open,
.read = seq_read,
.llseek = seq_lseek,
.release = lec_seq_release,
.release = seq_release_private,
};
#endif

Expand Down
32 changes: 7 additions & 25 deletions trunk/net/atm/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,31 +114,13 @@ static int __vcc_seq_open(struct inode *inode, struct file *file,
int family, const struct seq_operations *ops)
{
struct vcc_state *state;
struct seq_file *seq;
int rc = -ENOMEM;

state = kmalloc(sizeof(*state), GFP_KERNEL);
if (!state)
goto out;

rc = seq_open(file, ops);
if (rc)
goto out_kfree;
state = __seq_open_private(file, ops, sizeof(*state));
if (state == NULL)
return -ENOMEM;

state->family = family;

seq = file->private_data;
seq->private = state;
out:
return rc;
out_kfree:
kfree(state);
goto out;
}

static int vcc_seq_release(struct inode *inode, struct file *file)
{
return seq_release_private(inode, file);
return 0;
}

static void *vcc_seq_start(struct seq_file *seq, loff_t *pos)
Expand Down Expand Up @@ -314,7 +296,7 @@ static const struct file_operations pvc_seq_fops = {
.open = pvc_seq_open,
.read = seq_read,
.llseek = seq_lseek,
.release = vcc_seq_release,
.release = seq_release_private,
};

static int vcc_seq_show(struct seq_file *seq, void *v)
Expand Down Expand Up @@ -348,7 +330,7 @@ static const struct file_operations vcc_seq_fops = {
.open = vcc_seq_open,
.read = seq_read,
.llseek = seq_lseek,
.release = vcc_seq_release,
.release = seq_release_private,
};

static int svc_seq_show(struct seq_file *seq, void *v)
Expand Down Expand Up @@ -383,7 +365,7 @@ static const struct file_operations svc_seq_fops = {
.open = svc_seq_open,
.read = seq_read,
.llseek = seq_lseek,
.release = vcc_seq_release,
.release = seq_release_private,
};

static ssize_t proc_dev_atm_read(struct file *file, char __user *buf,
Expand Down
Loading

0 comments on commit 09f3811

Please sign in to comment.