Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32613090 authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by David S. Miller
Browse files

net: constify struct net_protocol



Remove long removed "inet_protocol_base" declaration.

Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e4c57d0f
Loading
Loading
Loading
Loading
+3 −4
Original line number Original line Diff line number Diff line
@@ -94,15 +94,14 @@ struct inet_protosw {
#define INET_PROTOSW_PERMANENT 0x02  /* Permanent protocols are unremovable. */
#define INET_PROTOSW_PERMANENT 0x02  /* Permanent protocols are unremovable. */
#define INET_PROTOSW_ICSK      0x04  /* Is this an inet_connection_sock? */
#define INET_PROTOSW_ICSK      0x04  /* Is this an inet_connection_sock? */


extern struct net_protocol *inet_protocol_base;
extern const struct net_protocol *inet_protos[MAX_INET_PROTOS];
extern struct net_protocol *inet_protos[MAX_INET_PROTOS];


#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
extern struct inet6_protocol *inet6_protos[MAX_INET_PROTOS];
extern struct inet6_protocol *inet6_protos[MAX_INET_PROTOS];
#endif
#endif


extern int	inet_add_protocol(struct net_protocol *prot, unsigned char num);
extern int	inet_add_protocol(const struct net_protocol *prot, unsigned char num);
extern int	inet_del_protocol(struct net_protocol *prot, unsigned char num);
extern int	inet_del_protocol(const struct net_protocol *prot, unsigned char num);
extern void	inet_register_protosw(struct inet_protosw *p);
extern void	inet_register_protosw(struct inet_protosw *p);
extern void	inet_unregister_protosw(struct inet_protosw *p);
extern void	inet_unregister_protosw(struct inet_protosw *p);


+1 −1
Original line number Original line Diff line number Diff line
@@ -948,7 +948,7 @@ static struct proto dccp_v4_prot = {
#endif
#endif
};
};


static struct net_protocol dccp_v4_protocol = {
static const struct net_protocol dccp_v4_protocol = {
	.handler	= dccp_v4_rcv,
	.handler	= dccp_v4_rcv,
	.err_handler	= dccp_v4_err,
	.err_handler	= dccp_v4_err,
	.no_policy	= 1,
	.no_policy	= 1,
+9 −9
Original line number Original line Diff line number Diff line
@@ -244,7 +244,7 @@ EXPORT_SYMBOL(build_ehash_secret);
static inline int inet_netns_ok(struct net *net, int protocol)
static inline int inet_netns_ok(struct net *net, int protocol)
{
{
	int hash;
	int hash;
	struct net_protocol *ipprot;
	const struct net_protocol *ipprot;


	if (net_eq(net, &init_net))
	if (net_eq(net, &init_net))
		return 1;
		return 1;
@@ -1162,7 +1162,7 @@ EXPORT_SYMBOL(inet_sk_rebuild_header);
static int inet_gso_send_check(struct sk_buff *skb)
static int inet_gso_send_check(struct sk_buff *skb)
{
{
	struct iphdr *iph;
	struct iphdr *iph;
	struct net_protocol *ops;
	const struct net_protocol *ops;
	int proto;
	int proto;
	int ihl;
	int ihl;
	int err = -EINVAL;
	int err = -EINVAL;
@@ -1198,7 +1198,7 @@ static struct sk_buff *inet_gso_segment(struct sk_buff *skb, int features)
{
{
	struct sk_buff *segs = ERR_PTR(-EINVAL);
	struct sk_buff *segs = ERR_PTR(-EINVAL);
	struct iphdr *iph;
	struct iphdr *iph;
	struct net_protocol *ops;
	const struct net_protocol *ops;
	int proto;
	int proto;
	int ihl;
	int ihl;
	int id;
	int id;
@@ -1265,7 +1265,7 @@ static struct sk_buff *inet_gso_segment(struct sk_buff *skb, int features)
static struct sk_buff **inet_gro_receive(struct sk_buff **head,
static struct sk_buff **inet_gro_receive(struct sk_buff **head,
					 struct sk_buff *skb)
					 struct sk_buff *skb)
{
{
	struct net_protocol *ops;
	const struct net_protocol *ops;
	struct sk_buff **pp = NULL;
	struct sk_buff **pp = NULL;
	struct sk_buff *p;
	struct sk_buff *p;
	struct iphdr *iph;
	struct iphdr *iph;
@@ -1342,7 +1342,7 @@ static struct sk_buff **inet_gro_receive(struct sk_buff **head,


static int inet_gro_complete(struct sk_buff *skb)
static int inet_gro_complete(struct sk_buff *skb)
{
{
	struct net_protocol *ops;
	const struct net_protocol *ops;
	struct iphdr *iph = ip_hdr(skb);
	struct iphdr *iph = ip_hdr(skb);
	int proto = iph->protocol & (MAX_INET_PROTOS - 1);
	int proto = iph->protocol & (MAX_INET_PROTOS - 1);
	int err = -ENOSYS;
	int err = -ENOSYS;
@@ -1427,13 +1427,13 @@ void snmp_mib_free(void *ptr[2])
EXPORT_SYMBOL_GPL(snmp_mib_free);
EXPORT_SYMBOL_GPL(snmp_mib_free);


#ifdef CONFIG_IP_MULTICAST
#ifdef CONFIG_IP_MULTICAST
static struct net_protocol igmp_protocol = {
static const struct net_protocol igmp_protocol = {
	.handler =	igmp_rcv,
	.handler =	igmp_rcv,
	.netns_ok =	1,
	.netns_ok =	1,
};
};
#endif
#endif


static struct net_protocol tcp_protocol = {
static const struct net_protocol tcp_protocol = {
	.handler =	tcp_v4_rcv,
	.handler =	tcp_v4_rcv,
	.err_handler =	tcp_v4_err,
	.err_handler =	tcp_v4_err,
	.gso_send_check = tcp_v4_gso_send_check,
	.gso_send_check = tcp_v4_gso_send_check,
@@ -1444,7 +1444,7 @@ static struct net_protocol tcp_protocol = {
	.netns_ok =	1,
	.netns_ok =	1,
};
};


static struct net_protocol udp_protocol = {
static const struct net_protocol udp_protocol = {
	.handler =	udp_rcv,
	.handler =	udp_rcv,
	.err_handler =	udp_err,
	.err_handler =	udp_err,
	.gso_send_check = udp4_ufo_send_check,
	.gso_send_check = udp4_ufo_send_check,
@@ -1453,7 +1453,7 @@ static struct net_protocol udp_protocol = {
	.netns_ok =	1,
	.netns_ok =	1,
};
};


static struct net_protocol icmp_protocol = {
static const struct net_protocol icmp_protocol = {
	.handler =	icmp_rcv,
	.handler =	icmp_rcv,
	.no_policy =	1,
	.no_policy =	1,
	.netns_ok =	1,
	.netns_ok =	1,
+1 −1
Original line number Original line Diff line number Diff line
@@ -311,7 +311,7 @@ static const struct xfrm_type ah_type =
	.output		= ah_output
	.output		= ah_output
};
};


static struct net_protocol ah4_protocol = {
static const struct net_protocol ah4_protocol = {
	.handler	=	xfrm4_rcv,
	.handler	=	xfrm4_rcv,
	.err_handler	=	ah4_err,
	.err_handler	=	ah4_err,
	.no_policy	=	1,
	.no_policy	=	1,
+1 −1
Original line number Original line Diff line number Diff line
@@ -615,7 +615,7 @@ static const struct xfrm_type esp_type =
	.output		= esp_output
	.output		= esp_output
};
};


static struct net_protocol esp4_protocol = {
static const struct net_protocol esp4_protocol = {
	.handler	=	xfrm4_rcv,
	.handler	=	xfrm4_rcv,
	.err_handler	=	esp4_err,
	.err_handler	=	esp4_err,
	.no_policy	=	1,
	.no_policy	=	1,
Loading