aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2005-12-06 22:14:09 -0500
committerDave Jones <davej@redhat.com>2005-12-06 22:14:09 -0500
commitfc457fa7c0cdbfe96812ba377e508880d600298f (patch)
tree514049d61cf8b1587141a375ba3ec4f71e09a9db /net/ipv6
parentcc6e8de8f0fab61760bb7091fb19eef1406e17be (diff)
parente4f5c82a92c2a546a16af1614114eec19120e40a (diff)
Merge ../linus/
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/af_inet6.c47
-rw-r--r--net/ipv6/icmp.c2
-rw-r--r--net/ipv6/ip6_output.c3
-rw-r--r--net/ipv6/ipv6_sockglue.c4
-rw-r--r--net/ipv6/mcast.c5
-rw-r--r--net/ipv6/netfilter/ip6_tables.c2
6 files changed, 44 insertions, 19 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index c63b8ce0e1..d9546380fa 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -92,10 +92,13 @@ static int inet6_create(struct socket *sock, int protocol)
92 struct proto *answer_prot; 92 struct proto *answer_prot;
93 unsigned char answer_flags; 93 unsigned char answer_flags;
94 char answer_no_check; 94 char answer_no_check;
95 int rc; 95 int try_loading_module = 0;
96 int err;
96 97
97 /* Look for the requested type/protocol pair. */ 98 /* Look for the requested type/protocol pair. */
98 answer = NULL; 99 answer = NULL;
100lookup_protocol:
101 err = -ESOCKTNOSUPPORT;
99 rcu_read_lock(); 102 rcu_read_lock();
100 list_for_each_rcu(p, &inetsw6[sock->type]) { 103 list_for_each_rcu(p, &inetsw6[sock->type]) {
101 answer = list_entry(p, struct inet_protosw, list); 104 answer = list_entry(p, struct inet_protosw, list);
@@ -113,21 +116,37 @@ static int inet6_create(struct socket *sock, int protocol)
113 if (IPPROTO_IP == answer->protocol) 116 if (IPPROTO_IP == answer->protocol)
114 break; 117 break;
115 } 118 }
119 err = -EPROTONOSUPPORT;
116 answer = NULL; 120 answer = NULL;
117 } 121 }
118 122
119 rc = -ESOCKTNOSUPPORT; 123 if (!answer) {
120 if (!answer) 124 if (try_loading_module < 2) {
121 goto out_rcu_unlock; 125 rcu_read_unlock();
122 rc = -EPERM; 126 /*
127 * Be more specific, e.g. net-pf-10-proto-132-type-1
128 * (net-pf-PF_INET6-proto-IPPROTO_SCTP-type-SOCK_STREAM)
129 */
130 if (++try_loading_module == 1)
131 request_module("net-pf-%d-proto-%d-type-%d",
132 PF_INET6, protocol, sock->type);
133 /*
134 * Fall back to generic, e.g. net-pf-10-proto-132
135 * (net-pf-PF_INET6-proto-IPPROTO_SCTP)
136 */
137 else
138 request_module("net-pf-%d-proto-%d",
139 PF_INET6, protocol);
140 goto lookup_protocol;
141 } else
142 goto out_rcu_unlock;
143 }
144
145 err = -EPERM;
123 if (answer->capability > 0 && !capable(answer->capability)) 146 if (answer->capability > 0 && !capable(answer->capability))
124 goto out_rcu_unlock; 147 goto out_rcu_unlock;
125 rc = -EPROTONOSUPPORT;
126 if (!protocol)
127 goto out_rcu_unlock;
128 148
129 sock->ops = answer->ops; 149 sock->ops = answer->ops;
130
131 answer_prot = answer->prot; 150 answer_prot = answer->prot;
132 answer_no_check = answer->no_check; 151 answer_no_check = answer->no_check;
133 answer_flags = answer->flags; 152 answer_flags = answer->flags;
@@ -135,14 +154,14 @@ static int inet6_create(struct socket *sock, int protocol)
135 154
136 BUG_TRAP(answer_prot->slab != NULL); 155 BUG_TRAP(answer_prot->slab != NULL);
137 156
138 rc = -ENOBUFS; 157 err = -ENOBUFS;
139 sk = sk_alloc(PF_INET6, GFP_KERNEL, answer_prot, 1); 158 sk = sk_alloc(PF_INET6, GFP_KERNEL, answer_prot, 1);
140 if (sk == NULL) 159 if (sk == NULL)
141 goto out; 160 goto out;
142 161
143 sock_init_data(sock, sk); 162 sock_init_data(sock, sk);
144 163
145 rc = 0; 164 err = 0;
146 sk->sk_no_check = answer_no_check; 165 sk->sk_no_check = answer_no_check;
147 if (INET_PROTOSW_REUSE & answer_flags) 166 if (INET_PROTOSW_REUSE & answer_flags)
148 sk->sk_reuse = 1; 167 sk->sk_reuse = 1;
@@ -202,14 +221,14 @@ static int inet6_create(struct socket *sock, int protocol)
202 sk->sk_prot->hash(sk); 221 sk->sk_prot->hash(sk);
203 } 222 }
204 if (sk->sk_prot->init) { 223 if (sk->sk_prot->init) {
205 rc = sk->sk_prot->init(sk); 224 err = sk->sk_prot->init(sk);
206 if (rc) { 225 if (err) {
207 sk_common_release(sk); 226 sk_common_release(sk);
208 goto out; 227 goto out;
209 } 228 }
210 } 229 }
211out: 230out:
212 return rc; 231 return err;
213out_rcu_unlock: 232out_rcu_unlock:
214 rcu_read_unlock(); 233 rcu_read_unlock();
215 goto out; 234 goto out;
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 1bdf0fb8bf..34a332225c 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -751,7 +751,7 @@ void icmpv6_cleanup(void)
751 inet6_del_protocol(&icmpv6_protocol, IPPROTO_ICMPV6); 751 inet6_del_protocol(&icmpv6_protocol, IPPROTO_ICMPV6);
752} 752}
753 753
754static struct icmp6_err { 754static const struct icmp6_err {
755 int err; 755 int err;
756 int fatal; 756 int fatal;
757} tab_unreach[] = { 757} tab_unreach[] = {
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index c1fa693511..8523c76ebf 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -774,7 +774,8 @@ out_err_release:
774 *dst = NULL; 774 *dst = NULL;
775 return err; 775 return err;
776} 776}
777inline int ip6_ufo_append_data(struct sock *sk, 777
778static inline int ip6_ufo_append_data(struct sock *sk,
778 int getfrag(void *from, char *to, int offset, int len, 779 int getfrag(void *from, char *to, int offset, int len,
779 int odd, struct sk_buff *skb), 780 int odd, struct sk_buff *skb),
780 void *from, int length, int hh_len, int fragheaderlen, 781 void *from, int length, int hh_len, int fragheaderlen,
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 25757ade98..3620718def 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -628,8 +628,8 @@ e_inval:
628 return -EINVAL; 628 return -EINVAL;
629} 629}
630 630
631int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_opt_hdr *hdr, 631static int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_opt_hdr *hdr,
632 char __user *optval, int len) 632 char __user *optval, int len)
633{ 633{
634 if (!hdr) 634 if (!hdr)
635 return 0; 635 return 0;
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index f15e04ad02..fd939da090 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -1231,6 +1231,11 @@ int igmp6_event_report(struct sk_buff *skb)
1231 if (skb->pkt_type == PACKET_LOOPBACK) 1231 if (skb->pkt_type == PACKET_LOOPBACK)
1232 return 0; 1232 return 0;
1233 1233
1234 /* send our report if the MC router may not have heard this report */
1235 if (skb->pkt_type != PACKET_MULTICAST &&
1236 skb->pkt_type != PACKET_BROADCAST)
1237 return 0;
1238
1234 if (!pskb_may_pull(skb, sizeof(struct in6_addr))) 1239 if (!pskb_may_pull(skb, sizeof(struct in6_addr)))
1235 return -EINVAL; 1240 return -EINVAL;
1236 1241
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index 7d492226c1..95d469271c 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -1972,7 +1972,7 @@ static int ip6t_get_matches(char *buffer, char **start, off_t offset, int length
1972 return pos; 1972 return pos;
1973} 1973}
1974 1974
1975static struct { char *name; get_info_t *get_info; } ip6t_proc_entry[] = 1975static const struct { char *name; get_info_t *get_info; } ip6t_proc_entry[] =
1976{ { "ip6_tables_names", ip6t_get_tables }, 1976{ { "ip6_tables_names", ip6t_get_tables },
1977 { "ip6_tables_targets", ip6t_get_targets }, 1977 { "ip6_tables_targets", ip6t_get_targets },
1978 { "ip6_tables_matches", ip6t_get_matches }, 1978 { "ip6_tables_matches", ip6t_get_matches },