From 5dde431ab11464fd34afb89df7834a3587a2bacb Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 27 Dec 2004 02:23:16 -0800 Subject: [APPLETALK]: Make some code static. Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller --- include/linux/atalk.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include/linux') diff --git a/include/linux/atalk.h b/include/linux/atalk.h index 2a9b82002591..f5cdd69497bc 100644 --- a/include/linux/atalk.h +++ b/include/linux/atalk.h @@ -188,8 +188,6 @@ extern struct net_device *atrtr_get_dev(struct atalk_addr *sa); extern int aarp_send_ddp(struct net_device *dev, struct sk_buff *skb, struct atalk_addr *sa, void *hwaddr); -extern void aarp_send_probe(struct net_device *dev, - struct atalk_addr *addr); extern void aarp_device_down(struct net_device *dev); extern void aarp_probe_network(struct atalk_iface *atif); extern int aarp_proxy_probe_network(struct atalk_iface *atif, -- cgit v1.2.3 From ca2628e3ffa30bc118dd87e86e2d7856006b6cc6 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 27 Dec 2004 02:25:23 -0800 Subject: [NET]: No need to export sock_readv_writev Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller --- include/linux/net.h | 4 ---- net/socket.c | 5 +++-- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'include/linux') diff --git a/include/linux/net.h b/include/linux/net.h index 368b0f9d3006..8bfb1243f5e2 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -187,10 +187,6 @@ extern int sock_sendmsg(struct socket *sock, struct msghdr *msg, size_t len); extern int sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t size, int flags); -extern int sock_readv_writev(int type, struct inode *inode, - struct file *file, - const struct iovec *iov, long count, - size_t size); extern int sock_map_fd(struct socket *sock); extern struct socket *sockfd_lookup(int fd, int *err); #define sockfd_put(sock) fput(sock->file) diff --git a/net/socket.c b/net/socket.c index 45aada9314a1..dff6156dd4f8 100644 --- a/net/socket.c +++ b/net/socket.c @@ -736,8 +736,9 @@ ssize_t sock_sendpage(struct file *file, struct page *page, return sock->ops->sendpage(sock, page, offset, size, flags); } -int sock_readv_writev(int type, struct inode * inode, struct file * file, - const struct iovec * iov, long count, size_t size) +static int sock_readv_writev(int type, struct inode * inode, + struct file * file, const struct iovec * iov, + long count, size_t size) { struct msghdr msg; struct socket *sock; -- cgit v1.2.3 From 4d9caa15d23cc2891c4509b8337935ab4c2cab40 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 27 Dec 2004 02:29:36 -0800 Subject: [SUNRPC]: Staticize, kill unused functions, and remove unneeded exports. Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller --- include/linux/sunrpc/auth.h | 2 - include/linux/sunrpc/cache.h | 5 -- include/linux/sunrpc/gss_asn1.h | 2 - include/linux/sunrpc/sched.h | 1 - include/linux/sunrpc/xdr.h | 6 -- include/linux/sunrpc/xprt.h | 3 - net/sunrpc/auth.c | 2 +- net/sunrpc/auth_gss/auth_gss.c | 2 +- net/sunrpc/auth_gss/gss_generic_token.c | 35 --------- net/sunrpc/auth_gss/gss_krb5_crypto.c | 2 +- net/sunrpc/auth_gss/gss_krb5_mech.c | 3 - net/sunrpc/auth_gss/gss_spkm3_mech.c | 9 +-- net/sunrpc/auth_gss/svcauth_gss.c | 4 +- net/sunrpc/cache.c | 41 +++------- net/sunrpc/pmap_clnt.c | 4 +- net/sunrpc/rpc_pipe.c | 9 +-- net/sunrpc/sched.c | 5 +- net/sunrpc/sunrpc_syms.c | 1 - net/sunrpc/svcauth.c | 3 +- net/sunrpc/svcauth_unix.c | 6 +- net/sunrpc/xdr.c | 133 +------------------------------- net/sunrpc/xprt.c | 8 +- 22 files changed, 38 insertions(+), 248 deletions(-) (limited to 'include/linux') diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index a196e9b76793..97976c431d0b 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h @@ -114,8 +114,6 @@ extern struct rpc_authops authnull_ops; extern struct rpc_authops authdes_ops; #endif -u32 pseudoflavor_to_flavor(rpc_authflavor_t); - int rpcauth_register(struct rpc_authops *); int rpcauth_unregister(struct rpc_authops *); struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *); diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index 04ac3afcc6a9..b902425d2be5 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h @@ -257,8 +257,6 @@ RTN *FNAME ARGS \ -extern void cache_defer_req(struct cache_req *req, struct cache_head *item); -extern void cache_revisit_request(struct cache_head *item); extern void cache_clean_deferred(void *owner); static inline struct cache_head *cache_get(struct cache_head *h) @@ -286,14 +284,11 @@ extern void cache_fresh(struct cache_detail *detail, struct cache_head *head, time_t expiry); extern int cache_check(struct cache_detail *detail, struct cache_head *h, struct cache_req *rqstp); -extern int cache_clean(void); extern void cache_flush(void); extern void cache_purge(struct cache_detail *detail); #define NEVER (0x7FFFFFFF) extern void cache_register(struct cache_detail *cd); extern int cache_unregister(struct cache_detail *cd); -extern struct cache_detail *cache_find(char *name); -extern void cache_drop(struct cache_detail *detail); extern void qword_add(char **bpp, int *lp, char *str); extern void qword_addhex(char **bpp, int *lp, char *buf, int blen); diff --git a/include/linux/sunrpc/gss_asn1.h b/include/linux/sunrpc/gss_asn1.h index e0e4e1dc5656..3ccecd0ad229 100644 --- a/include/linux/sunrpc/gss_asn1.h +++ b/include/linux/sunrpc/gss_asn1.h @@ -71,8 +71,6 @@ u32 g_verify_token_header( unsigned char **buf_in, int toksize); -u32 g_get_mech_oid(struct xdr_netobj *mech, struct xdr_netobj * in_buf); - int g_token_size( struct xdr_netobj *mech, unsigned int body_size); diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 6959ed0d69d8..71d710450e84 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h @@ -222,7 +222,6 @@ struct rpc_task *rpc_wake_up_next(struct rpc_wait_queue *); void rpc_wake_up_status(struct rpc_wait_queue *, int); void rpc_delay(struct rpc_task *, unsigned long); void * rpc_malloc(struct rpc_task *, size_t); -void rpc_free(struct rpc_task *); int rpciod_up(void); void rpciod_down(void); void rpciod_wake_up(void); diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index 112738cca4e1..541dcf838abf 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h @@ -95,7 +95,6 @@ u32 * xdr_decode_string(u32 *p, char **sp, int *lenp, int maxlen); u32 * xdr_decode_string_inplace(u32 *p, char **sp, int *lenp, int maxlen); u32 * xdr_encode_netobj(u32 *p, const struct xdr_netobj *); u32 * xdr_decode_netobj(u32 *p, struct xdr_netobj *); -u32 * xdr_decode_netobj_fixed(u32 *p, void *obj, unsigned int len); void xdr_encode_pages(struct xdr_buf *, struct page **, unsigned int, unsigned int); @@ -135,8 +134,6 @@ xdr_adjust_iovec(struct kvec *iov, u32 *p) return iov->iov_len = ((u8 *) p - (u8 *) iov->iov_base); } -void xdr_shift_iovec(struct kvec *, int, size_t); - /* * Maximum number of iov's we use. */ @@ -145,10 +142,7 @@ void xdr_shift_iovec(struct kvec *, int, size_t); /* * XDR buffer helper functions */ -extern int xdr_kmap(struct kvec *, struct xdr_buf *, size_t); -extern void xdr_kunmap(struct xdr_buf *, size_t); extern void xdr_shift_buf(struct xdr_buf *, size_t); -extern void _copy_from_pages(char *, struct page **, size_t, size_t); extern void xdr_buf_from_iov(struct kvec *, struct xdr_buf *); extern int xdr_buf_subsegment(struct xdr_buf *, struct xdr_buf *, int, int); extern int xdr_buf_read_netobj(struct xdr_buf *, struct xdr_netobj *, int); diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 298b18486729..78dbc7bedd7b 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h @@ -201,8 +201,6 @@ struct rpc_xprt { struct rpc_xprt * xprt_create_proto(int proto, struct sockaddr_in *addr, struct rpc_timeout *toparms); int xprt_destroy(struct rpc_xprt *); -void xprt_shutdown(struct rpc_xprt *); -void xprt_default_timeout(struct rpc_timeout *, int); void xprt_set_timeout(struct rpc_timeout *, unsigned int, unsigned long); @@ -213,7 +211,6 @@ void xprt_receive(struct rpc_task *); int xprt_adjust_timeout(struct rpc_rqst *req); void xprt_release(struct rpc_task *); void xprt_connect(struct rpc_task *); -int xprt_clear_backlog(struct rpc_xprt *); void xprt_sock_setbufsize(struct rpc_xprt *); #define XPRT_LOCKED 0 diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index 315b16247b8c..91d325e62953 100644 --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c @@ -25,7 +25,7 @@ static struct rpc_authops * auth_flavors[RPC_AUTH_MAXFLAVOR] = { NULL, /* others can be loadable modules */ }; -u32 +static u32 pseudoflavor_to_flavor(u32 flavor) { if (flavor >= RPC_AUTH_MAXFLAVOR) return RPC_AUTH_GSS; diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c index 927b72c89fb3..a6260098e836 100644 --- a/net/sunrpc/auth_gss/auth_gss.c +++ b/net/sunrpc/auth_gss/auth_gss.c @@ -532,7 +532,7 @@ gss_pipe_release(struct inode *inode) spin_unlock(&gss_auth->lock); } -void +static void gss_pipe_destroy_msg(struct rpc_pipe_msg *msg) { struct gss_upcall_msg *gss_msg = container_of(msg, struct gss_upcall_msg, msg); diff --git a/net/sunrpc/auth_gss/gss_generic_token.c b/net/sunrpc/auth_gss/gss_generic_token.c index b0951d11522a..826df44e7fca 100644 --- a/net/sunrpc/auth_gss/gss_generic_token.c +++ b/net/sunrpc/auth_gss/gss_generic_token.c @@ -233,38 +233,3 @@ g_verify_token_header(struct xdr_netobj *mech, int *body_size, EXPORT_SYMBOL(g_verify_token_header); -/* Given a buffer containing a token, returns a copy of the mech oid in - * the parameter mech. */ -u32 -g_get_mech_oid(struct xdr_netobj *mech, struct xdr_netobj * in_buf) -{ - unsigned char *buf = in_buf->data; - int len = in_buf->len; - int ret=0; - int seqsize; - - if ((len-=1) < 0) - return(G_BAD_TOK_HEADER); - if (*buf++ != 0x60) - return(G_BAD_TOK_HEADER); - - if ((seqsize = der_read_length(&buf, &len)) < 0) - return(G_BAD_TOK_HEADER); - - if ((len-=1) < 0) - return(G_BAD_TOK_HEADER); - if (*buf++ != 0x06) - return(G_BAD_TOK_HEADER); - - if ((len-=1) < 0) - return(G_BAD_TOK_HEADER); - mech->len = *buf++; - - if ((len-=mech->len) < 0) - return(G_BAD_TOK_HEADER); - if (!(mech->data = kmalloc(mech->len, GFP_KERNEL))) - return(G_BUFFER_ALLOC); - memcpy(mech->data, buf, mech->len); - - return ret; -} diff --git a/net/sunrpc/auth_gss/gss_krb5_crypto.c b/net/sunrpc/auth_gss/gss_krb5_crypto.c index b4db91868bb8..24c21f2a33a7 100644 --- a/net/sunrpc/auth_gss/gss_krb5_crypto.c +++ b/net/sunrpc/auth_gss/gss_krb5_crypto.c @@ -132,7 +132,7 @@ out: EXPORT_SYMBOL(krb5_decrypt); -void +static void buf_to_sg(struct scatterlist *sg, char *ptr, int len) { sg->page = virt_to_page(ptr); sg->offset = offset_in_page(ptr); diff --git a/net/sunrpc/auth_gss/gss_krb5_mech.c b/net/sunrpc/auth_gss/gss_krb5_mech.c index 0082fb5c999a..a734dd869518 100644 --- a/net/sunrpc/auth_gss/gss_krb5_mech.c +++ b/net/sunrpc/auth_gss/gss_krb5_mech.c @@ -48,9 +48,6 @@ # define RPCDBG_FACILITY RPCDBG_AUTH #endif -struct xdr_netobj gss_mech_krb5_oid = - {9, "\052\206\110\206\367\022\001\002\002"}; - static inline int get_bytes(char **ptr, const char *end, void *res, int len) { diff --git a/net/sunrpc/auth_gss/gss_spkm3_mech.c b/net/sunrpc/auth_gss/gss_spkm3_mech.c index 2887de1cae1c..fd213dc36093 100644 --- a/net/sunrpc/auth_gss/gss_spkm3_mech.c +++ b/net/sunrpc/auth_gss/gss_spkm3_mech.c @@ -49,9 +49,6 @@ # define RPCDBG_FACILITY RPCDBG_AUTH #endif -struct xdr_netobj gss_mech_spkm3_oid = - {7, "\053\006\001\005\005\001\003"}; - static inline int get_bytes(char **ptr, const char *end, void *res, int len) { @@ -206,7 +203,7 @@ out_err: return GSS_S_FAILURE; } -void +static void gss_delete_sec_context_spkm3(void *internal_ctx) { struct spkm3_ctx *sctx = internal_ctx; @@ -221,7 +218,7 @@ gss_delete_sec_context_spkm3(void *internal_ctx) { kfree(sctx); } -u32 +static u32 gss_verify_mic_spkm3(struct gss_ctx *ctx, struct xdr_buf *signbuf, struct xdr_netobj *checksum, @@ -241,7 +238,7 @@ gss_verify_mic_spkm3(struct gss_ctx *ctx, return maj_stat; } -u32 +static u32 gss_get_mic_spkm3(struct gss_ctx *ctx, u32 qop, struct xdr_buf *message_buffer, diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index ee2e9cef94c2..43096520a604 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c @@ -448,7 +448,7 @@ static struct cache_detail rsc_cache = { static DefineSimpleCacheLookup(rsc, 0); -struct rsc * +static struct rsc * gss_svc_searchbyctx(struct xdr_netobj *handle) { struct rsc rsci; @@ -1045,7 +1045,7 @@ svcauth_gss_domain_release(struct auth_domain *dom) kfree(gd); } -struct auth_ops svcauthops_gss = { +static struct auth_ops svcauthops_gss = { .name = "rpcsec_gss", .owner = THIS_MODULE, .flavour = RPC_AUTH_GSS, diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c index d508a513d632..8845b9e3d735 100644 --- a/net/sunrpc/cache.c +++ b/net/sunrpc/cache.c @@ -33,6 +33,9 @@ #define RPCDBG_FACILITY RPCDBG_CACHE +static void cache_defer_req(struct cache_req *req, struct cache_head *item); +static void cache_revisit_request(struct cache_head *item); + void cache_init(struct cache_head *h) { time_t now = get_seconds(); @@ -256,39 +259,13 @@ int cache_unregister(struct cache_detail *cd) return 0; } -struct cache_detail *cache_find(char *name) -{ - struct list_head *l; - - spin_lock(&cache_list_lock); - list_for_each(l, &cache_list) { - struct cache_detail *cd = list_entry(l, struct cache_detail, others); - - if (strcmp(cd->name, name)==0) { - atomic_inc(&cd->inuse); - spin_unlock(&cache_list_lock); - return cd; - } - } - spin_unlock(&cache_list_lock); - return NULL; -} - -/* cache_drop must be called on any cache returned by - * cache_find, after it has been used - */ -void cache_drop(struct cache_detail *detail) -{ - atomic_dec(&detail->inuse); -} - /* clean cache tries to find something to clean * and cleans it. * It returns 1 if it cleaned something, * 0 if it didn't find anything this time * -1 if it fell off the end of the list. */ -int cache_clean(void) +static int cache_clean(void) { int rv = 0; struct list_head *next; @@ -428,12 +405,12 @@ void cache_purge(struct cache_detail *detail) #define DFR_MAX 300 /* ??? */ -spinlock_t cache_defer_lock = SPIN_LOCK_UNLOCKED; +static spinlock_t cache_defer_lock = SPIN_LOCK_UNLOCKED; static LIST_HEAD(cache_defer_list); static struct list_head cache_defer_hash[DFR_HASHSIZE]; static int cache_defer_cnt; -void cache_defer_req(struct cache_req *req, struct cache_head *item) +static void cache_defer_req(struct cache_req *req, struct cache_head *item) { struct cache_deferred_req *dreq; int hash = DFR_HASH(item); @@ -483,7 +460,7 @@ void cache_defer_req(struct cache_req *req, struct cache_head *item) } } -void cache_revisit_request(struct cache_head *item) +static void cache_revisit_request(struct cache_head *item) { struct cache_deferred_req *dreq; struct list_head pending; @@ -902,7 +879,7 @@ void qword_addhex(char **bpp, int *lp, char *buf, int blen) *lp = len; } -void warn_no_listener(struct cache_detail *detail) +static void warn_no_listener(struct cache_detail *detail) { if (detail->last_warn != detail->last_close) { detail->last_warn = detail->last_close; @@ -1119,7 +1096,7 @@ static int c_show(struct seq_file *m, void *p) return cd->cache_show(m, cd, cp); } -struct seq_operations cache_content_op = { +static struct seq_operations cache_content_op = { .start = c_start, .next = c_next, .stop = c_stop, diff --git a/net/sunrpc/pmap_clnt.c b/net/sunrpc/pmap_clnt.c index 61bdc9754a06..5e157d65bbe7 100644 --- a/net/sunrpc/pmap_clnt.c +++ b/net/sunrpc/pmap_clnt.c @@ -31,7 +31,7 @@ static struct rpc_procinfo pmap_procedures[]; static struct rpc_clnt * pmap_create(char *, struct sockaddr_in *, int); static void pmap_getport_done(struct rpc_task *); -extern struct rpc_program pmap_program; +static struct rpc_program pmap_program; static spinlock_t pmap_lock = SPIN_LOCK_UNLOCKED; /* @@ -292,7 +292,7 @@ static struct rpc_version * pmap_version[] = { static struct rpc_stat pmap_stats; -struct rpc_program pmap_program = { +static struct rpc_program pmap_program = { .name = "portmap", .number = RPC_PMAP_PROGRAM, .nrvers = ARRAY_SIZE(pmap_version), diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index 11872a8a94be..7b3d9647671f 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c @@ -276,12 +276,7 @@ rpc_pipe_ioctl(struct inode *ino, struct file *filp, } } -struct inode_operations rpc_pipe_iops = { - .lookup = simple_lookup, -}; - - -struct file_operations rpc_pipe_fops = { +static struct file_operations rpc_pipe_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = rpc_pipe_read, @@ -595,7 +590,7 @@ __rpc_rmdir(struct inode *dir, struct dentry *dentry) return 0; } -struct dentry * +static struct dentry * rpc_lookup_negative(char *path, struct nameidata *nd) { struct dentry *dentry; diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index aa2205a2c19a..c5c8d5d59a0f 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c @@ -42,6 +42,9 @@ static mempool_t *rpc_buffer_mempool; static void __rpc_default_timer(struct rpc_task *task); static void rpciod_killall(void); +static void rpc_free(struct rpc_task *task); + + /* * When an asynchronous RPC task is activated within a bottom half * handler, or while executing another RPC task, it is put on @@ -837,7 +840,7 @@ rpc_malloc(struct rpc_task *task, size_t size) return task->tk_buffer; } -void +static void rpc_free(struct rpc_task *task) { if (task->tk_buffer) { diff --git a/net/sunrpc/sunrpc_syms.c b/net/sunrpc/sunrpc_syms.c index 51f0392ae531..1876751172be 100644 --- a/net/sunrpc/sunrpc_syms.c +++ b/net/sunrpc/sunrpc_syms.c @@ -107,7 +107,6 @@ EXPORT_SYMBOL(auth_unix_add_addr); EXPORT_SYMBOL(auth_unix_forget_old); EXPORT_SYMBOL(auth_unix_lookup); EXPORT_SYMBOL(cache_check); -EXPORT_SYMBOL(cache_clean); EXPORT_SYMBOL(cache_flush); EXPORT_SYMBOL(cache_purge); EXPORT_SYMBOL(cache_fresh); diff --git a/net/sunrpc/svcauth.c b/net/sunrpc/svcauth.c index d9f09e61d83c..8a659ac5143a 100644 --- a/net/sunrpc/svcauth.c +++ b/net/sunrpc/svcauth.c @@ -128,7 +128,8 @@ EXPORT_SYMBOL(svc_auth_unregister); #define DN_HASHMASK (DN_HASHMAX-1) static struct cache_head *auth_domain_table[DN_HASHMAX]; -void auth_domain_drop(struct cache_head *item, struct cache_detail *cd) + +static void auth_domain_drop(struct cache_head *item, struct cache_detail *cd) { struct auth_domain *dom = container_of(item, struct auth_domain, h); if (cache_put(item,cd)) diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c index 2832312483ed..043eb46c7fba 100644 --- a/net/sunrpc/svcauth_unix.c +++ b/net/sunrpc/svcauth_unix.c @@ -97,7 +97,7 @@ struct ip_map { }; static struct cache_head *ip_table[IP_HASHMAX]; -void ip_map_put(struct cache_head *item, struct cache_detail *cd) +static void ip_map_put(struct cache_head *item, struct cache_detail *cd) { struct ip_map *im = container_of(item, struct ip_map,h); if (cache_put(item, cd)) { @@ -417,7 +417,7 @@ struct auth_ops svcauth_null = { }; -int +static int svcauth_unix_accept(struct svc_rqst *rqstp, u32 *authp) { struct kvec *argv = &rqstp->rq_arg.head[0]; @@ -497,7 +497,7 @@ badcred: return SVC_DENIED; } -int +static int svcauth_unix_release(struct svc_rqst *rqstp) { /* Verifier (such as it is) is already in place. diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c index a6630a1f2025..0b42059378cb 100644 --- a/net/sunrpc/xdr.c +++ b/net/sunrpc/xdr.c @@ -32,15 +32,6 @@ xdr_encode_netobj(u32 *p, const struct xdr_netobj *obj) return p + XDR_QUADLEN(obj->len); } -u32 * -xdr_decode_netobj_fixed(u32 *p, void *obj, unsigned int len) -{ - if (ntohl(*p++) != len) - return NULL; - memcpy(obj, p, len); - return p + XDR_QUADLEN(len); -} - u32 * xdr_decode_netobj(u32 *p, struct xdr_netobj *obj) { @@ -185,124 +176,6 @@ xdr_inline_pages(struct xdr_buf *xdr, unsigned int offset, xdr->buflen += len; } -/* - * Realign the kvec if the server missed out some reply elements - * (such as post-op attributes,...) - * Note: This is a simple implementation that assumes that - * len <= iov->iov_len !!! - * The RPC header (assumed to be the 1st element in the iov array) - * is not shifted. - */ -void xdr_shift_iovec(struct kvec *iov, int nr, size_t len) -{ - struct kvec *pvec; - - for (pvec = iov + nr - 1; nr > 1; nr--, pvec--) { - struct kvec *svec = pvec - 1; - - if (len > pvec->iov_len) { - printk(KERN_DEBUG "RPC: Urk! Large shift of short iovec.\n"); - return; - } - memmove((char *)pvec->iov_base + len, pvec->iov_base, - pvec->iov_len - len); - - if (len > svec->iov_len) { - printk(KERN_DEBUG "RPC: Urk! Large shift of short iovec.\n"); - return; - } - memcpy(pvec->iov_base, - (char *)svec->iov_base + svec->iov_len - len, len); - } -} - -/* - * Map a struct xdr_buf into an kvec array. - */ -int xdr_kmap(struct kvec *iov_base, struct xdr_buf *xdr, size_t base) -{ - struct kvec *iov = iov_base; - struct page **ppage = xdr->pages; - unsigned int len, pglen = xdr->page_len; - - len = xdr->head[0].iov_len; - if (base < len) { - iov->iov_len = len - base; - iov->iov_base = (char *)xdr->head[0].iov_base + base; - iov++; - base = 0; - } else - base -= len; - - if (pglen == 0) - goto map_tail; - if (base >= pglen) { - base -= pglen; - goto map_tail; - } - if (base || xdr->page_base) { - pglen -= base; - base += xdr->page_base; - ppage += base >> PAGE_CACHE_SHIFT; - base &= ~PAGE_CACHE_MASK; - } - do { - len = PAGE_CACHE_SIZE; - iov->iov_base = kmap(*ppage); - if (base) { - iov->iov_base += base; - len -= base; - base = 0; - } - if (pglen < len) - len = pglen; - iov->iov_len = len; - iov++; - ppage++; - } while ((pglen -= len) != 0); -map_tail: - if (xdr->tail[0].iov_len) { - iov->iov_len = xdr->tail[0].iov_len - base; - iov->iov_base = (char *)xdr->tail[0].iov_base + base; - iov++; - } - return (iov - iov_base); -} - -void xdr_kunmap(struct xdr_buf *xdr, size_t base) -{ - struct page **ppage = xdr->pages; - unsigned int pglen = xdr->page_len; - - if (!pglen) - return; - if (base > xdr->head[0].iov_len) - base -= xdr->head[0].iov_len; - else - base = 0; - - if (base >= pglen) - return; - if (base || xdr->page_base) { - pglen -= base; - base += xdr->page_base; - ppage += base >> PAGE_CACHE_SHIFT; - /* Note: The offset means that the length of the first - * page is really (PAGE_CACHE_SIZE - (base & ~PAGE_CACHE_MASK)). - * In order to avoid an extra test inside the loop, - * we bump pglen here, and just subtract PAGE_CACHE_SIZE... */ - pglen += base & ~PAGE_CACHE_MASK; - } - for (;;) { - flush_dcache_page(*ppage); - kunmap(*ppage); - if (pglen <= PAGE_CACHE_SIZE) - break; - pglen -= PAGE_CACHE_SIZE; - ppage++; - } -} - void xdr_partial_copy_from_skb(struct xdr_buf *xdr, unsigned int base, skb_reader_t *desc, @@ -572,7 +445,7 @@ _copy_to_pages(struct page **pages, size_t pgbase, const char *p, size_t len) * Copies data into an arbitrary memory location from an array of pages * The copy is assumed to be non-overlapping. */ -void +static void _copy_from_pages(char *p, struct page **pages, size_t pgbase, size_t len) { struct page **pgfrom; @@ -610,7 +483,7 @@ _copy_from_pages(char *p, struct page **pages, size_t pgbase, size_t len) * 'len' bytes. The extra data is not lost, but is instead * moved into the inlined pages and/or the tail. */ -void +static void xdr_shrink_bufhead(struct xdr_buf *buf, size_t len) { struct kvec *head, *tail; @@ -683,7 +556,7 @@ xdr_shrink_bufhead(struct xdr_buf *buf, size_t len) * 'len' bytes. The extra data is not lost, but is instead * moved into the tail. */ -void +static void xdr_shrink_pagelen(struct xdr_buf *buf, size_t len) { struct kvec *tail; diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index de4bccc1c25d..92ece31702fb 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -90,6 +90,8 @@ static struct socket *xprt_create_socket(struct rpc_xprt *, int, int); static void xprt_bind_socket(struct rpc_xprt *, struct socket *); static int __xprt_get_cong(struct rpc_xprt *, struct rpc_task *); +static int xprt_clear_backlog(struct rpc_xprt *xprt); + #ifdef RPC_DEBUG_DATA /* * Print the buffer contents (first 128 bytes only--just enough for @@ -1397,7 +1399,7 @@ xprt_release(struct rpc_task *task) /* * Set default timeout parameters */ -void +static void xprt_default_timeout(struct rpc_timeout *to, int proto) { if (proto == IPPROTO_UDP) @@ -1633,7 +1635,7 @@ xprt_create_proto(int proto, struct sockaddr_in *sap, struct rpc_timeout *to) /* * Prepare for transport shutdown. */ -void +static void xprt_shutdown(struct rpc_xprt *xprt) { xprt->shutdown = 1; @@ -1648,7 +1650,7 @@ xprt_shutdown(struct rpc_xprt *xprt) /* * Clear the xprt backlog queue */ -int +static int xprt_clear_backlog(struct rpc_xprt *xprt) { rpc_wake_up_next(&xprt->backlog); wake_up(&xprt->cong_wait); -- cgit v1.2.3 From ee0168926e0492f4d34fcd3b9381753c848bb0de Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 27 Dec 2004 02:36:20 -0800 Subject: [NET]: Mark eth_header_parse static. Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller --- include/linux/etherdevice.h | 2 -- net/ethernet/eth.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'include/linux') diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index 6af5ecf9787a..ca6a19b1479f 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h @@ -37,8 +37,6 @@ extern void eth_header_cache_update(struct hh_cache *hh, struct net_device *dev unsigned char * haddr); extern int eth_header_cache(struct neighbour *neigh, struct hh_cache *hh); -extern int eth_header_parse(struct sk_buff *skb, - unsigned char *haddr); extern struct net_device *alloc_etherdev(int sizeof_priv); static inline void eth_copy_and_sum (struct sk_buff *dest, diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c index 5a3a14a72e6d..16c4234cbe12 100644 --- a/net/ethernet/eth.c +++ b/net/ethernet/eth.c @@ -208,7 +208,7 @@ unsigned short eth_type_trans(struct sk_buff *skb, struct net_device *dev) return htons(ETH_P_802_2); } -int eth_header_parse(struct sk_buff *skb, unsigned char *haddr) +static int eth_header_parse(struct sk_buff *skb, unsigned char *haddr) { struct ethhdr *eth = eth_hdr(skb); memcpy(haddr, eth->h_source, ETH_ALEN); -- cgit v1.2.3 From ebb461f7cfaa538f0bac28428d731657c2e2c174 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 27 Dec 2004 02:40:25 -0800 Subject: [NETLINK]: Staticize and remove unused functions. Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller --- include/linux/netlink.h | 3 --- net/netlink/af_netlink.c | 28 +--------------------------- 2 files changed, 1 insertion(+), 30 deletions(-) (limited to 'include/linux') diff --git a/include/linux/netlink.h b/include/linux/netlink.h index e969de36edaa..ee36f08c341e 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h @@ -116,8 +116,6 @@ struct netlink_skb_parms #define NETLINK_CREDS(skb) (&NETLINK_CB((skb)).creds) -extern int netlink_attach(int unit, int (*function)(int,struct sk_buff *skb)); -extern void netlink_detach(int unit); extern int netlink_post(int unit, struct sk_buff *skb); extern struct sock *netlink_kernel_create(int unit, void (*input)(struct sock *sk, int len)); extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); @@ -129,7 +127,6 @@ extern int netlink_register_notifier(struct notifier_block *nb); extern int netlink_unregister_notifier(struct notifier_block *nb); /* finegrained unicast helpers: */ -struct sock *netlink_getsockbypid(struct sock *ssk, u32 pid); struct sock *netlink_getsockbyfilp(struct file *filp); int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, long timeo); void netlink_detachskb(struct sock *sk, struct sk_buff *skb); diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 360913944ae0..755a3b10f9e1 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -546,7 +546,7 @@ static void netlink_overrun(struct sock *sk) } } -struct sock *netlink_getsockbypid(struct sock *ssk, u32 pid) +static struct sock *netlink_getsockbypid(struct sock *ssk, u32 pid) { int protocol = ssk->sk_protocol; struct sock *sock; @@ -1210,30 +1210,6 @@ static rwlock_t nl_emu_lock = RW_LOCK_UNLOCKED; * Backward compatibility. */ -int netlink_attach(int unit, int (*function)(int, struct sk_buff *skb)) -{ - struct sock *sk = netlink_kernel_create(unit, NULL); - if (sk == NULL) - return -ENOBUFS; - nlk_sk(sk)->handler = function; - write_lock_bh(&nl_emu_lock); - netlink_kernel[unit] = sk->sk_socket; - write_unlock_bh(&nl_emu_lock); - return 0; -} - -void netlink_detach(int unit) -{ - struct socket *sock; - - write_lock_bh(&nl_emu_lock); - sock = netlink_kernel[unit]; - netlink_kernel[unit] = NULL; - write_unlock_bh(&nl_emu_lock); - - sock_release(sock); -} - int netlink_post(int unit, struct sk_buff *skb) { struct socket *sock; @@ -1522,7 +1498,5 @@ EXPORT_SYMBOL(netlink_unicast); EXPORT_SYMBOL(netlink_unregister_notifier); #if defined(CONFIG_NETLINK_DEV) || defined(CONFIG_NETLINK_DEV_MODULE) -EXPORT_SYMBOL(netlink_attach); -EXPORT_SYMBOL(netlink_detach); EXPORT_SYMBOL(netlink_post); #endif -- cgit v1.2.3 From 7ce0e70b83543e37bb39b136b1743d3bb06eef60 Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Mon, 27 Dec 2004 05:25:02 -0800 Subject: [NET]: Use prefetching in skb_queue_walk(). This patch changes skb_queue_walk() in the same manner as in list_for_each() prefetch optimization, see http://marc.theaimsgroup.com/?l=linux-kernel&m=110399132418587 Signed-off-by: Oleg Nesterov Signed-off-by: David S. Miller --- include/linux/skbuff.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/linux') diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 57a2843faa21..b1d0c472d19c 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1077,9 +1077,9 @@ static inline void kunmap_skb_frag(void *vaddr) } #define skb_queue_walk(queue, skb) \ - for (skb = (queue)->next, prefetch(skb->next); \ - (skb != (struct sk_buff *)(queue)); \ - skb = skb->next, prefetch(skb->next)) + for (skb = (queue)->next; \ + prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \ + skb = skb->next) extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, -- cgit v1.2.3 From 018b2fb54b77b14ed667844fded529f371de7f81 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Mon, 27 Dec 2004 19:57:10 -0200 Subject: [INET] move inet_sock into inet_opt and rename it to inet_sock With this we can remove all the cut'n'pasted layouts in all inet_sock derived classes, such as tcp_sock, udp_sock, sctp_sock, etc. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller --- include/linux/ip.h | 24 ++++++++++-------------- include/linux/ipv6.h | 14 ++++---------- include/linux/tcp.h | 6 +----- include/linux/udp.h | 6 +----- include/net/icmp.h | 8 +------- include/net/sctp/sctp.h | 12 +++--------- include/net/tcp.h | 2 +- net/ipv4/af_inet.c | 10 +++++----- net/ipv4/datagram.c | 2 +- net/ipv4/icmp.c | 4 ++-- net/ipv4/igmp.c | 16 ++++++++-------- net/ipv4/ip_output.c | 16 ++++++++-------- net/ipv4/ip_sockglue.c | 12 ++++++------ net/ipv4/ipvs/ip_vs_sync.c | 6 +++--- net/ipv4/netfilter/ip_conntrack_core.c | 2 +- net/ipv4/raw.c | 14 +++++++------- net/ipv4/tcp.c | 4 ++-- net/ipv4/tcp_diag.c | 14 +++++++------- net/ipv4/tcp_input.c | 2 +- net/ipv4/tcp_ipv4.c | 32 ++++++++++++++++---------------- net/ipv4/tcp_minisocks.c | 2 +- net/ipv4/tcp_output.c | 2 +- net/ipv4/tcp_timer.c | 2 +- net/ipv4/udp.c | 20 ++++++++++---------- net/ipv6/af_inet6.c | 10 ++++------ net/ipv6/datagram.c | 4 ++-- net/ipv6/ip6_output.c | 6 +++--- net/ipv6/raw.c | 10 +++++----- net/ipv6/tcp_ipv6.c | 20 ++++++++++---------- net/ipv6/udp.c | 12 ++++++------ net/sctp/input.c | 2 +- net/sctp/ipv6.c | 6 +++--- net/sctp/protocol.c | 4 ++-- security/selinux/avc.c | 4 ++-- 34 files changed, 139 insertions(+), 171 deletions(-) (limited to 'include/linux') diff --git a/include/linux/ip.h b/include/linux/ip.h index 12d504ef8df0..3fe93474047d 100644 --- a/include/linux/ip.h +++ b/include/linux/ip.h @@ -107,7 +107,14 @@ struct ip_options { #define optlength(opt) (sizeof(struct ip_options) + opt->optlen) -struct inet_opt { +struct ipv6_pinfo; + +struct inet_sock { + /* sk and pinet6 has to be the first two members of inet_sock */ + struct sock sk; +#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) + struct ipv6_pinfo *pinet6; +#endif /* Socket demultiplex comparisons on incoming packets. */ __u32 daddr; /* Foreign IPv4 addr */ __u32 rcv_saddr; /* Bound local IPv4 addr */ @@ -146,20 +153,9 @@ struct inet_opt { #define IPCORK_OPT 1 /* ip-options has been held in ipcork.opt */ -struct ipv6_pinfo; - -/* WARNING: don't change the layout of the members in inet_sock! */ -struct inet_sock { - struct sock sk; -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) - struct ipv6_pinfo *pinet6; -#endif - struct inet_opt inet; -}; - -static inline struct inet_opt * inet_sk(const struct sock *__sk) +static inline struct inet_sock *inet_sk(const struct sock *sk) { - return &((struct inet_sock *)__sk)->inet; + return (struct inet_sock *)sk; } #endif diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index d7d1673880d5..d7c28b9db4fd 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h @@ -256,32 +256,26 @@ struct raw6_opt { /* WARNING: don't change the layout of the members in {raw,udp,tcp}6_sock! */ struct raw6_sock { - struct sock sk; - struct ipv6_pinfo *pinet6; - struct inet_opt inet; + struct inet_sock inet; struct raw6_opt raw6; struct ipv6_pinfo inet6; }; struct udp6_sock { - struct sock sk; - struct ipv6_pinfo *pinet6; - struct inet_opt inet; + struct inet_sock inet; struct udp_opt udp; struct ipv6_pinfo inet6; }; struct tcp6_sock { - struct sock sk; - struct ipv6_pinfo *pinet6; - struct inet_opt inet; + struct inet_sock inet; struct tcp_opt tcp; struct ipv6_pinfo inet6; }; static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk) { - return ((struct raw6_sock *)__sk)->pinet6; + return inet_sk(__sk)->pinet6; } static inline struct raw6_opt * raw6_sk(const struct sock *__sk) diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 0902b9f496c3..61de59d3cef4 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h @@ -440,11 +440,7 @@ struct tcp_opt { /* WARNING: don't change the layout of the members in tcp_sock! */ struct tcp_sock { - struct sock sk; -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) - struct ipv6_pinfo *pinet6; -#endif - struct inet_opt inet; + struct inet_sock inet; struct tcp_opt tcp; }; diff --git a/include/linux/udp.h b/include/linux/udp.h index facf661dd65a..831a3f532a10 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h @@ -53,11 +53,7 @@ struct udp_opt { /* WARNING: don't change the layout of the members in udp_sock! */ struct udp_sock { - struct sock sk; -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) - struct ipv6_pinfo *pinet6; -#endif - struct inet_opt inet; + struct inet_sock inet; struct udp_opt udp; }; diff --git a/include/net/icmp.h b/include/net/icmp.h index aa260fcad767..32b159f7ae22 100644 --- a/include/net/icmp.h +++ b/include/net/icmp.h @@ -50,15 +50,9 @@ struct raw_opt { struct icmp_filter filter; }; -struct ipv6_pinfo; - /* WARNING: don't change the layout of the members in raw_sock! */ struct raw_sock { - struct sock sk; -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) - struct ipv6_pinfo *pinet6; -#endif - struct inet_opt inet; + struct inet_sock inet; struct raw_opt raw4; }; diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 208c6aea06a1..f34b3aa1aa08 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h @@ -584,26 +584,20 @@ static inline int sctp_vtag_hashfn(__u16 lport, __u16 rport, __u32 vtag) /* WARNING: Do not change the layout of the members in sctp_sock! */ struct sctp_sock { - struct sock sk; -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) - struct ipv6_pinfo *pinet6; -#endif /* CONFIG_IPV6 */ - struct inet_opt inet; + struct inet_sock inet; struct sctp_opt sctp; }; #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) struct sctp6_sock { - struct sock sk; - struct ipv6_pinfo *pinet6; - struct inet_opt inet; + struct inet_sock inet; struct sctp_opt sctp; struct ipv6_pinfo inet6; }; #endif /* CONFIG_IPV6 */ #define sctp_sk(__sk) (&((struct sctp_sock *)__sk)->sctp) -#define sctp_opt2sk(__sp) &container_of(__sp, struct sctp_sock, sctp)->sk +#define sctp_opt2sk(__sp) &container_of(__sp, struct sctp_sock, sctp)->inet.sk /* Is a socket of this style? */ #define sctp_style(sk, style) __sctp_style((sk), (SCTP_SOCKET_##style)) diff --git a/include/net/tcp.h b/include/net/tcp.h index f5bac4c9b704..a36011194820 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -196,7 +196,7 @@ struct tcp_tw_bucket { unsigned char tw_rcv_wscale; __u16 tw_sport; /* Socket demultiplex comparisons on incoming packets. */ - /* these five are in inet_opt */ + /* these five are in inet_sock */ __u32 tw_daddr __attribute__((aligned(TCP_ADDRCMP_ALIGN_BYTES))); __u32 tw_rcv_saddr; diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 56872058ebce..31e2097d80d6 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -131,7 +131,7 @@ static spinlock_t inetsw_lock = SPIN_LOCK_UNLOCKED; void inet_sock_destruct(struct sock *sk) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); __skb_queue_purge(&sk->sk_receive_queue); __skb_queue_purge(&sk->sk_error_queue); @@ -173,7 +173,7 @@ void inet_sock_destruct(struct sock *sk) static int inet_autobind(struct sock *sk) { - struct inet_opt *inet; + struct inet_sock *inet; /* We may need to bind the socket. */ lock_sock(sk); inet = inet_sk(sk); @@ -232,7 +232,7 @@ static int inet_create(struct socket *sock, int protocol) struct sock *sk; struct list_head *p; struct inet_protosw *answer; - struct inet_opt *inet; + struct inet_sock *inet; struct proto *answer_prot; unsigned char answer_flags; char answer_no_check; @@ -389,7 +389,7 @@ int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) { struct sockaddr_in *addr = (struct sockaddr_in *)uaddr; struct sock *sk = sock->sk; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); unsigned short snum; int chk_addr_ret; int err; @@ -623,7 +623,7 @@ int inet_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_len, int peer) { struct sock *sk = sock->sk; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct sockaddr_in *sin = (struct sockaddr_in *)uaddr; sin->sin_family = AF_INET; diff --git a/net/ipv4/datagram.c b/net/ipv4/datagram.c index f84e1041d2d9..b1db561f2542 100644 --- a/net/ipv4/datagram.c +++ b/net/ipv4/datagram.c @@ -22,7 +22,7 @@ int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct sockaddr_in *usin = (struct sockaddr_in *) uaddr; struct rtable *rt; u32 saddr; diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index 74089ab9f74e..3d975f2b01b1 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c @@ -377,7 +377,7 @@ static void icmp_push_reply(struct icmp_bxm *icmp_param, static void icmp_reply(struct icmp_bxm *icmp_param, struct sk_buff *skb) { struct sock *sk = icmp_socket->sk; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipcm_cookie ipc; struct rtable *rt = (struct rtable *)skb->dst; u32 daddr; @@ -1097,7 +1097,7 @@ static struct icmp_control icmp_pointers[NR_ICMP_TYPES + 1] = { void __init icmp_init(struct net_proto_family *ops) { - struct inet_opt *inet; + struct inet_sock *inet; int i; for (i = 0; i < NR_CPUS; i++) { diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index fc0c27f25f6a..8aa36e7a5d09 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c @@ -1617,7 +1617,7 @@ int ip_mc_join_group(struct sock *sk , struct ip_mreqn *imr) u32 addr = imr->imr_multiaddr.s_addr; struct ip_mc_socklist *iml, *i; struct in_device *in_dev; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); int count = 0; if (!MULTICAST(addr)) @@ -1691,7 +1691,7 @@ int ip_mc_leave_src(struct sock *sk, struct ip_mc_socklist *iml, int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ip_mc_socklist *iml, **imlp; rtnl_lock(); @@ -1734,7 +1734,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct u32 addr = mreqs->imr_multiaddr; struct ip_mc_socklist *pmc; struct in_device *in_dev = NULL; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ip_sf_socklist *psl; int i, j, rv; @@ -1852,7 +1852,7 @@ int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex) u32 addr = msf->imsf_multiaddr; struct ip_mc_socklist *pmc; struct in_device *in_dev; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ip_sf_socklist *newpsl, *psl; if (!MULTICAST(addr)) @@ -1922,7 +1922,7 @@ int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf, u32 addr = msf->imsf_multiaddr; struct ip_mc_socklist *pmc; struct in_device *in_dev; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ip_sf_socklist *psl; if (!MULTICAST(addr)) @@ -1980,7 +1980,7 @@ int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf, struct sockaddr_in *psin; u32 addr; struct ip_mc_socklist *pmc; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ip_sf_socklist *psl; psin = (struct sockaddr_in *)&gsf->gf_group; @@ -2033,7 +2033,7 @@ done: */ int ip_mc_sf_allow(struct sock *sk, u32 loc_addr, u32 rmt_addr, int dif) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ip_mc_socklist *pmc; struct ip_sf_socklist *psl; int i; @@ -2069,7 +2069,7 @@ int ip_mc_sf_allow(struct sock *sk, u32 loc_addr, u32 rmt_addr, int dif) void ip_mc_drop_socket(struct sock *sk) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ip_mc_socklist *iml; if (inet->mc_list == NULL) diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index d223d1251c1f..74f840473d70 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -115,7 +115,7 @@ static int ip_dev_loopback_xmit(struct sk_buff *newskb) return 0; } -static inline int ip_select_ttl(struct inet_opt *inet, struct dst_entry *dst) +static inline int ip_select_ttl(struct inet_sock *inet, struct dst_entry *dst) { int ttl = inet->uc_ttl; @@ -131,7 +131,7 @@ static inline int ip_select_ttl(struct inet_opt *inet, struct dst_entry *dst) int ip_build_and_send_pkt(struct sk_buff *skb, struct sock *sk, u32 saddr, u32 daddr, struct ip_options *opt) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct rtable *rt = (struct rtable *)skb->dst; struct iphdr *iph; @@ -297,7 +297,7 @@ int ip_output(struct sk_buff *skb) int ip_queue_xmit(struct sk_buff *skb, int ipfragok) { struct sock *sk = skb->sk; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ip_options *opt = inet->opt; struct rtable *rt; struct iphdr *iph; @@ -712,7 +712,7 @@ int ip_append_data(struct sock *sk, struct ipcm_cookie *ipc, struct rtable *rt, unsigned int flags) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct sk_buff *skb; struct ip_options *opt = NULL; @@ -973,7 +973,7 @@ error: ssize_t ip_append_page(struct sock *sk, struct page *page, int offset, size_t size, int flags) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct sk_buff *skb; struct rtable *rt; struct ip_options *opt = NULL; @@ -1112,7 +1112,7 @@ int ip_push_pending_frames(struct sock *sk) { struct sk_buff *skb, *tmp_skb; struct sk_buff **tail_skb; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ip_options *opt = NULL; struct rtable *rt = inet->cork.rt; struct iphdr *iph; @@ -1217,7 +1217,7 @@ error: */ void ip_flush_pending_frames(struct sock *sk) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct sk_buff *skb; while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != NULL) @@ -1260,7 +1260,7 @@ static int ip_reply_glue_bits(void *dptr, char *to, int offset, void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg, unsigned int len) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct { struct ip_options opt; char data[40]; diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index d352252326c1..6fe58d7565fd 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c @@ -112,7 +112,7 @@ void ip_cmsg_recv_retopts(struct msghdr *msg, struct sk_buff *skb) void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb) { - struct inet_opt *inet = inet_sk(skb->sk); + struct inet_sock *inet = inet_sk(skb->sk); unsigned flags = inet->cmsg_flags; /* Ordered by supposed usage frequency */ @@ -234,7 +234,7 @@ int ip_ra_control(struct sock *sk, unsigned char on, void (*destructor)(struct s void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, u16 port, u32 info, u8 *payload) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct sock_exterr_skb *serr; if (!inet->recverr) @@ -263,7 +263,7 @@ void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, void ip_local_error(struct sock *sk, int err, u32 daddr, u16 port, u32 info) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct sock_exterr_skb *serr; struct iphdr *iph; struct sk_buff *skb; @@ -342,7 +342,7 @@ int ip_recv_error(struct sock *sk, struct msghdr *msg, int len) sin = &errhdr.offender; sin->sin_family = AF_UNSPEC; if (serr->ee.ee_origin == SO_EE_ORIGIN_ICMP) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); sin->sin_family = AF_INET; sin->sin_addr.s_addr = skb->nh.iph->saddr; @@ -383,7 +383,7 @@ out: int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, int optlen) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); int val=0,err; if (level != SOL_IP) @@ -875,7 +875,7 @@ e_inval: int ip_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); int val; int len; diff --git a/net/ipv4/ipvs/ip_vs_sync.c b/net/ipv4/ipvs/ip_vs_sync.c index 45ab05a7f4d5..a7389993318c 100644 --- a/net/ipv4/ipvs/ip_vs_sync.c +++ b/net/ipv4/ipvs/ip_vs_sync.c @@ -343,7 +343,7 @@ static void ip_vs_process_message(const char *buffer, const size_t buflen) */ static void set_mcast_loop(struct sock *sk, u_char loop) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); /* setsockopt(sock, SOL_IP, IP_MULTICAST_LOOP, &loop, sizeof(loop)); */ lock_sock(sk); @@ -356,7 +356,7 @@ static void set_mcast_loop(struct sock *sk, u_char loop) */ static void set_mcast_ttl(struct sock *sk, u_char ttl) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); /* setsockopt(sock, SOL_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl)); */ lock_sock(sk); @@ -370,7 +370,7 @@ static void set_mcast_ttl(struct sock *sk, u_char ttl) static int set_mcast_if(struct sock *sk, char *ifname) { struct net_device *dev; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); if ((dev = __dev_get_by_name(ifname)) == NULL) return -ENODEV; diff --git a/net/ipv4/netfilter/ip_conntrack_core.c b/net/ipv4/netfilter/ip_conntrack_core.c index d14a4e342de3..5f859e657576 100644 --- a/net/ipv4/netfilter/ip_conntrack_core.c +++ b/net/ipv4/netfilter/ip_conntrack_core.c @@ -1229,7 +1229,7 @@ ip_ct_selective_cleanup(int (*kill)(const struct ip_conntrack *i, void *data), static int getorigdst(struct sock *sk, int optval, void __user *user, int *len) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ip_conntrack_tuple_hash *h; struct ip_conntrack_tuple tuple; diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index 2c6dd971b10a..92f18ac1de66 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c @@ -109,7 +109,7 @@ struct sock *__raw_v4_lookup(struct sock *sk, unsigned short num, struct hlist_node *node; sk_for_each_from(sk, node) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); if (inet->num == num && !(inet->daddr && inet->daddr != raddr) && @@ -181,7 +181,7 @@ out: void raw_err (struct sock *sk, struct sk_buff *skb, u32 info) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); int type = skb->h.icmph->type; int code = skb->h.icmph->code; int err = 0; @@ -263,7 +263,7 @@ static int raw_send_hdrinc(struct sock *sk, void *from, int length, struct rtable *rt, unsigned int flags) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); int hh_len; struct iphdr *iph; struct sk_buff *skb; @@ -374,7 +374,7 @@ static void raw_probe_proto_opt(struct flowi *fl, struct msghdr *msg) static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t len) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipcm_cookie ipc; struct rtable *rt = NULL; int free = 0; @@ -537,7 +537,7 @@ static void raw_close(struct sock *sk, long timeout) /* This gets rid of all the nasties in af_inet. -DaveM */ static int raw_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct sockaddr_in *addr = (struct sockaddr_in *) uaddr; int ret = -EINVAL; int chk_addr_ret; @@ -565,7 +565,7 @@ out: return ret; int raw_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t len, int noblock, int flags, int *addr_len) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); size_t copied = 0; int err = -EOPNOTSUPP; struct sockaddr_in *sin = (struct sockaddr_in *)msg->msg_name; @@ -802,7 +802,7 @@ static void raw_seq_stop(struct seq_file *seq, void *v) static __inline__ char *get_raw_sock(struct sock *sp, char *tmpbuf, int i) { - struct inet_opt *inet = inet_sk(sp); + struct inet_sock *inet = inet_sk(sp); unsigned int dest = inet->daddr, src = inet->rcv_saddr; __u16 destp = 0, diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 4c10aa8c3b8d..f1bff9647a2b 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -460,7 +460,7 @@ int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg) int tcp_listen_start(struct sock *sk) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct tcp_opt *tp = tcp_sk(sk); struct tcp_listen_opt *lopt; @@ -1772,7 +1772,7 @@ static inline int tcp_need_reset(int state) int tcp_disconnect(struct sock *sk, int flags) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct tcp_opt *tp = tcp_sk(sk); int err = 0; int old_state = sk->sk_state; diff --git a/net/ipv4/tcp_diag.c b/net/ipv4/tcp_diag.c index be78fa284c0d..cbaa439ee83c 100644 --- a/net/ipv4/tcp_diag.c +++ b/net/ipv4/tcp_diag.c @@ -55,7 +55,7 @@ static struct sock *tcpnl; static int tcpdiag_fill(struct sk_buff *skb, struct sock *sk, int ext, u32 pid, u32 seq, u16 nlmsg_flags) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct tcp_opt *tp = tcp_sk(sk); struct tcpdiagmsg *r; struct nlmsghdr *nlh; @@ -427,7 +427,7 @@ static int tcpdiag_dump_sock(struct sk_buff *skb, struct sock *sk, if (cb->nlh->nlmsg_len > 4 + NLMSG_SPACE(sizeof(*r))) { struct tcpdiag_entry entry; struct rtattr *bc = (struct rtattr *)(r + 1); - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); entry.family = sk->sk_family; #ifdef CONFIG_IP_TCPDIAG_IPV6 @@ -458,7 +458,7 @@ static int tcpdiag_fill_req(struct sk_buff *skb, struct sock *sk, struct open_request *req, u32 pid, u32 seq) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); unsigned char *b = skb->tail; struct tcpdiagmsg *r; struct nlmsghdr *nlh; @@ -515,7 +515,7 @@ static int tcpdiag_dump_reqs(struct sk_buff *skb, struct sock *sk, struct tcp_opt *tp = tcp_sk(sk); struct tcp_listen_opt *lopt; struct rtattr *bc = NULL; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); int j, s_j; int reqnum, s_reqnum; int err = 0; @@ -609,7 +609,7 @@ static int tcpdiag_dump(struct sk_buff *skb, struct netlink_callback *cb) num = 0; sk_for_each(sk, node, &tcp_listening_hash[i]) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); if (num < s_num) { num++; @@ -670,7 +670,7 @@ skip_listen_ht: num = 0; sk_for_each(sk, node, &head->chain) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); if (num < s_num) goto next_normal; @@ -692,7 +692,7 @@ next_normal: if (r->tcpdiag_states&TCPF_TIME_WAIT) { sk_for_each(sk, node, &tcp_ehash[i + tcp_ehash_size].chain) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); if (num < s_num) goto next_dying; diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index a0f598569886..3183e2913faa 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -1647,7 +1647,7 @@ static __inline__ int tcp_packet_delayed(struct tcp_opt *tp) #if FASTRETRANS_DEBUG > 1 static void DBGUNDO(struct sock *sk, struct tcp_opt *tp, const char *msg) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); printk(KERN_DEBUG "Undo %s %u.%u.%u.%u/%u c%u l%u ss%u/%u p%u\n", msg, NIPQUAD(inet->daddr), ntohs(inet->dport), diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 3062579ef720..6c5b44af65b2 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -115,7 +115,7 @@ static __inline__ int tcp_hashfn(__u32 laddr, __u16 lport, static __inline__ int tcp_sk_hashfn(struct sock *sk) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); __u32 laddr = inet->rcv_saddr; __u16 lport = inet->num; __u32 faddr = inet->daddr; @@ -300,7 +300,7 @@ fail: */ static void __tcp_put_port(struct sock *sk) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct tcp_bind_hashbucket *head = &tcp_bhash[tcp_bhashfn(inet->num)]; struct tcp_bind_bucket *tb; @@ -420,7 +420,7 @@ static struct sock *__tcp_v4_lookup_listener(struct hlist_head *head, u32 daddr, hiscore=-1; sk_for_each(sk, node, head) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); if (inet->num == hnum && !ipv6_only_sock(sk)) { __u32 rcv_saddr = inet->rcv_saddr; @@ -457,7 +457,7 @@ static inline struct sock *tcp_v4_lookup_listener(u32 daddr, read_lock(&tcp_lhash_lock); head = &tcp_listening_hash[tcp_lhashfn(hnum)]; if (!hlist_empty(head)) { - struct inet_opt *inet = inet_sk((sk = __sk_head(head))); + struct inet_sock *inet = inet_sk((sk = __sk_head(head))); if (inet->num == hnum && !sk->sk_node.next && (!inet->rcv_saddr || inet->rcv_saddr == daddr) && @@ -549,7 +549,7 @@ static inline __u32 tcp_v4_init_sequence(struct sock *sk, struct sk_buff *skb) static int __tcp_v4_check_established(struct sock *sk, __u16 lport, struct tcp_tw_bucket **twp) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); u32 daddr = inet->rcv_saddr; u32 saddr = inet->daddr; int dif = sk->sk_bound_dev_if; @@ -638,7 +638,7 @@ not_unique: static inline u32 connect_port_offset(const struct sock *sk) { - const struct inet_opt *inet = inet_sk(sk); + const struct inet_sock *inet = inet_sk(sk); return secure_tcp_port_ephemeral(inet->rcv_saddr, inet->daddr, inet->dport); @@ -743,7 +743,7 @@ out: /* This will initiate an outgoing connection. */ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct tcp_opt *tp = tcp_sk(sk); struct sockaddr_in *usin = (struct sockaddr_in *)uaddr; struct rtable *rt; @@ -917,7 +917,7 @@ static inline void do_pmtu_discovery(struct sock *sk, struct iphdr *iph, u32 mtu) { struct dst_entry *dst; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct tcp_opt *tp = tcp_sk(sk); /* We are not interested in TCP_LISTEN and open_requests (SYN-ACKs @@ -980,7 +980,7 @@ void tcp_v4_err(struct sk_buff *skb, u32 info) struct iphdr *iph = (struct iphdr *)skb->data; struct tcphdr *th = (struct tcphdr *)(skb->data + (iph->ihl << 2)); struct tcp_opt *tp; - struct inet_opt *inet; + struct inet_sock *inet; int type = skb->h.icmph->type; int code = skb->h.icmph->code; struct sock *sk; @@ -1127,7 +1127,7 @@ out: void tcp_v4_send_check(struct sock *sk, struct tcphdr *th, int len, struct sk_buff *skb) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); if (skb->ip_summed == CHECKSUM_HW) { th->check = ~tcp_v4_check(th, len, inet->saddr, inet->daddr, 0); @@ -1549,7 +1549,7 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb, struct open_request *req, struct dst_entry *dst) { - struct inet_opt *newinet; + struct inet_sock *newinet; struct tcp_opt *newtp; struct sock *newsk; @@ -1856,7 +1856,7 @@ static void __tcp_v4_rehash(struct sock *sk) static int tcp_v4_reselect_saddr(struct sock *sk) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); int err; struct rtable *rt; __u32 old_saddr = inet->saddr; @@ -1907,7 +1907,7 @@ static int tcp_v4_reselect_saddr(struct sock *sk) int tcp_v4_rebuild_header(struct sock *sk) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct rtable *rt = (struct rtable *)__sk_dst_check(sk, 0); u32 daddr; int err; @@ -1956,7 +1956,7 @@ int tcp_v4_rebuild_header(struct sock *sk) static void v4_addr2sockaddr(struct sock *sk, struct sockaddr * uaddr) { struct sockaddr_in *sin = (struct sockaddr_in *) uaddr; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); sin->sin_family = AF_INET; sin->sin_addr.s_addr = inet->daddr; @@ -1971,7 +1971,7 @@ static void v4_addr2sockaddr(struct sock *sk, struct sockaddr * uaddr) int tcp_v4_remember_stamp(struct sock *sk) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct tcp_opt *tp = tcp_sk(sk); struct rtable *rt = (struct rtable *)__sk_dst_get(sk); struct inet_peer *peer = NULL; @@ -2474,7 +2474,7 @@ static void get_tcp4_sock(struct sock *sp, char *tmpbuf, int i) int timer_active; unsigned long timer_expires; struct tcp_opt *tp = tcp_sk(sp); - struct inet_opt *inet = inet_sk(sp); + struct inet_sock *inet = inet_sk(sp); unsigned int dest = inet->daddr; unsigned int src = inet->rcv_saddr; __u16 destp = ntohs(inet->dport); diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index d5b6ea321305..5e431bcf1d86 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -337,7 +337,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo) tw = kmem_cache_alloc(tcp_timewait_cachep, SLAB_ATOMIC); if(tw != NULL) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); int rto = (tp->rto<<2) - (tp->rto>>1); /* Give us an identity. */ diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 0b08a3499b29..6c6fcf22bf79 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -266,7 +266,7 @@ static __inline__ u16 tcp_select_window(struct sock *sk) static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb) { if (skb != NULL) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct tcp_opt *tp = tcp_sk(sk); struct tcp_skb_cb *tcb = TCP_SKB_CB(skb); int tcp_header_size = tp->tcp_header_len; diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index 3b4d82176a84..28888af7dcf0 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c @@ -332,7 +332,7 @@ static void tcp_retransmit_timer(struct sock *sk) */ #ifdef TCP_DEBUG if (net_ratelimit()) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); printk(KERN_DEBUG "TCP: Treason uncloaked! Peer %u.%u.%u.%u:%u/%u shrinks window %u:%u. Repaired.\n", NIPQUAD(inet->daddr), htons(inet->dport), inet->num, tp->snd_una, tp->snd_nxt); diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 4a1bfb39c4b0..398214e53ad5 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -124,7 +124,7 @@ static int udp_v4_get_port(struct sock *sk, unsigned short snum) { struct hlist_node *node; struct sock *sk2; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); write_lock_bh(&udp_hash_lock); if (snum == 0) { @@ -171,7 +171,7 @@ gotit: } else { sk_for_each(sk2, node, &udp_hash[snum & (UDP_HTABLE_SIZE - 1)]) { - struct inet_opt *inet2 = inet_sk(sk2); + struct inet_sock *inet2 = inet_sk(sk2); if (inet2->num == snum && sk2 != sk && @@ -227,7 +227,7 @@ struct sock *udp_v4_lookup_longway(u32 saddr, u16 sport, u32 daddr, u16 dport, i int badness = -1; sk_for_each(sk, node, &udp_hash[hnum & (UDP_HTABLE_SIZE - 1)]) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); if (inet->num == hnum && !ipv6_only_sock(sk)) { int score = (sk->sk_family == PF_INET ? 1 : 0); @@ -285,7 +285,7 @@ static inline struct sock *udp_v4_mcast_next(struct sock *sk, unsigned short hnum = ntohs(loc_port); sk_for_each_from(s, node) { - struct inet_opt *inet = inet_sk(s); + struct inet_sock *inet = inet_sk(s); if (inet->num != hnum || (inet->daddr && inet->daddr != rmt_addr) || @@ -316,7 +316,7 @@ found: void udp_err(struct sk_buff *skb, u32 info) { - struct inet_opt *inet; + struct inet_sock *inet; struct iphdr *iph = (struct iphdr*)skb->data; struct udphdr *uh = (struct udphdr*)(skb->data+(iph->ihl<<2)); int type = skb->h.icmph->type; @@ -398,7 +398,7 @@ static void udp_flush_pending_frames(struct sock *sk) */ static int udp_push_pending_frames(struct sock *sk, struct udp_opt *up) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct flowi *fl = &inet->cork.fl; struct sk_buff *skb; struct udphdr *uh; @@ -480,7 +480,7 @@ static unsigned short udp_check(struct udphdr *uh, int len, unsigned long saddr, int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t len) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct udp_opt *up = udp_sk(sk); int ulen = len; struct ipcm_cookie ipc; @@ -773,7 +773,7 @@ static __inline__ int udp_checksum_complete(struct sk_buff *skb) int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t len, int noblock, int flags, int *addr_len) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct sockaddr_in *sin = (struct sockaddr_in *)msg->msg_name; struct sk_buff *skb; int copied, err; @@ -864,7 +864,7 @@ csum_copy_err: int udp_disconnect(struct sock *sk, int flags) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); /* * 1003.1g - break association. */ @@ -1503,7 +1503,7 @@ void udp_proc_unregister(struct udp_seq_afinfo *afinfo) /* ------------------------------------------------------------------------ */ static void udp4_format_sock(struct sock *sp, char *tmpbuf, int bucket) { - struct inet_opt *inet = inet_sk(sp); + struct inet_sock *inet = inet_sk(sp); unsigned int dest = inet->daddr; unsigned int src = inet->rcv_saddr; __u16 destp = ntohs(inet->dport); diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index fac7d9cdf238..5ca3af45cfeb 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c @@ -114,10 +114,9 @@ static __inline__ struct ipv6_pinfo *inet6_sk_generic(struct sock *sk) static int inet6_create(struct socket *sock, int protocol) { - struct inet_opt *inet; + struct inet_sock *inet; struct ipv6_pinfo *np; struct sock *sk; - struct tcp6_sock* tcp6sk; struct list_head *p; struct inet_protosw *answer; struct proto *answer_prot; @@ -196,8 +195,7 @@ static int inet6_create(struct socket *sock, int protocol) sk->sk_backlog_rcv = answer->prot->backlog_rcv; - tcp6sk = (struct tcp6_sock *)sk; - tcp6sk->pinet6 = np = inet6_sk_generic(sk); + inet_sk(sk)->pinet6 = np = inet6_sk_generic(sk); np->hop_limit = -1; np->mcast_hops = -1; np->mc_loop = 1; @@ -252,7 +250,7 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) { struct sockaddr_in6 *addr=(struct sockaddr_in6 *)uaddr; struct sock *sk = sock->sk; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); __u32 v4addr = 0; unsigned short snum; @@ -410,7 +408,7 @@ int inet6_getname(struct socket *sock, struct sockaddr *uaddr, { struct sockaddr_in6 *sin=(struct sockaddr_in6 *)uaddr; struct sock *sk = sock->sk; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); sin->sin6_family = AF_INET6; diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c index b077cd19f576..65b9375df57d 100644 --- a/net/ipv6/datagram.c +++ b/net/ipv6/datagram.c @@ -36,7 +36,7 @@ int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) { struct sockaddr_in6 *usin = (struct sockaddr_in6 *) uaddr; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct in6_addr *daddr, *final_p = NULL, final; struct dst_entry *dst; @@ -335,7 +335,7 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len) if (ipv6_addr_type(&sin->sin6_addr) & IPV6_ADDR_LINKLOCAL) sin->sin6_scope_id = IP6CB(skb)->iif; } else { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); ipv6_addr_set(&sin->sin6_addr, 0, 0, htonl(0xffff), diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 96e2925f4661..aec81a63b126 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c @@ -809,7 +809,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, int offse int hlimit, struct ipv6_txoptions *opt, struct flowi *fl, struct rt6_info *rt, unsigned int flags) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct sk_buff *skb; unsigned int maxfraglen, fragheaderlen; @@ -1087,7 +1087,7 @@ int ip6_push_pending_frames(struct sock *sk) struct sk_buff *skb, *tmp_skb; struct sk_buff **tail_skb; struct in6_addr final_dst_buf, *final_dst = &final_dst_buf; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct ipv6hdr *hdr; struct ipv6_txoptions *opt = np->cork.opt; @@ -1165,7 +1165,7 @@ error: void ip6_flush_pending_frames(struct sock *sk) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct sk_buff *skb; diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index 1e7ed8dcf1cb..0f28463ac350 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c @@ -178,7 +178,7 @@ out: /* This cleans up af_inet6 a bit. -DaveM */ static int rawv6_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct sockaddr_in6 *addr = (struct sockaddr_in6 *) uaddr; __u32 v4addr = 0; @@ -253,7 +253,7 @@ void rawv6_err(struct sock *sk, struct sk_buff *skb, struct inet6_skb_parm *opt, int type, int code, int offset, u32 info) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); int err; int harderr; @@ -314,7 +314,7 @@ static inline int rawv6_rcv_skb(struct sock * sk, struct sk_buff * skb) */ int rawv6_rcv(struct sock *sk, struct sk_buff *skb) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct raw6_opt *raw_opt = raw6_sk(sk); if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb)) { @@ -505,7 +505,7 @@ static int rawv6_send_hdrinc(struct sock *sk, void *from, int length, struct flowi *fl, struct rt6_info *rt, unsigned int flags) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6hdr *iph; struct sk_buff *skb; unsigned int hh_len; @@ -607,7 +607,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk, struct ipv6_txoptions opt_space; struct sockaddr_in6 * sin6 = (struct sockaddr_in6 *) msg->msg_name; struct in6_addr *daddr, *final_p = NULL, final; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct raw6_opt *raw_opt = raw6_sk(sk); struct ipv6_txoptions *opt = NULL; diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 0ae13d6b19db..97fe88e10597 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -89,7 +89,7 @@ static __inline__ int tcp_v6_hashfn(struct in6_addr *laddr, u16 lport, static __inline__ int tcp_v6_sk_hashfn(struct sock *sk) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct in6_addr *laddr = &np->rcv_saddr; struct in6_addr *faddr = &np->daddr; @@ -443,7 +443,7 @@ static __u32 tcp_v6_init_sequence(struct sock *sk, struct sk_buff *skb) static int tcp_v6_check_established(struct sock *sk) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct in6_addr *daddr = &np->rcv_saddr; struct in6_addr *saddr = &np->daddr; @@ -549,7 +549,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) { struct sockaddr_in6 *usin = (struct sockaddr_in6 *) uaddr; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct tcp_opt *tp = tcp_sk(sk); struct in6_addr *saddr = NULL, *final_p = NULL, final; @@ -785,7 +785,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, dst = __sk_dst_check(sk, np->dst_cookie); if (dst == NULL) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct flowi fl; /* BUGGG_FUTURE: Again, it is not clear how @@ -1281,7 +1281,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, { struct ipv6_pinfo *newnp, *np = inet6_sk(sk); struct tcp6_sock *newtcp6sk; - struct inet_opt *newinet; + struct inet_sock *newinet; struct tcp_opt *newtp; struct sock *newsk; struct ipv6_txoptions *opt; @@ -1297,7 +1297,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, return NULL; newtcp6sk = (struct tcp6_sock *)newsk; - newtcp6sk->pinet6 = &newtcp6sk->inet6; + newtcp6sk->inet.pinet6 = &newtcp6sk->inet6; newinet = inet_sk(newsk); newnp = inet6_sk(newsk); @@ -1390,7 +1390,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, ~(NETIF_F_IP_CSUM | NETIF_F_TSO); newtcp6sk = (struct tcp6_sock *)newsk; - newtcp6sk->pinet6 = &newtcp6sk->inet6; + newtcp6sk->inet.pinet6 = &newtcp6sk->inet6; newtp = tcp_sk(newsk); newinet = inet_sk(newsk); @@ -1754,7 +1754,7 @@ static int tcp_v6_rebuild_header(struct sock *sk) dst = __sk_dst_check(sk, np->dst_cookie); if (dst == NULL) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct in6_addr *final_p = NULL, final; struct flowi fl; @@ -1800,7 +1800,7 @@ static int tcp_v6_rebuild_header(struct sock *sk) static int tcp_v6_xmit(struct sk_buff *skb, int ipfragok) { struct sock *sk = skb->sk; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct flowi fl; struct dst_entry *dst; @@ -2006,7 +2006,7 @@ static void get_tcp6_sock(struct seq_file *seq, struct sock *sp, int i) __u16 destp, srcp; int timer_active; unsigned long timer_expires; - struct inet_opt *inet = inet_sk(sp); + struct inet_sock *inet = inet_sk(sp); struct tcp_opt *tp = tcp_sk(sp); struct ipv6_pinfo *np = inet6_sk(sp); diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index dc0bbfb4c1c9..019318679817 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -160,7 +160,7 @@ static struct sock *udp_v6_lookup(struct in6_addr *saddr, u16 sport, read_lock(&udp_hash_lock); sk_for_each(sk, node, &udp_hash[hnum & (UDP_HTABLE_SIZE - 1)]) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); if (inet->num == hnum && sk->sk_family == PF_INET6) { struct ipv6_pinfo *np = inet6_sk(sk); @@ -269,7 +269,7 @@ try_again: sin6->sin6_scope_id = 0; if (skb->protocol == htons(ETH_P_IP)) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); ipv6_addr_set(&sin6->sin6_addr, 0, 0, htonl(0xffff), skb->nh.iph->saddr); @@ -386,7 +386,7 @@ static struct sock *udp_v6_mcast_next(struct sock *sk, unsigned short num = ntohs(loc_port); sk_for_each_from(s, node) { - struct inet_opt *inet = inet_sk(s); + struct inet_sock *inet = inet_sk(s); if (inet->num == num && s->sk_family == PF_INET6) { struct ipv6_pinfo *np = inet6_sk(s); @@ -566,7 +566,7 @@ static int udp_v6_push_pending_frames(struct sock *sk, struct udp_opt *up) { struct sk_buff *skb; struct udphdr *uh; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct flowi *fl = &inet->cork.fl; int err = 0; @@ -624,7 +624,7 @@ static int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk, { struct ipv6_txoptions opt_space; struct udp_opt *up = udp_sk(sk); - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) msg->msg_name; struct in6_addr *daddr, *final_p = NULL, final; @@ -970,7 +970,7 @@ static struct inet6_protocol udpv6_protocol = { static void udp6_sock_seq_show(struct seq_file *seq, struct sock *sp, int bucket) { - struct inet_opt *inet = inet_sk(sp); + struct inet_sock *inet = inet_sk(sp); struct ipv6_pinfo *np = inet6_sk(sp); struct in6_addr *dest, *src; __u16 destp, srcp; diff --git a/net/sctp/input.c b/net/sctp/input.c index 0268f75c41e5..cab833371a54 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c @@ -393,7 +393,7 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info) struct sctp_endpoint *ep; struct sctp_association *asoc; struct sctp_transport *transport; - struct inet_opt *inet; + struct inet_sock *inet; char *saveip, *savesctp; int err; diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c index f657c4deedd9..e142681824ca 100644 --- a/net/sctp/ipv6.c +++ b/net/sctp/ipv6.c @@ -580,9 +580,9 @@ static sctp_scope_t sctp_v6_scope(union sctp_addr *addr) struct sock *sctp_v6_create_accept_sk(struct sock *sk, struct sctp_association *asoc) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct sock *newsk; - struct inet_opt *newinet; + struct inet_sock *newinet; struct ipv6_pinfo *newnp, *np = inet6_sk(sk); struct sctp6_sock *newsctp6sk; @@ -608,7 +608,7 @@ struct sock *sctp_v6_create_accept_sk(struct sock *sk, newsk->sk_shutdown = sk->sk_shutdown; newsctp6sk = (struct sctp6_sock *)newsk; - newsctp6sk->pinet6 = &newsctp6sk->inet6; + newsctp6sk->inet.pinet6 = &newsctp6sk->inet6; newinet = inet_sk(newsk); newnp = inet6_sk(newsk); diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 1f693e954621..a8a3f3d37efc 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c @@ -551,8 +551,8 @@ struct sock *sctp_v4_create_accept_sk(struct sock *sk, struct sctp_association *asoc) { struct sock *newsk; - struct inet_opt *inet = inet_sk(sk); - struct inet_opt *newinet; + struct inet_sock *inet = inet_sk(sk); + struct inet_sock *newinet; newsk = sk_alloc(PF_INET, GFP_KERNEL, sk->sk_prot->slab_obj_size, sk->sk_prot->slab); diff --git a/security/selinux/avc.c b/security/selinux/avc.c index 7afe09eed6ac..49af7bd9e40b 100644 --- a/security/selinux/avc.c +++ b/security/selinux/avc.c @@ -566,7 +566,7 @@ void avc_audit(u32 ssid, u32 tsid, switch (sk->sk_family) { case AF_INET: { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); avc_print_ipv4_addr(ab, inet->rcv_saddr, inet->sport, @@ -577,7 +577,7 @@ void avc_audit(u32 ssid, u32 tsid, break; } case AF_INET6: { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *inet6 = inet6_sk(sk); avc_print_ipv6_addr(ab, &inet6->rcv_saddr, -- cgit v1.2.3 From 93f178381849e4fc519d1d26b76d4483500ad369 Mon Sep 17 00:00:00 2001 From: Roland Dreier Date: Mon, 27 Dec 2004 06:18:50 -0800 Subject: [INFINIBAND]: IPoIB IPv4 multicast Add ip_ib_mc_map() to convert IPv4 multicast addresses to IPoIB hardware addresses. Also add so INFINIBAND_ALEN has a home. The mapping for multicast addresses is described in http://www.ietf.org/internet-drafts/draft-ietf-ipoib-ip-over-infiniband-08.txt Signed-off-by: Roland Dreier Signed-off-by: David S. Miller --- include/linux/if_infiniband.h | 29 +++++++++++++++++++++++++++++ include/net/ip.h | 33 +++++++++++++++++++++++++++++++++ net/ipv4/arp.c | 3 +++ 3 files changed, 65 insertions(+) create mode 100644 include/linux/if_infiniband.h (limited to 'include/linux') diff --git a/include/linux/if_infiniband.h b/include/linux/if_infiniband.h new file mode 100644 index 000000000000..3e659ec7dfdd --- /dev/null +++ b/include/linux/if_infiniband.h @@ -0,0 +1,29 @@ +/* + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available at + * , or the OpenIB.org BSD + * license, available in the LICENSE.TXT file accompanying this + * software. These details are also available at + * . + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Copyright (c) 2004 Topspin Communications. All rights reserved. + * + * $Id$ + */ + +#ifndef _LINUX_IF_INFINIBAND_H +#define _LINUX_IF_INFINIBAND_H + +#define INFINIBAND_ALEN 20 /* Octets in IPoIB HW addr */ + +#endif /* _LINUX_IF_INFINIBAND_H */ diff --git a/include/net/ip.h b/include/net/ip.h index 15a1c6a2e534..8dd01f2e84f6 100644 --- a/include/net/ip.h +++ b/include/net/ip.h @@ -229,6 +229,39 @@ static inline void ip_eth_mc_map(u32 addr, char *buf) buf[3]=addr&0x7F; } +/* + * Map a multicast IP onto multicast MAC for type IP-over-InfiniBand. + * Leave P_Key as 0 to be filled in by driver. + */ + +static inline void ip_ib_mc_map(u32 addr, char *buf) +{ + buf[0] = 0; /* Reserved */ + buf[1] = 0xff; /* Multicast QPN */ + buf[2] = 0xff; + buf[3] = 0xff; + addr = ntohl(addr); + buf[4] = 0xff; + buf[5] = 0x12; /* link local scope */ + buf[6] = 0x40; /* IPv4 signature */ + buf[7] = 0x1b; + buf[8] = 0; /* P_Key */ + buf[9] = 0; + buf[10] = 0; + buf[11] = 0; + buf[12] = 0; + buf[13] = 0; + buf[14] = 0; + buf[15] = 0; + buf[19] = addr & 0xff; + addr >>= 8; + buf[18] = addr & 0xff; + addr >>= 8; + buf[17] = addr & 0xff; + addr >>= 8; + buf[16] = addr & 0x0f; +} + #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) #include #endif diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 9b5d1e813652..734cc2f30e94 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c @@ -213,6 +213,9 @@ int arp_mc_map(u32 addr, u8 *haddr, struct net_device *dev, int dir) case ARPHRD_IEEE802_TR: ip_tr_mc_map(addr, haddr); return 0; + case ARPHRD_INFINIBAND: + ip_ib_mc_map(addr, haddr); + return 0; default: if (dir) { memcpy(haddr, dev->broadcast, dev->addr_len); -- cgit v1.2.3