From 5c1ee973226ac9cc1183f3a47e86903b14cae564 Mon Sep 17 00:00:00 2001 From: Yasuyuki Kozakai Date: Tue, 19 Oct 2004 06:13:27 +0200 Subject: [NETFILTER]: prearation of removing skb_linearize() This patch uses skb_header_pointer() so that packets can be parsed even though skb_linearize() doesn't exist. But this patch doesn't remove skb_linearize() yet. We can remove it after changing all match/target modules. Moreover ... - I deleted the optimization not to parse IPv6 extension header many time from previous patch. I'll send the patch to do this separately. - fixed the bug that "offset" argument of match functions are always 0. - deleted "hdr" and "datalen" argument and added "protoff" argument to match functions. "protoff" means the offset to Layer 4 protocol header. - the argument order of target function is changed likely IPv4 modules. This prevents user from meeting kernel panic when they use old match modules. - changed {tcp,udp,icmp6}_match(). These functions became very similar to codes in ip_tables.c again. Signed-off-by: Yasuyuki KOZAKAI Signed-off-by: Patrick McHardy --- include/linux/netfilter_ipv6/ip6_tables.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'include/linux') diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h index 6f70cf3df39a..d6ac08c14dc1 100644 --- a/include/linux/netfilter_ipv6/ip6_tables.h +++ b/include/linux/netfilter_ipv6/ip6_tables.h @@ -355,13 +355,15 @@ struct ip6t_match /* Return true or false: return FALSE and set *hotdrop = 1 to force immediate packet drop. */ + /* Arguments changed since 2.6.9, as this must now handle + non-linear skb, using skb_header_pointer and + skb_ip_make_writable. */ int (*match)(const struct sk_buff *skb, const struct net_device *in, const struct net_device *out, const void *matchinfo, int offset, - const void *hdr, - u_int16_t datalen, + unsigned int protoff, int *hotdrop); /* Called when user tries to insert an entry of this type. */ @@ -386,11 +388,13 @@ struct ip6t_target const char name[IP6T_FUNCTION_MAXNAMELEN]; - /* Returns verdict. */ + /* Returns verdict. Argument order changed since 2.6.9, as this + must now handle non-linear skbs, using skb_copy_bits and + skb_ip_make_writable. */ unsigned int (*target)(struct sk_buff **pskb, - unsigned int hooknum, const struct net_device *in, const struct net_device *out, + unsigned int hooknum, const void *targinfo, void *userdata); -- cgit v1.2.3 From ac49b054e7f7d4d3141f5975b72b386ae04c5c46 Mon Sep 17 00:00:00 2001 From: Sridhar Samudrala Date: Thu, 21 Oct 2004 01:21:31 -0700 Subject: [SCTP] Adaption layer indication support. Add support for SCTP_ADAPTION_INDICATION notification, SCTP_ADAPTION_LAYER socket option and SCTP_PARAM_ADAPTION_LAYER_IND parameter. Signed-off-by: Sridhar Samudrala --- include/linux/sctp.h | 6 ++++- include/net/sctp/structs.h | 6 +++++ include/net/sctp/ulpevent.h | 3 +++ net/sctp/sm_make_chunk.c | 23 ++++++++++++++++++ net/sctp/sm_statefuns.c | 59 +++++++++++++++++++++++++++++++++++++++++++++ net/sctp/socket.c | 47 ++++++++++++++++++++++++++++++++++++ net/sctp/ulpevent.c | 38 +++++++++++++++++++++++++++-- 7 files changed, 179 insertions(+), 3 deletions(-) (limited to 'include/linux') diff --git a/include/linux/sctp.h b/include/linux/sctp.h index cff28345eacf..1ed3da0cb9d0 100644 --- a/include/linux/sctp.h +++ b/include/linux/sctp.h @@ -281,7 +281,11 @@ typedef struct sctp_ecn_capable_param { sctp_paramhdr_t param_hdr; } __attribute__((packed)) sctp_ecn_capable_param_t; - +/* ADDIP Section 3.2.6 Adaption Layer Indication */ +typedef struct sctp_adaption_ind_param { + struct sctp_paramhdr param_hdr; + __u32 adaption_ind; +} __attribute__((packed)) sctp_adaption_ind_param_t; /* RFC 2960. Section 3.3.3 Initiation Acknowledgement (INIT ACK) (2): * The INIT ACK chunk is used to acknowledge the initiation of an SCTP diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 26c97aa3a3c7..3bd04bc5b002 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h @@ -266,6 +266,7 @@ struct sctp_opt { __u8 disable_fragments; __u8 pd_mode; __u8 v4mapped; + __u32 adaption_ind; /* Receive to here while partial delivery is in effect. */ struct sk_buff_head pd_lobby; @@ -323,6 +324,8 @@ struct sctp_cookie { __u8 prsctp_capable; + __u32 adaption_ind; + /* This is a shim for my peer's INIT packet, followed by * a copy of the raw address list of the association. * The length of the raw address list is saved in the @@ -362,6 +365,7 @@ union sctp_params { struct sctp_ipv4addr_param *v4; struct sctp_ipv6addr_param *v6; union sctp_addr_param *addr; + struct sctp_adaption_ind_param *aind; }; /* RFC 2960. Section 3.3.5 Heartbeat. @@ -1395,6 +1399,8 @@ struct sctp_association { __u8 asconf_capable; /* Does peer support ADDIP? */ __u8 prsctp_capable; /* Can peer do PR-SCTP? */ + __u32 adaption_ind; /* Adaption Code point. */ + /* This mask is used to disable sending the ASCONF chunk * with specified parameter to peer. */ diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h index ff9c7573063c..46a974464a84 100644 --- a/include/net/sctp/ulpevent.h +++ b/include/net/sctp/ulpevent.h @@ -121,6 +121,9 @@ struct sctp_ulpevent *sctp_ulpevent_make_pdapi( const struct sctp_association *asoc, __u32 indication, int gfp); +struct sctp_ulpevent *sctp_ulpevent_make_adaption_indication( + const struct sctp_association *asoc, int gfp); + struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc, struct sctp_chunk *chunk, int gfp); diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index c2ca732595fa..b698d67bd27c 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c @@ -171,6 +171,7 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc, struct sctp_opt *sp; sctp_supported_addrs_param_t sat; __u16 types[2]; + sctp_adaption_ind_param_t aiparam; /* RFC 2960 3.3.2 Initiation (INIT) (1) * @@ -196,6 +197,7 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc, chunksize += sizeof(ecap_param); if (sctp_prsctp_enable) chunksize += sizeof(prsctp_param); + chunksize += sizeof(aiparam); chunksize += vparam_len; /* RFC 2960 3.3.2 Initiation (INIT) (1) @@ -234,6 +236,10 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc, sctp_addto_chunk(retval, sizeof(ecap_param), &ecap_param); if (sctp_prsctp_enable) sctp_addto_chunk(retval, sizeof(prsctp_param), &prsctp_param); + aiparam.param_hdr.type = SCTP_PARAM_ADAPTION_LAYER_IND; + aiparam.param_hdr.length = htons(sizeof(aiparam)); + aiparam.adaption_ind = htonl(sp->adaption_ind); + sctp_addto_chunk(retval, sizeof(aiparam), &aiparam); nodata: if (addrs.v) kfree(addrs.v); @@ -251,6 +257,7 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc, sctp_cookie_param_t *cookie; int cookie_len; size_t chunksize; + sctp_adaption_ind_param_t aiparam; retval = NULL; @@ -284,6 +291,8 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc, if (asoc->peer.prsctp_capable) chunksize += sizeof(prsctp_param); + chunksize += sizeof(aiparam); + /* Now allocate and fill out the chunk. */ retval = sctp_make_chunk(asoc, SCTP_CID_INIT_ACK, 0, chunksize); if (!retval) @@ -302,6 +311,11 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc, if (asoc->peer.prsctp_capable) sctp_addto_chunk(retval, sizeof(prsctp_param), &prsctp_param); + aiparam.param_hdr.type = SCTP_PARAM_ADAPTION_LAYER_IND; + aiparam.param_hdr.length = htons(sizeof(aiparam)); + aiparam.adaption_ind = htonl(sctp_sk(asoc->base.sk)->adaption_ind); + sctp_addto_chunk(retval, sizeof(aiparam), &aiparam); + /* We need to remove the const qualifier at this point. */ retval->asoc = (struct sctp_association *) asoc; @@ -1297,6 +1311,9 @@ sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep, /* Remember PR-SCTP capability. */ cookie->c.prsctp_capable = asoc->peer.prsctp_capable; + /* Save adaption indication in the cookie. */ + cookie->c.adaption_ind = asoc->peer.adaption_ind; + /* Set an expiration time for the cookie. */ do_gettimeofday(&cookie->c.expiration); TIMEVAL_ADD(asoc->cookie_life, cookie->c.expiration); @@ -1455,6 +1472,7 @@ no_hmac: retval->addip_serial = retval->c.initial_tsn; retval->adv_peer_ack_point = retval->ctsn_ack_point; retval->peer.prsctp_capable = retval->c.prsctp_capable; + retval->peer.adaption_ind = retval->c.adaption_ind; /* The INIT stuff will be done by the side effects. */ return retval; @@ -1661,6 +1679,7 @@ static int sctp_verify_param(const struct sctp_association *asoc, case SCTP_PARAM_HEARTBEAT_INFO: case SCTP_PARAM_UNRECOGNIZED_PARAMETERS: case SCTP_PARAM_ECN_CAPABLE: + case SCTP_PARAM_ADAPTION_LAYER_IND: break; case SCTP_PARAM_HOST_NAME_ADDRESS: @@ -1989,6 +2008,10 @@ int sctp_process_param(struct sctp_association *asoc, union sctp_params param, asoc->peer.ecn_capable = 1; break; + case SCTP_PARAM_ADAPTION_LAYER_IND: + asoc->peer.adaption_ind = param.aind->adaption_ind; + break; + case SCTP_PARAM_FWD_TSN_SUPPORT: if (sctp_prsctp_enable) { asoc->peer.prsctp_capable = 1; diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index addb95d790cd..7871faa08378 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c @@ -629,6 +629,21 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(const struct sctp_endpoint *ep, sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, SCTP_ULPEVENT(ev)); + /* Sockets API Draft Section 5.3.1.6 + * When a peer sends a Adaption Layer Indication parameter , SCTP + * delivers this notification to inform the application that of the + * peers requested adaption layer. + */ + if (new_asoc->peer.adaption_ind) { + ev = sctp_ulpevent_make_adaption_indication(new_asoc, + GFP_ATOMIC); + if (!ev) + goto nomem_ev; + + sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, + SCTP_ULPEVENT(ev)); + } + return SCTP_DISPOSITION_CONSUME; nomem_ev: @@ -713,6 +728,20 @@ sctp_disposition_t sctp_sf_do_5_1E_ca(const struct sctp_endpoint *ep, sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, SCTP_ULPEVENT(ev)); + /* Sockets API Draft Section 5.3.1.6 + * When a peer sends a Adaption Layer Indication parameter , SCTP + * delivers this notification to inform the application that of the + * peers requested adaption layer. + */ + if (asoc->peer.adaption_ind) { + ev = sctp_ulpevent_make_adaption_indication(asoc, GFP_ATOMIC); + if (!ev) + goto nomem; + + sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, + SCTP_ULPEVENT(ev)); + } + return SCTP_DISPOSITION_CONSUME; nomem: return SCTP_DISPOSITION_NOMEM; @@ -1532,6 +1561,21 @@ static sctp_disposition_t sctp_sf_do_dupcook_b(const struct sctp_endpoint *ep, goto nomem_ev; sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, SCTP_ULPEVENT(ev)); + + /* Sockets API Draft Section 5.3.1.6 + * When a peer sends a Adaption Layer Indication parameter , SCTP + * delivers this notification to inform the application that of the + * peers requested adaption layer. + */ + if (asoc->peer.adaption_ind) { + ev = sctp_ulpevent_make_adaption_indication(asoc, GFP_ATOMIC); + if (!ev) + goto nomem_ev; + + sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, + SCTP_ULPEVENT(ev)); + } + return SCTP_DISPOSITION_CONSUME; nomem_ev: @@ -1612,6 +1656,21 @@ static sctp_disposition_t sctp_sf_do_dupcook_d(const struct sctp_endpoint *ep, goto nomem; sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, SCTP_ULPEVENT(ev)); + + /* Sockets API Draft Section 5.3.1.6 + * When a peer sends a Adaption Layer Indication parameter, + * SCTP delivers this notification to inform the application + * that of the peers requested adaption layer. + */ + if (new_asoc->peer.adaption_ind) { + ev = sctp_ulpevent_make_adaption_indication(new_asoc, + GFP_ATOMIC); + if (!ev) + goto nomem; + + sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, + SCTP_ULPEVENT(ev)); + } } sctp_add_cmd_sf(commands, SCTP_CMD_TRANSMIT, SCTP_NULL()); diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 557b1a2db1f3..6e61bce2f97a 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -2120,6 +2120,20 @@ static int sctp_setsockopt_peer_primary_addr(struct sock *sk, char __user *optva return err; } +static int sctp_setsockopt_adaption_layer(struct sock *sk, char __user *optval, + int optlen) +{ + __u32 val; + + if (optlen < sizeof(__u32)) + return -EINVAL; + if (copy_from_user(&val, optval, sizeof(__u32))) + return -EFAULT; + + sctp_sk(sk)->adaption_ind = val; + + return 0; +} /* API 6.2 setsockopt(), getsockopt() * @@ -2219,6 +2233,10 @@ SCTP_STATIC int sctp_setsockopt(struct sock *sk, int level, int optname, case SCTP_MAXSEG: retval = sctp_setsockopt_maxseg(sk, optval, optlen); break; + case SCTP_ADAPTION_LAYER: + retval = sctp_setsockopt_adaption_layer(sk, optval, optlen); + break; + default: retval = -ENOPROTOOPT; break; @@ -2518,6 +2536,8 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk) /* User specified fragmentation limit. */ sp->user_frag = 0; + sp->adaption_ind = 0; + sp->pf = sctp_get_pf_specific(sk->sk_family); /* Control variables for partial data delivery. */ @@ -3159,6 +3179,29 @@ static int sctp_getsockopt_primary_addr(struct sock *sk, int len, return 0; } +/* + * 7.1.11 Set Adaption Layer Indicator (SCTP_ADAPTION_LAYER) + * + * Requests that the local endpoint set the specified Adaption Layer + * Indication parameter for all future INIT and INIT-ACK exchanges. + */ +static int sctp_getsockopt_adaption_layer(struct sock *sk, int len, + char __user *optval, int __user *optlen) +{ + __u32 val; + + if (len < sizeof(__u32)) + return -EINVAL; + + len = sizeof(__u32); + val = sctp_sk(sk)->adaption_ind; + if (put_user(len, optlen)) + return -EFAULT; + if (copy_to_user(optval, &val, len)) + return -EFAULT; + return 0; +} + /* * * 7.1.14 Set default send parameters (SCTP_DEFAULT_SEND_PARAM) @@ -3515,6 +3558,10 @@ SCTP_STATIC int sctp_getsockopt(struct sock *sk, int level, int optname, retval = sctp_getsockopt_peer_addr_info(sk, len, optval, optlen); break; + case SCTP_ADAPTION_LAYER: + retval = sctp_getsockopt_adaption_layer(sk, len, optval, + optlen); + break; default: retval = -ENOPROTOOPT; break; diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c index e804d6ed8c0f..cd002b577e85 100644 --- a/net/sctp/ulpevent.c +++ b/net/sctp/ulpevent.c @@ -562,7 +562,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_shutdown_event( struct sctp_shutdown_event *sse; struct sk_buff *skb; - event = sctp_ulpevent_new(sizeof(struct sctp_assoc_change), + event = sctp_ulpevent_new(sizeof(struct sctp_shutdown_event), MSG_NOTIFICATION, gfp); if (!event) goto fail; @@ -613,6 +613,40 @@ fail: return NULL; } +/* Create and initialize a SCTP_ADAPTION_INDICATION notification. + * + * Socket Extensions for SCTP + * 5.3.1.6 SCTP_ADAPTION_INDICATION + */ +struct sctp_ulpevent *sctp_ulpevent_make_adaption_indication( + const struct sctp_association *asoc, int gfp) +{ + struct sctp_ulpevent *event; + struct sctp_adaption_event *sai; + struct sk_buff *skb; + + event = sctp_ulpevent_new(sizeof(struct sctp_adaption_event), + MSG_NOTIFICATION, gfp); + if (!event) + goto fail; + + skb = sctp_event2skb(event); + sai = (struct sctp_adaption_event *) + skb_put(skb, sizeof(struct sctp_adaption_event)); + + sai->sai_type = SCTP_ADAPTION_INDICATION; + sai->sai_flags = 0; + sai->sai_length = sizeof(struct sctp_adaption_event); + sai->sai_adaption_ind = asoc->peer.adaption_ind; + sctp_ulpevent_set_owner(event, asoc); + sai->sai_assoc_id = sctp_assoc2id(asoc); + + return event; + +fail: + return NULL; +} + /* A message has been received. Package this message as a notification * to pass it to the upper layers. Go ahead and calculate the sndrcvinfo * even if filtered out later. @@ -689,7 +723,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_pdapi( struct sctp_pdapi_event *pd; struct sk_buff *skb; - event = sctp_ulpevent_new(sizeof(struct sctp_assoc_change), + event = sctp_ulpevent_new(sizeof(struct sctp_pdapi_event), MSG_NOTIFICATION, gfp); if (!event) goto fail; -- cgit v1.2.3 From b1fc45346945989423ce9ccb8e32fff70ce536ba Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 25 Oct 2004 01:43:30 -0700 Subject: [NETFILTER]: Make *_find_target_lock routines static. Signed-off-by: David S. Miller --- include/linux/netfilter.h | 8 -------- include/linux/netfilter_ipv4/ip_tables.h | 5 ----- net/ipv4/netfilter/arp_tables.c | 3 +-- net/ipv4/netfilter/ip_tables.c | 3 +-- net/ipv6/netfilter/ip6_tables.c | 3 +-- 5 files changed, 3 insertions(+), 19 deletions(-) (limited to 'include/linux') diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index a9357be1ae41..f7c3997e8056 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h @@ -172,14 +172,6 @@ extern void nf_reinject(struct sk_buff *skb, struct nf_info *info, unsigned int verdict); -extern inline struct ipt_target * -ipt_find_target_lock(const char *name, int *error, struct semaphore *mutex); -extern inline struct ip6t_target * -ip6t_find_target_lock(const char *name, int *error, struct semaphore *mutex); -extern inline struct arpt_target * -arpt_find_target_lock(const char *name, int *error, struct semaphore *mutex); -extern void (*ip_ct_attach)(struct sk_buff *, struct sk_buff *); - #ifdef CONFIG_NETFILTER_DEBUG extern void nf_dump_skb(int pf, struct sk_buff *skb); #endif diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h index 02a006f17ac4..defc7bc472d9 100644 --- a/include/linux/netfilter_ipv4/ip_tables.h +++ b/include/linux/netfilter_ipv4/ip_tables.h @@ -407,11 +407,6 @@ struct ipt_target struct module *me; }; -extern struct ipt_target * -ipt_find_target_lock(const char *name, int *error, struct semaphore *mutex); -extern struct arpt_target * -arpt_find_target_lock(const char *name, int *error, struct semaphore *mutex); - extern int ipt_register_target(struct ipt_target *target); extern void ipt_unregister_target(struct ipt_target *target); diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c index f2b3e7e5bb18..b0d4ce63e973 100644 --- a/net/ipv4/netfilter/arp_tables.c +++ b/net/ipv4/netfilter/arp_tables.c @@ -395,7 +395,7 @@ static inline struct arpt_table *arpt_find_table_lock(const char *name, int *err return find_inlist_lock(&arpt_tables, name, "arptable_", error, mutex); } -struct arpt_target *arpt_find_target_lock(const char *name, int *error, struct semaphore *mutex) +static struct arpt_target *arpt_find_target_lock(const char *name, int *error, struct semaphore *mutex) { return find_inlist_lock(&arpt_target, name, "arpt_", error, mutex); } @@ -1325,7 +1325,6 @@ static void __exit fini(void) EXPORT_SYMBOL(arpt_register_table); EXPORT_SYMBOL(arpt_unregister_table); EXPORT_SYMBOL(arpt_do_table); -EXPORT_SYMBOL(arpt_find_target_lock); EXPORT_SYMBOL(arpt_register_target); EXPORT_SYMBOL(arpt_unregister_target); diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c index 8da90bdb37c2..3e601a80d580 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c @@ -471,7 +471,7 @@ find_match_lock(const char *name, int *error, struct semaphore *mutex) return find_inlist_lock(&ipt_match, name, "ipt_", error, mutex); } -struct ipt_target * +static struct ipt_target * ipt_find_target_lock(const char *name, int *error, struct semaphore *mutex) { return find_inlist_lock(&ipt_target, name, "ipt_", error, mutex); @@ -1877,7 +1877,6 @@ EXPORT_SYMBOL(ipt_unregister_match); EXPORT_SYMBOL(ipt_do_table); EXPORT_SYMBOL(ipt_register_target); EXPORT_SYMBOL(ipt_unregister_target); -EXPORT_SYMBOL(ipt_find_target_lock); module_init(init); module_exit(fini); diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index 0cef15b866f5..4ef16449e60e 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c @@ -554,7 +554,7 @@ find_match_lock(const char *name, int *error, struct semaphore *mutex) return find_inlist_lock(&ip6t_match, name, "ip6t_", error, mutex); } -struct ip6t_target * +static struct ip6t_target * ip6t_find_target_lock(const char *name, int *error, struct semaphore *mutex) { return find_inlist_lock(&ip6t_target, name, "ip6t_", error, mutex); @@ -1972,7 +1972,6 @@ static void __exit fini(void) EXPORT_SYMBOL(ip6t_register_table); EXPORT_SYMBOL(ip6t_unregister_table); EXPORT_SYMBOL(ip6t_do_table); -EXPORT_SYMBOL(ip6t_find_target_lock); EXPORT_SYMBOL(ip6t_register_match); EXPORT_SYMBOL(ip6t_unregister_match); EXPORT_SYMBOL(ip6t_register_target); -- cgit v1.2.3 From b4e500f1581c323b74708fc5fd51da39c6d02edf Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Mon, 25 Oct 2004 01:48:28 -0700 Subject: [NETFILTER]: ip_ct_attach decl got removed by accident. Signed-off-by: David S. Miller --- include/linux/netfilter.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/linux') diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index f7c3997e8056..ced66929126c 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h @@ -172,6 +172,8 @@ extern void nf_reinject(struct sk_buff *skb, struct nf_info *info, unsigned int verdict); +extern void (*ip_ct_attach)(struct sk_buff *, struct sk_buff *); + #ifdef CONFIG_NETFILTER_DEBUG extern void nf_dump_skb(int pf, struct sk_buff *skb); #endif -- cgit v1.2.3 From 433760c6356d01c1e382fd900de0a0816c46a9fe Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Mon, 25 Oct 2004 02:10:45 -0700 Subject: [NET]: Give skb_checksum_help() an skb_buff * again Since skb_checksum_help has been using pskb_expand_head for a while now without any ill effects, I thought it would be a good idea to remove the double pointers from it and its callers. This is what the following patch does. The only 'rider' bit is the removal of an unnecessary BUG_ON in ip6_pkt_discard_out. The preceding assignment was only added because the following function oopsed so there is no point in doing BUG_ON. Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- include/linux/netdevice.h | 2 +- include/net/dst.h | 4 ++-- include/net/ip.h | 4 ++-- include/net/ip6_route.h | 2 +- include/net/ipv6.h | 2 +- include/net/xfrm.h | 4 ++-- net/bridge/br_netfilter.c | 2 +- net/core/dev.c | 24 ++++++++++++------------ net/core/dst.c | 4 ++-- net/decnet/dn_route.c | 10 ++-------- net/ipv4/ip_output.c | 7 ++----- net/ipv4/netfilter/ip_fw_compat.c | 2 +- net/ipv4/netfilter/ip_nat_standalone.c | 2 +- net/ipv4/netfilter/ipt_ECN.c | 2 +- net/ipv4/route.c | 4 +--- net/ipv4/xfrm4_output.c | 6 ++---- net/ipv6/ip6_output.c | 21 +++++++++------------ net/ipv6/route.c | 11 +++++------ net/ipv6/xfrm6_output.c | 6 ++---- 19 files changed, 50 insertions(+), 69 deletions(-) (limited to 'include/linux') diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index c102cdce2ebe..79c65e9ac5a1 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -937,7 +937,7 @@ extern int weight_p; extern unsigned long netdev_fc_xoff; extern atomic_t netdev_dropping; extern int netdev_set_master(struct net_device *dev, struct net_device *master); -extern int skb_checksum_help(struct sk_buff **pskb, int inward); +extern int skb_checksum_help(struct sk_buff *skb, int inward); #ifdef CONFIG_SYSCTL extern char *net_sysctl_strdup(const char *s); diff --git a/include/net/dst.h b/include/net/dst.h index 16da04466554..7ffb470d0e9a 100644 --- a/include/net/dst.h +++ b/include/net/dst.h @@ -67,7 +67,7 @@ struct dst_entry struct xfrm_state *xfrm; int (*input)(struct sk_buff*); - int (*output)(struct sk_buff**); + int (*output)(struct sk_buff*); #ifdef CONFIG_NET_CLS_ROUTE __u32 tclassid; @@ -222,7 +222,7 @@ static inline int dst_output(struct sk_buff *skb) int err; for (;;) { - err = skb->dst->output(&skb); + err = skb->dst->output(skb); if (likely(err == 0)) return err; diff --git a/include/net/ip.h b/include/net/ip.h index 0f633ff0b9b4..15a1c6a2e534 100644 --- a/include/net/ip.h +++ b/include/net/ip.h @@ -89,8 +89,8 @@ extern int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt); extern int ip_local_deliver(struct sk_buff *skb); extern int ip_mr_input(struct sk_buff *skb); -extern int ip_output(struct sk_buff **pskb); -extern int ip_mc_output(struct sk_buff **pskb); +extern int ip_output(struct sk_buff *skb); +extern int ip_mc_output(struct sk_buff *skb); extern int ip_fragment(struct sk_buff *skb, int (*out)(struct sk_buff*)); extern int ip_do_nat(struct sk_buff *skb); extern void ip_send_check(struct iphdr *ip); diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index d859c4160eaa..067c9d77d551 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h @@ -70,7 +70,7 @@ extern struct rt6_info *rt6_lookup(struct in6_addr *daddr, extern struct dst_entry *ndisc_dst_alloc(struct net_device *dev, struct neighbour *neigh, struct in6_addr *addr, - int (*output)(struct sk_buff **)); + int (*output)(struct sk_buff *)); extern int ndisc_dst_gc(int *more); extern void fib6_force_start_gc(void); diff --git a/include/net/ipv6.h b/include/net/ipv6.h index a3f44754ac08..e0e3800a9560 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h @@ -355,7 +355,7 @@ extern int ip6_dst_lookup(struct sock *sk, * skb processing functions */ -extern int ip6_output(struct sk_buff **pskb); +extern int ip6_output(struct sk_buff *skb); extern int ip6_forward(struct sk_buff *skb); extern int ip6_input(struct sk_buff *skb); extern int ip6_mc_input(struct sk_buff *skb); diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 2c89b019388a..f7fbdd4e1d7f 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -815,7 +815,7 @@ extern void xfrm_replay_advance(struct xfrm_state *x, u32 seq); extern int xfrm_check_selectors(struct xfrm_state **x, int n, struct flowi *fl); extern int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb); extern int xfrm4_rcv(struct sk_buff *skb); -extern int xfrm4_output(struct sk_buff **pskb); +extern int xfrm4_output(struct sk_buff *skb); extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler); extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler); extern int xfrm6_rcv_spi(struct sk_buff **pskb, unsigned int *nhoffp, u32 spi); @@ -825,7 +825,7 @@ extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler); extern u32 xfrm6_tunnel_alloc_spi(xfrm_address_t *saddr); extern void xfrm6_tunnel_free_spi(xfrm_address_t *saddr); extern u32 xfrm6_tunnel_spi_lookup(xfrm_address_t *saddr); -extern int xfrm6_output(struct sk_buff **pskb); +extern int xfrm6_output(struct sk_buff *skb); #ifdef CONFIG_XFRM extern int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type); diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c index 50e4df3559aa..b240ad4a6308 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c @@ -197,7 +197,7 @@ static int br_nf_pre_routing_finish_bridge(struct sk_buff *skb) skb_pull(skb, VLAN_HLEN); skb->nh.raw += VLAN_HLEN; } - skb->dst->output(&skb); + skb->dst->output(skb); return 0; } diff --git a/net/core/dev.c b/net/core/dev.c index df194c2067b8..9d39b2aa52ad 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -1106,34 +1106,34 @@ void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev) * Invalidate hardware checksum when packet is to be mangled, and * complete checksum manually on outgoing path. */ -int skb_checksum_help(struct sk_buff **pskb, int inward) +int skb_checksum_help(struct sk_buff *skb, int inward) { unsigned int csum; - int ret = 0, offset = (*pskb)->h.raw - (*pskb)->data; + int ret = 0, offset = skb->h.raw - skb->data; if (inward) { - (*pskb)->ip_summed = CHECKSUM_NONE; + skb->ip_summed = CHECKSUM_NONE; goto out; } - if (skb_cloned(*pskb)) { - ret = pskb_expand_head(*pskb, 0, 0, GFP_ATOMIC); + if (skb_cloned(skb)) { + ret = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); if (ret) goto out; } - if (offset > (int)(*pskb)->len) + if (offset > (int)skb->len) BUG(); - csum = skb_checksum(*pskb, offset, (*pskb)->len-offset, 0); + csum = skb_checksum(skb, offset, skb->len-offset, 0); - offset = (*pskb)->tail - (*pskb)->h.raw; + offset = skb->tail - skb->h.raw; if (offset <= 0) BUG(); - if ((*pskb)->csum + 2 > offset) + if (skb->csum + 2 > offset) BUG(); - *(u16*)((*pskb)->h.raw + (*pskb)->csum) = csum_fold(csum); - (*pskb)->ip_summed = CHECKSUM_NONE; + *(u16*)(skb->h.raw + skb->csum) = csum_fold(csum); + skb->ip_summed = CHECKSUM_NONE; out: return ret; } @@ -1282,7 +1282,7 @@ int dev_queue_xmit(struct sk_buff *skb) (!(dev->features & (NETIF_F_HW_CSUM | NETIF_F_NO_CSUM)) && (!(dev->features & NETIF_F_IP_CSUM) || skb->protocol != htons(ETH_P_IP)))) - if (skb_checksum_help(&skb, 0)) + if (skb_checksum_help(skb, 0)) goto out_kfree_skb; diff --git a/net/core/dst.c b/net/core/dst.c index 42aeae5959f5..8755f0de86dc 100644 --- a/net/core/dst.c +++ b/net/core/dst.c @@ -106,9 +106,9 @@ static int dst_discard_in(struct sk_buff *skb) return 0; } -static int dst_discard_out(struct sk_buff **pskb) +static int dst_discard_out(struct sk_buff *skb) { - kfree_skb(*pskb); + kfree_skb(skb); return 0; } diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c index 64bdf10b75b7..34f0b81e1784 100644 --- a/net/decnet/dn_route.c +++ b/net/decnet/dn_route.c @@ -683,9 +683,8 @@ out: return NET_RX_DROP; } -static int dn_output(struct sk_buff **pskb) +static int dn_output(struct sk_buff *skb) { - struct sk_buff *skb = *pskb; struct dst_entry *dst = skb->dst; struct dn_route *rt = (struct dn_route *)dst; struct net_device *dev = dst->dev; @@ -796,11 +795,6 @@ static int dn_rt_bug(struct sk_buff *skb) return NET_RX_BAD; } -static int dn_rt_bug_out(struct sk_buff **pskb) -{ - return dn_rt_bug(*pskb); -} - static int dn_rt_set_next_hop(struct dn_route *rt, struct dn_fib_res *res) { struct dn_fib_info *fi = res->fi; @@ -1392,7 +1386,7 @@ make_route: rt->u.dst.neighbour = neigh; rt->u.dst.dev = out_dev; rt->u.dst.lastuse = jiffies; - rt->u.dst.output = dn_rt_bug_out; + rt->u.dst.output = dn_rt_bug; switch(res.type) { case RTN_UNICAST: rt->u.dst.input = dn_forward; diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 8ef2b82630a2..062981affa1c 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -224,9 +224,8 @@ int ip_finish_output(struct sk_buff *skb) ip_finish_output2); } -int ip_mc_output(struct sk_buff **pskb) +int ip_mc_output(struct sk_buff *skb) { - struct sk_buff *skb = *pskb; struct sock *sk = skb->sk; struct rtable *rt = (struct rtable*)skb->dst; struct net_device *dev = rt->u.dst.dev; @@ -285,10 +284,8 @@ int ip_mc_output(struct sk_buff **pskb) return ip_finish_output(skb); } -int ip_output(struct sk_buff **pskb) +int ip_output(struct sk_buff *skb) { - struct sk_buff *skb = *pskb; - IP_INC_STATS(IPSTATS_MIB_OUTREQUESTS); if ((skb->len > dst_pmtu(skb->dst) || skb_shinfo(skb)->frag_list) && diff --git a/net/ipv4/netfilter/ip_fw_compat.c b/net/ipv4/netfilter/ip_fw_compat.c index f7146f31b6c3..840643de241f 100644 --- a/net/ipv4/netfilter/ip_fw_compat.c +++ b/net/ipv4/netfilter/ip_fw_compat.c @@ -69,7 +69,7 @@ fw_in(unsigned int hooknum, /* Assume worse case: any hook could change packet */ (*pskb)->nfcache |= NFC_UNKNOWN | NFC_ALTERED; if ((*pskb)->ip_summed == CHECKSUM_HW) - if (skb_checksum_help(pskb, (out == NULL))) + if (skb_checksum_help(*pskb, (out == NULL))) return NF_DROP; switch (hooknum) { diff --git a/net/ipv4/netfilter/ip_nat_standalone.c b/net/ipv4/netfilter/ip_nat_standalone.c index e4e961225c5f..71bd2e05b0b2 100644 --- a/net/ipv4/netfilter/ip_nat_standalone.c +++ b/net/ipv4/netfilter/ip_nat_standalone.c @@ -86,7 +86,7 @@ ip_nat_fn(unsigned int hooknum, /* If we had a hardware checksum before, it's now invalid */ if ((*pskb)->ip_summed == CHECKSUM_HW) - if (skb_checksum_help(pskb, (out == NULL))) + if (skb_checksum_help(*pskb, (out == NULL))) return NF_DROP; ct = ip_conntrack_get(*pskb, &ctinfo); diff --git a/net/ipv4/netfilter/ipt_ECN.c b/net/ipv4/netfilter/ipt_ECN.c index 120109cd294d..f659ec3c9278 100644 --- a/net/ipv4/netfilter/ipt_ECN.c +++ b/net/ipv4/netfilter/ipt_ECN.c @@ -86,7 +86,7 @@ set_ect_tcp(struct sk_buff **pskb, const struct ipt_ECN_info *einfo, int inward) memcpy((*pskb)->data + (*pskb)->nh.iph->ihl*4, &_tcph, sizeof(_tcph)); if ((*pskb)->ip_summed == CHECKSUM_HW) - if (skb_checksum_help(pskb, inward)) + if (skb_checksum_help(*pskb, inward)) return 0; (*pskb)->nfcache |= NFC_ALTERED; } diff --git a/net/ipv4/route.c b/net/ipv4/route.c index fd023db82df9..27ce169f63b9 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -1367,10 +1367,8 @@ static void ipv4_link_failure(struct sk_buff *skb) dst_set_expires(&rt->u.dst, 0); } -static int ip_rt_bug(struct sk_buff **pskb) +static int ip_rt_bug(struct sk_buff *skb) { - struct sk_buff *skb = *pskb; - printk(KERN_DEBUG "ip_rt_bug: %u.%u.%u.%u -> %u.%u.%u.%u, %s\n", NIPQUAD(skb->nh.iph->saddr), NIPQUAD(skb->nh.iph->daddr), skb->dev ? skb->dev->name : "?"); diff --git a/net/ipv4/xfrm4_output.c b/net/ipv4/xfrm4_output.c index 21832dfc376e..3c70b08f908c 100644 --- a/net/ipv4/xfrm4_output.c +++ b/net/ipv4/xfrm4_output.c @@ -91,16 +91,14 @@ out: return ret; } -int xfrm4_output(struct sk_buff **pskb) +int xfrm4_output(struct sk_buff *skb) { - struct sk_buff *skb = *pskb; struct dst_entry *dst = skb->dst; struct xfrm_state *x = dst->xfrm; int err; if (skb->ip_summed == CHECKSUM_HW) { - err = skb_checksum_help(pskb, 0); - skb = *pskb; + err = skb_checksum_help(skb, 0); if (err) goto error_nolock; } diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 33260cfacd35..e74a46201ef1 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c @@ -56,7 +56,7 @@ #include #include -static int ip6_fragment(struct sk_buff **pskb, int (*output)(struct sk_buff**)); +static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)); static __inline__ void ipv6_select_ident(struct sk_buff *skb, struct frag_hdr *fhdr) { @@ -108,9 +108,8 @@ static int ip6_dev_loopback_xmit(struct sk_buff *newskb) } -static int ip6_output2(struct sk_buff **pskb) +static int ip6_output2(struct sk_buff *skb) { - struct sk_buff *skb = *pskb; struct dst_entry *dst = skb->dst; struct net_device *dev = dst->dev; @@ -146,14 +145,12 @@ static int ip6_output2(struct sk_buff **pskb) return NF_HOOK(PF_INET6, NF_IP6_POST_ROUTING, skb,NULL, skb->dev,ip6_output_finish); } -int ip6_output(struct sk_buff **pskb) +int ip6_output(struct sk_buff *skb) { - struct sk_buff *skb = *pskb; - if ((skb->len > dst_pmtu(skb->dst) || skb_shinfo(skb)->frag_list)) - return ip6_fragment(pskb, ip6_output2); + return ip6_fragment(skb, ip6_output2); else - return ip6_output2(pskb); + return ip6_output2(skb); } #ifdef CONFIG_NETFILTER @@ -518,10 +515,10 @@ int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr) return offset; } -static int ip6_fragment(struct sk_buff **pskb, int (*output)(struct sk_buff**)) +static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) { struct net_device *dev; - struct sk_buff *frag, *skb = *pskb; + struct sk_buff *frag; struct rt6_info *rt = (struct rt6_info*)skb->dst; struct ipv6hdr *tmp_hdr; struct frag_hdr *fh; @@ -610,7 +607,7 @@ static int ip6_fragment(struct sk_buff **pskb, int (*output)(struct sk_buff**)) ip6_copy_metadata(frag, skb); } - err = output(&skb); + err = output(skb); if (err || !frag) break; @@ -726,7 +723,7 @@ slow_path: IP6_INC_STATS(IPSTATS_MIB_FRAGCREATES); - err = output(&frag); + err = output(frag); if (err) goto fail; } diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 70b9bb44dd93..5a9059c50ce7 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -88,7 +88,7 @@ static void ip6_dst_ifdown(struct dst_entry *, int how); static int ip6_dst_gc(void); static int ip6_pkt_discard(struct sk_buff *skb); -static int ip6_pkt_discard_out(struct sk_buff **pskb); +static int ip6_pkt_discard_out(struct sk_buff *skb); static void ip6_link_failure(struct sk_buff *skb); static void ip6_rt_update_pmtu(struct dst_entry *dst, u32 mtu); @@ -638,7 +638,7 @@ static inline unsigned int ipv6_advmss(unsigned int mtu) struct dst_entry *ndisc_dst_alloc(struct net_device *dev, struct neighbour *neigh, struct in6_addr *addr, - int (*output)(struct sk_buff **)) + int (*output)(struct sk_buff *)) { struct rt6_info *rt; struct inet6_dev *idev = in6_dev_get(dev); @@ -1362,11 +1362,10 @@ int ip6_pkt_discard(struct sk_buff *skb) return 0; } -int ip6_pkt_discard_out(struct sk_buff **pskb) +int ip6_pkt_discard_out(struct sk_buff *skb) { - (*pskb)->dev = (*pskb)->dst->dev; - BUG_ON(!(*pskb)->dev); - return ip6_pkt_discard(*pskb); + skb->dev = skb->dst->dev; + return ip6_pkt_discard(skb); } /* diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c index 40612ec54305..fbd3aa02d062 100644 --- a/net/ipv6/xfrm6_output.c +++ b/net/ipv6/xfrm6_output.c @@ -91,16 +91,14 @@ static int xfrm6_tunnel_check_size(struct sk_buff *skb) return ret; } -int xfrm6_output(struct sk_buff **pskb) +int xfrm6_output(struct sk_buff *skb) { - struct sk_buff *skb = *pskb; struct dst_entry *dst = skb->dst; struct xfrm_state *x = dst->xfrm; int err; if (skb->ip_summed == CHECKSUM_HW) { - err = skb_checksum_help(pskb, 0); - skb = *pskb; + err = skb_checksum_help(skb, 0); if (err) goto error_nolock; } -- cgit v1.2.3 From 1faf8d7ef0ec1029c2fdd6ca2e25acd8330a8fa1 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 25 Oct 2004 06:22:11 -0700 Subject: [ATM]: Mark vcc_remove_socket static Signed-off-by: David S. Miller --- include/linux/atmdev.h | 1 - net/atm/common.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'include/linux') diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h index 268da2732958..87a901c75370 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h @@ -395,7 +395,6 @@ struct atm_dev *atm_dev_lookup(int number); void atm_dev_deregister(struct atm_dev *dev); void shutdown_atm_dev(struct atm_dev *dev); void vcc_insert_socket(struct sock *sk); -void vcc_remove_socket(struct sock *sk); /* diff --git a/net/atm/common.c b/net/atm/common.c index 56e34deef6c2..47f5413683c8 100644 --- a/net/atm/common.c +++ b/net/atm/common.c @@ -57,7 +57,7 @@ void vcc_insert_socket(struct sock *sk) write_unlock_irq(&vcc_sklist_lock); } -void vcc_remove_socket(struct sock *sk) +static void vcc_remove_socket(struct sock *sk) { write_lock_irq(&vcc_sklist_lock); sk_del_node_init(sk); @@ -86,7 +86,6 @@ static struct sk_buff *alloc_tx(struct atm_vcc *vcc,unsigned int size) EXPORT_SYMBOL(vcc_hash); EXPORT_SYMBOL(vcc_sklist_lock); EXPORT_SYMBOL(vcc_insert_socket); -EXPORT_SYMBOL(vcc_remove_socket); static void vcc_sock_destruct(struct sock *sk) { -- cgit v1.2.3 From c3efef68bd08fbef3c9160e29af37a1c0828af05 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 25 Oct 2004 06:29:14 -0700 Subject: [NET]: Remove dead socket layer exports. Signed-off-by: David S. Miller --- include/linux/net.h | 1 - include/net/sock.h | 2 -- net/core/sock.c | 26 +++++++++----------------- net/socket.c | 4 +--- 4 files changed, 10 insertions(+), 23 deletions(-) (limited to 'include/linux') diff --git a/include/linux/net.h b/include/linux/net.h index 2c4572f630a1..368b0f9d3006 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -176,7 +176,6 @@ struct kvec; extern int sock_wake_async(struct socket *sk, int how, int band); extern int sock_register(struct net_proto_family *fam); extern int sock_unregister(int family); -extern struct socket *sock_alloc(void); extern int sock_create(int family, int type, int proto, struct socket **res); extern int sock_create_kern(int family, int type, int proto, diff --git a/include/net/sock.h b/include/net/sock.h index 563096ab673a..bfad716ce409 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -746,7 +746,6 @@ extern void sk_send_sigurg(struct sock *sk); * Functions to fill in entries in struct proto_ops when a protocol * does not implement a particular function. */ -extern int sock_no_release(struct socket *); extern int sock_no_bind(struct socket *, struct sockaddr *, int); extern int sock_no_connect(struct socket *, @@ -1275,7 +1274,6 @@ static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb) extern atomic_t netstamp_needed; extern void sock_enable_timestamp(struct sock *sk); -extern void sock_disable_timestamp(struct sock *sk); static inline void net_timestamp(struct timeval *stamp) { diff --git a/net/core/sock.c b/net/core/sock.c index 3582a0f0ab3d..79d7e32e347a 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -175,6 +175,15 @@ static void sock_warn_obsolete_bsdism(const char *name) } } +static void sock_disable_timestamp(struct sock *sk) +{ + if (sock_flag(sk, SOCK_TIMESTAMP)) { + sock_reset_flag(sk, SOCK_TIMESTAMP); + atomic_dec(&netstamp_needed); + } +} + + /* * This is meant for all protocols to use and covers goings on * at the socket level. Everything here is generic. @@ -972,11 +981,6 @@ EXPORT_SYMBOL(sk_wait_data); * function, some default processing is provided. */ -int sock_no_release(struct socket *sock) -{ - return 0; -} - int sock_no_bind(struct socket *sock, struct sockaddr *saddr, int len) { return -EOPNOTSUPP; @@ -1247,15 +1251,6 @@ void sock_enable_timestamp(struct sock *sk) } EXPORT_SYMBOL(sock_enable_timestamp); -void sock_disable_timestamp(struct sock *sk) -{ - if (sock_flag(sk, SOCK_TIMESTAMP)) { - sock_reset_flag(sk, SOCK_TIMESTAMP); - atomic_dec(&netstamp_needed); - } -} -EXPORT_SYMBOL(sock_disable_timestamp); - /* * Get a socket option on an socket. * @@ -1371,7 +1366,6 @@ EXPORT_SYMBOL(sk_free); EXPORT_SYMBOL(sk_send_sigurg); EXPORT_SYMBOL(sock_alloc_send_pskb); EXPORT_SYMBOL(sock_alloc_send_skb); -EXPORT_SYMBOL(sock_getsockopt); EXPORT_SYMBOL(sock_init_data); EXPORT_SYMBOL(sock_kfree_s); EXPORT_SYMBOL(sock_kmalloc); @@ -1385,14 +1379,12 @@ EXPORT_SYMBOL(sock_no_listen); EXPORT_SYMBOL(sock_no_mmap); EXPORT_SYMBOL(sock_no_poll); EXPORT_SYMBOL(sock_no_recvmsg); -EXPORT_SYMBOL(sock_no_release); EXPORT_SYMBOL(sock_no_sendmsg); EXPORT_SYMBOL(sock_no_sendpage); EXPORT_SYMBOL(sock_no_setsockopt); EXPORT_SYMBOL(sock_no_shutdown); EXPORT_SYMBOL(sock_no_socketpair); EXPORT_SYMBOL(sock_rfree); -EXPORT_SYMBOL(sock_rmalloc); EXPORT_SYMBOL(sock_setsockopt); EXPORT_SYMBOL(sock_wfree); EXPORT_SYMBOL(sock_wmalloc); diff --git a/net/socket.c b/net/socket.c index 25bb031e89e7..102d2737c269 100644 --- a/net/socket.c +++ b/net/socket.c @@ -459,7 +459,7 @@ struct socket *sockfd_lookup(int fd, int *err) * NULL is returned. */ -struct socket *sock_alloc(void) +static struct socket *sock_alloc(void) { struct inode * inode; struct socket * sock; @@ -2089,8 +2089,6 @@ void socket_seq_show(struct seq_file *seq) /* ABI emulation layers need these two */ EXPORT_SYMBOL(move_addr_to_kernel); EXPORT_SYMBOL(move_addr_to_user); -EXPORT_SYMBOL(sock_alloc); -EXPORT_SYMBOL(sock_alloc_inode); EXPORT_SYMBOL(sock_create); EXPORT_SYMBOL(sock_create_kern); EXPORT_SYMBOL(sock_create_lite); -- cgit v1.2.3 From 29098f0d7f71e9509b8b20bd5e44e37ebb6e6491 Mon Sep 17 00:00:00 2001 From: Hideaki Yoshifuji Date: Wed, 27 Oct 2004 06:54:41 +0900 Subject: [IPV6] Remove codes related to RTF_ALLONLINK. Signed-off-by: Hideaki YOSHIFUJI --- include/linux/ipv6_route.h | 3 ++- net/ipv6/addrconf.c | 2 +- net/ipv6/ip6_fib.c | 2 +- net/ipv6/ndisc.c | 2 +- net/ipv6/route.c | 7 ++----- 5 files changed, 7 insertions(+), 9 deletions(-) (limited to 'include/linux') diff --git a/include/linux/ipv6_route.h b/include/linux/ipv6_route.h index 46d8b7e8b1aa..e2f935038013 100644 --- a/include/linux/ipv6_route.h +++ b/include/linux/ipv6_route.h @@ -14,7 +14,8 @@ #define _LINUX_IPV6_ROUTE_H #define RTF_DEFAULT 0x00010000 /* default - learned via ND */ -#define RTF_ALLONLINK 0x00020000 /* fallback, no routers on link */ +#define RTF_ALLONLINK 0x00020000 /* (deprecated and will be removed) + fallback, no routers on link */ #define RTF_ADDRCONF 0x00040000 /* addrconf route - RA */ #define RTF_PREFIX_RT 0x00080000 /* A prefix only route - RA */ diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 737937e4471b..a84c15771265 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -885,7 +885,7 @@ int ipv6_get_saddr(struct dst_entry *dst, if (rt) dev = rt->rt6i_dev; - onlink = (rt && (rt->rt6i_flags & RTF_ALLONLINK)); + onlink = 0; return ipv6_dev_get_saddr(dev, daddr, saddr, onlink); } diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index 1816b81ae454..d394bd2d0285 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c @@ -433,7 +433,7 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt, if (fn->fn_flags&RTN_TL_ROOT && fn->leaf == &ip6_null_entry && - !(rt->rt6i_flags & (RTF_DEFAULT | RTF_ADDRCONF | RTF_ALLONLINK)) ){ + !(rt->rt6i_flags & (RTF_DEFAULT | RTF_ADDRCONF)) ){ fn->leaf = rt; rt->u.next = NULL; goto out; diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 685a02d2ebf5..77225ae20249 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c @@ -1026,7 +1026,7 @@ static void ndisc_router_discovery(struct sk_buff *skb) * delete it */ - rt6_purge_dflt_routers(RTF_ALLONLINK); + rt6_purge_dflt_routers(0); } if (rt) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 70b9bb44dd93..896e4f796fd7 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -1293,10 +1293,7 @@ void rt6_purge_dflt_routers(int last_resort) struct rt6_info *rt; u32 flags; - if (last_resort) - flags = RTF_ALLONLINK; - else - flags = RTF_DEFAULT | RTF_ADDRCONF; + flags = RTF_DEFAULT | RTF_ADDRCONF; restart: read_lock_bh(&rt6_lock); @@ -1592,7 +1589,7 @@ static int rt6_fill_node(struct sk_buff *skb, struct rt6_info *rt, rtm->rtm_protocol = rt->rt6i_protocol; if (rt->rt6i_flags&RTF_DYNAMIC) rtm->rtm_protocol = RTPROT_REDIRECT; - else if (rt->rt6i_flags&(RTF_ADDRCONF|RTF_ALLONLINK)) + else if (rt->rt6i_flags & RTF_ADDRCONF) rtm->rtm_protocol = RTPROT_KERNEL; else if (rt->rt6i_flags&RTF_DEFAULT) rtm->rtm_protocol = RTPROT_RA; -- cgit v1.2.3