diff --git a/[refs] b/[refs] index b05269a2a585..eff0a6392619 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: bc09dff198e67a98a82c42000006b39f6d502031 +refs/heads/master: be892471c42f70e47541e42b8dba7ff91cebd026 diff --git a/trunk/fs/proc/proc_net.c b/trunk/fs/proc/proc_net.c index 7034facf8b8f..13cd7835d0df 100644 --- a/trunk/fs/proc/proc_net.c +++ b/trunk/fs/proc/proc_net.c @@ -51,7 +51,6 @@ int seq_open_net(struct inode *ino, struct file *f, } EXPORT_SYMBOL_GPL(seq_open_net); -#ifdef CONFIG_NET int seq_release_net(struct inode *ino, struct file *f) { struct seq_file *seq; @@ -219,4 +218,3 @@ int __init proc_net_init(void) return register_pernet_subsys(&proc_net_ns_ops); } -#endif /* CONFIG_NET */ diff --git a/trunk/include/linux/seq_file.h b/trunk/include/linux/seq_file.h index 5da70c3f4417..d870a8253769 100644 --- a/trunk/include/linux/seq_file.h +++ b/trunk/include/linux/seq_file.h @@ -63,7 +63,6 @@ extern struct list_head *seq_list_start_head(struct list_head *head, extern struct list_head *seq_list_next(void *v, struct list_head *head, loff_t *ppos); -#ifdef CONFIG_NET struct net; struct seq_net_private { #ifdef CONFIG_NET_NS @@ -82,7 +81,6 @@ static inline struct net *seq_file_net(struct seq_file *seq) return &init_net; #endif } -#endif /* CONFIG_NET */ #endif #endif diff --git a/trunk/include/linux/skbuff.h b/trunk/include/linux/skbuff.h index ff72145d5d9e..7beb239d2ee0 100644 --- a/trunk/include/linux/skbuff.h +++ b/trunk/include/linux/skbuff.h @@ -892,7 +892,6 @@ static inline void skb_set_tail_pointer(struct sk_buff *skb, const int offset) /* * Add data to an sk_buff */ -extern unsigned char *skb_put(struct sk_buff *skb, unsigned int len); static inline unsigned char *__skb_put(struct sk_buff *skb, unsigned int len) { unsigned char *tmp = skb_tail_pointer(skb); @@ -902,7 +901,26 @@ static inline unsigned char *__skb_put(struct sk_buff *skb, unsigned int len) return tmp; } -extern unsigned char *skb_push(struct sk_buff *skb, unsigned int len); +/** + * skb_put - add data to a buffer + * @skb: buffer to use + * @len: amount of data to add + * + * This function extends the used data area of the buffer. If this would + * exceed the total buffer size the kernel will panic. A pointer to the + * first byte of the extra data is returned. + */ +static inline unsigned char *skb_put(struct sk_buff *skb, unsigned int len) +{ + unsigned char *tmp = skb_tail_pointer(skb); + SKB_LINEAR_ASSERT(skb); + skb->tail += len; + skb->len += len; + if (unlikely(skb->tail > skb->end)) + skb_over_panic(skb, len, current_text_addr()); + return tmp; +} + static inline unsigned char *__skb_push(struct sk_buff *skb, unsigned int len) { skb->data -= len; @@ -910,7 +928,24 @@ static inline unsigned char *__skb_push(struct sk_buff *skb, unsigned int len) return skb->data; } -extern unsigned char *skb_pull(struct sk_buff *skb, unsigned int len); +/** + * skb_push - add data to the start of a buffer + * @skb: buffer to use + * @len: amount of data to add + * + * This function extends the used data area of the buffer at the buffer + * start. If this would exceed the total buffer headroom the kernel will + * panic. A pointer to the first byte of the extra data is returned. + */ +static inline unsigned char *skb_push(struct sk_buff *skb, unsigned int len) +{ + skb->data -= len; + skb->len += len; + if (unlikely(skb->datahead)) + skb_under_panic(skb, len, current_text_addr()); + return skb->data; +} + static inline unsigned char *__skb_pull(struct sk_buff *skb, unsigned int len) { skb->len -= len; @@ -918,6 +953,21 @@ static inline unsigned char *__skb_pull(struct sk_buff *skb, unsigned int len) return skb->data += len; } +/** + * skb_pull - remove data from the start of a buffer + * @skb: buffer to use + * @len: amount of data to remove + * + * This function removes data from the start of a buffer, returning + * the memory to the headroom. A pointer to the next data in the buffer + * is returned. Once the data has been pulled future pushes will overwrite + * the old data. + */ +static inline unsigned char *skb_pull(struct sk_buff *skb, unsigned int len) +{ + return unlikely(len > skb->len) ? NULL : __skb_pull(skb, len); +} + extern unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta); static inline unsigned char *__pskb_pull(struct sk_buff *skb, unsigned int len) @@ -1158,7 +1208,21 @@ static inline void __skb_trim(struct sk_buff *skb, unsigned int len) skb_set_tail_pointer(skb, len); } -extern void skb_trim(struct sk_buff *skb, unsigned int len); +/** + * skb_trim - remove end from a buffer + * @skb: buffer to alter + * @len: new length + * + * Cut the length of a buffer down by removing data from the tail. If + * the buffer is already under the length specified it is not modified. + * The skb must be linear. + */ +static inline void skb_trim(struct sk_buff *skb, unsigned int len) +{ + if (skb->len > len) + __skb_trim(skb, len); +} + static inline int __pskb_trim(struct sk_buff *skb, unsigned int len) { @@ -1241,7 +1305,22 @@ static inline struct sk_buff *__dev_alloc_skb(unsigned int length, return skb; } -extern struct sk_buff *dev_alloc_skb(unsigned int length); +/** + * dev_alloc_skb - allocate an skbuff for receiving + * @length: length to allocate + * + * Allocate a new &sk_buff and assign it a usage count of one. The + * buffer has unspecified headroom built in. Users should allocate + * the headroom they think they need without accounting for the + * built in space. The built in space is used for optimisations. + * + * %NULL is returned if there is no free memory. Although this function + * allocates memory it can be called from an interrupt. + */ +static inline struct sk_buff *dev_alloc_skb(unsigned int length) +{ + return __dev_alloc_skb(length, GFP_ATOMIC); +} extern struct sk_buff *__netdev_alloc_skb(struct net_device *dev, unsigned int length, gfp_t gfp_mask); diff --git a/trunk/include/net/dst.h b/trunk/include/net/dst.h index 002500e631f5..ae13370e8484 100644 --- a/trunk/include/net/dst.h +++ b/trunk/include/net/dst.h @@ -163,7 +163,15 @@ struct dst_entry * dst_clone(struct dst_entry * dst) return dst; } -extern void dst_release(struct dst_entry *dst); +static inline +void dst_release(struct dst_entry * dst) +{ + if (dst) { + WARN_ON(atomic_read(&dst->__refcnt) < 1); + smp_mb__before_atomic_dec(); + atomic_dec(&dst->__refcnt); + } +} /* Children define the path of the packet through the * Linux networking. Thus, destinations are stackable. diff --git a/trunk/include/net/ipv6.h b/trunk/include/net/ipv6.h index 5738c1c73ac1..296f61d84709 100644 --- a/trunk/include/net/ipv6.h +++ b/trunk/include/net/ipv6.h @@ -250,6 +250,15 @@ int ip6_frag_mem(struct net *net); #define IPV6_FRAG_TIMEOUT (60*HZ) /* 60 seconds */ +/* + * Function prototype for build_xmit + */ + +typedef int (*inet_getfrag_t) (const void *data, + struct in6_addr *addr, + char *, + unsigned int, unsigned int); + extern int __ipv6_addr_type(const struct in6_addr *addr); static inline int ipv6_addr_type(const struct in6_addr *addr) { @@ -501,6 +510,14 @@ extern int ip6_local_out(struct sk_buff *skb); * Extension header (options) processing */ +extern u8 * ipv6_build_nfrag_opts(struct sk_buff *skb, + u8 *prev_hdr, + struct ipv6_txoptions *opt, + struct in6_addr *daddr, + u32 jumbolen); +extern u8 * ipv6_build_frag_opts(struct sk_buff *skb, + u8 *prev_hdr, + struct ipv6_txoptions *opt); extern void ipv6_push_nfrag_opts(struct sk_buff *skb, struct ipv6_txoptions *opt, u8 *proto, diff --git a/trunk/include/net/pkt_cls.h b/trunk/include/net/pkt_cls.h index aa9e282db485..d349c66ef828 100644 --- a/trunk/include/net/pkt_cls.h +++ b/trunk/include/net/pkt_cls.h @@ -353,7 +353,7 @@ tcf_match_indev(struct sk_buff *skb, char *indev) if (indev[0]) { if (!skb->iif) return 0; - dev = __dev_get_by_index(dev_net(skb->dev), skb->iif); + dev = __dev_get_by_index(&init_net, skb->iif); if (!dev || strcmp(indev, dev->name)) return 0; } diff --git a/trunk/include/net/sctp/command.h b/trunk/include/net/sctp/command.h index 4263af857794..10ae2da6f93b 100644 --- a/trunk/include/net/sctp/command.h +++ b/trunk/include/net/sctp/command.h @@ -205,11 +205,12 @@ typedef struct { int sctp_init_cmd_seq(sctp_cmd_seq_t *seq); /* Add a command to an sctp_cmd_seq_t. + * Return 0 if the command sequence is full. * * Use the SCTP_* constructors defined by SCTP_ARG_CONSTRUCTOR() above * to wrap data which goes in the obj argument. */ -void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_arg_t obj); +int sctp_add_cmd(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_arg_t obj); /* Return the next command structure in an sctp_cmd_seq. * Return NULL at the end of the sequence. diff --git a/trunk/include/net/sctp/sm.h b/trunk/include/net/sctp/sm.h index 24811732bdb2..ef9e7ed2c82e 100644 --- a/trunk/include/net/sctp/sm.h +++ b/trunk/include/net/sctp/sm.h @@ -385,6 +385,14 @@ static inline int ADDIP_SERIAL_gte(__u16 s, __u16 t) return (((s) == (t)) || (((t) - (s)) & ADDIP_SERIAL_SIGN_BIT)); } + +/* Run sctp_add_cmd() generating a BUG() if there is a failure. */ +static inline void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_arg_t obj) +{ + if (unlikely(!sctp_add_cmd(seq, verb, obj))) + BUG(); +} + /* Check VTAG of the packet matches the sender's own tag. */ static inline int sctp_vtag_verify(const struct sctp_chunk *chunk, diff --git a/trunk/lib/kobject_uevent.c b/trunk/lib/kobject_uevent.c index 0d56dad319ad..5a402e2982af 100644 --- a/trunk/lib/kobject_uevent.c +++ b/trunk/lib/kobject_uevent.c @@ -15,16 +15,12 @@ */ #include -#include -#include -#include - -#ifdef CONFIG_NET #include #include #include +#include +#include #include -#endif u64 uevent_seqnum; diff --git a/trunk/net/core/dst.c b/trunk/net/core/dst.c index fe03266130b6..694cd2a3f6d2 100644 --- a/trunk/net/core/dst.c +++ b/trunk/net/core/dst.c @@ -259,16 +259,6 @@ struct dst_entry *dst_destroy(struct dst_entry * dst) return NULL; } -void dst_release(struct dst_entry *dst) -{ - if (dst) { - WARN_ON(atomic_read(&dst->__refcnt) < 1); - smp_mb__before_atomic_dec(); - atomic_dec(&dst->__refcnt); - } -} -EXPORT_SYMBOL(dst_release); - /* Dirty hack. We did it in 2.2 (in __dst_free), * we have _very_ good reasons not to repeat * this mistake in 2.3, but we have no choice diff --git a/trunk/net/core/skbuff.c b/trunk/net/core/skbuff.c index 86e5682728be..0d0fd28a9041 100644 --- a/trunk/net/core/skbuff.c +++ b/trunk/net/core/skbuff.c @@ -263,24 +263,6 @@ struct sk_buff *__netdev_alloc_skb(struct net_device *dev, return skb; } -/** - * dev_alloc_skb - allocate an skbuff for receiving - * @length: length to allocate - * - * Allocate a new &sk_buff and assign it a usage count of one. The - * buffer has unspecified headroom built in. Users should allocate - * the headroom they think they need without accounting for the - * built in space. The built in space is used for optimisations. - * - * %NULL is returned if there is no free memory. Although this function - * allocates memory it can be called from an interrupt. - */ -struct sk_buff *dev_alloc_skb(unsigned int length) -{ - return __dev_alloc_skb(length, GFP_ATOMIC); -} -EXPORT_SYMBOL(dev_alloc_skb); - static void skb_drop_list(struct sk_buff **listp) { struct sk_buff *list = *listp; @@ -875,78 +857,6 @@ int skb_pad(struct sk_buff *skb, int pad) return err; } -/** - * skb_put - add data to a buffer - * @skb: buffer to use - * @len: amount of data to add - * - * This function extends the used data area of the buffer. If this would - * exceed the total buffer size the kernel will panic. A pointer to the - * first byte of the extra data is returned. - */ -unsigned char *skb_put(struct sk_buff *skb, unsigned int len) -{ - unsigned char *tmp = skb_tail_pointer(skb); - SKB_LINEAR_ASSERT(skb); - skb->tail += len; - skb->len += len; - if (unlikely(skb->tail > skb->end)) - skb_over_panic(skb, len, __builtin_return_address(0)); - return tmp; -} -EXPORT_SYMBOL(skb_put); - -/** - * skb_push - add data to the start of a buffer - * @skb: buffer to use - * @len: amount of data to add - * - * This function extends the used data area of the buffer at the buffer - * start. If this would exceed the total buffer headroom the kernel will - * panic. A pointer to the first byte of the extra data is returned. - */ -unsigned char *skb_push(struct sk_buff *skb, unsigned int len) -{ - skb->data -= len; - skb->len += len; - if (unlikely(skb->datahead)) - skb_under_panic(skb, len, __builtin_return_address(0)); - return skb->data; -} -EXPORT_SYMBOL(skb_push); - -/** - * skb_pull - remove data from the start of a buffer - * @skb: buffer to use - * @len: amount of data to remove - * - * This function removes data from the start of a buffer, returning - * the memory to the headroom. A pointer to the next data in the buffer - * is returned. Once the data has been pulled future pushes will overwrite - * the old data. - */ -unsigned char *skb_pull(struct sk_buff *skb, unsigned int len) -{ - return unlikely(len > skb->len) ? NULL : __skb_pull(skb, len); -} -EXPORT_SYMBOL(skb_pull); - -/** - * skb_trim - remove end from a buffer - * @skb: buffer to alter - * @len: new length - * - * Cut the length of a buffer down by removing data from the tail. If - * the buffer is already under the length specified it is not modified. - * The skb must be linear. - */ -void skb_trim(struct sk_buff *skb, unsigned int len) -{ - if (skb->len > len) - __skb_trim(skb, len); -} -EXPORT_SYMBOL(skb_trim); - /* Trims skb to length len. It can change skb pointers. */ diff --git a/trunk/net/mac80211/ieee80211_ioctl.c b/trunk/net/mac80211/ieee80211_ioctl.c index 5af23d318726..b047eebb6330 100644 --- a/trunk/net/mac80211/ieee80211_ioctl.c +++ b/trunk/net/mac80211/ieee80211_ioctl.c @@ -55,9 +55,6 @@ static int ieee80211_set_encryption(struct net_device *dev, u8 *sta_addr, key = sta->key; } - if (!key) - return -ENOENT; - ieee80211_key_free(key); return 0; } else { diff --git a/trunk/net/sctp/command.c b/trunk/net/sctp/command.c index c0044019db9e..bb977330002a 100644 --- a/trunk/net/sctp/command.c +++ b/trunk/net/sctp/command.c @@ -52,12 +52,18 @@ int sctp_init_cmd_seq(sctp_cmd_seq_t *seq) /* Add a command to a sctp_cmd_seq_t. * Return 0 if the command sequence is full. */ -void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_arg_t obj) +int sctp_add_cmd(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_arg_t obj) { - BUG_ON(seq->next_free_slot >= SCTP_MAX_NUM_COMMANDS); + if (seq->next_free_slot >= SCTP_MAX_NUM_COMMANDS) + goto fail; seq->cmds[seq->next_free_slot].verb = verb; seq->cmds[seq->next_free_slot++].obj = obj; + + return 1; + +fail: + return 0; } /* Return the next command structure in a sctp_cmd_seq. diff --git a/trunk/net/sctp/sm_statefuns.c b/trunk/net/sctp/sm_statefuns.c index b534dbef864f..6545b5fcbc73 100644 --- a/trunk/net/sctp/sm_statefuns.c +++ b/trunk/net/sctp/sm_statefuns.c @@ -3135,8 +3135,12 @@ sctp_disposition_t sctp_sf_operr_notify(const struct sctp_endpoint *ep, if (!ev) goto nomem; - sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, - SCTP_ULPEVENT(ev)); + if (!sctp_add_cmd(commands, SCTP_CMD_EVENT_ULP, + SCTP_ULPEVENT(ev))) { + sctp_ulpevent_free(ev); + goto nomem; + } + sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_OPERR, SCTP_CHUNK(chunk)); }