diff options
Diffstat (limited to 'net/ipv6/raw.c')
-rw-r--r-- | net/ipv6/raw.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index b34631e1b015..850b83e430bc 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -1273,3 +1273,55 @@ void raw6_proc_exit(void) | |||
1273 | proc_net_remove(&init_net, "raw6"); | 1273 | proc_net_remove(&init_net, "raw6"); |
1274 | } | 1274 | } |
1275 | #endif /* CONFIG_PROC_FS */ | 1275 | #endif /* CONFIG_PROC_FS */ |
1276 | |||
1277 | /* Same as inet6_dgram_ops, sans udp_poll. */ | ||
1278 | static const struct proto_ops inet6_sockraw_ops = { | ||
1279 | .family = PF_INET6, | ||
1280 | .owner = THIS_MODULE, | ||
1281 | .release = inet6_release, | ||
1282 | .bind = inet6_bind, | ||
1283 | .connect = inet_dgram_connect, /* ok */ | ||
1284 | .socketpair = sock_no_socketpair, /* a do nothing */ | ||
1285 | .accept = sock_no_accept, /* a do nothing */ | ||
1286 | .getname = inet6_getname, | ||
1287 | .poll = datagram_poll, /* ok */ | ||
1288 | .ioctl = inet6_ioctl, /* must change */ | ||
1289 | .listen = sock_no_listen, /* ok */ | ||
1290 | .shutdown = inet_shutdown, /* ok */ | ||
1291 | .setsockopt = sock_common_setsockopt, /* ok */ | ||
1292 | .getsockopt = sock_common_getsockopt, /* ok */ | ||
1293 | .sendmsg = inet_sendmsg, /* ok */ | ||
1294 | .recvmsg = sock_common_recvmsg, /* ok */ | ||
1295 | .mmap = sock_no_mmap, | ||
1296 | .sendpage = sock_no_sendpage, | ||
1297 | #ifdef CONFIG_COMPAT | ||
1298 | .compat_setsockopt = compat_sock_common_setsockopt, | ||
1299 | .compat_getsockopt = compat_sock_common_getsockopt, | ||
1300 | #endif | ||
1301 | }; | ||
1302 | |||
1303 | static struct inet_protosw rawv6_protosw = { | ||
1304 | .type = SOCK_RAW, | ||
1305 | .protocol = IPPROTO_IP, /* wild card */ | ||
1306 | .prot = &rawv6_prot, | ||
1307 | .ops = &inet6_sockraw_ops, | ||
1308 | .capability = CAP_NET_RAW, | ||
1309 | .no_check = UDP_CSUM_DEFAULT, | ||
1310 | .flags = INET_PROTOSW_REUSE, | ||
1311 | }; | ||
1312 | |||
1313 | int __init rawv6_init(void) | ||
1314 | { | ||
1315 | int ret; | ||
1316 | |||
1317 | ret = inet6_register_protosw(&rawv6_protosw); | ||
1318 | if (ret) | ||
1319 | goto out; | ||
1320 | out: | ||
1321 | return ret; | ||
1322 | } | ||
1323 | |||
1324 | void __exit rawv6_exit(void) | ||
1325 | { | ||
1326 | inet6_unregister_protosw(&rawv6_protosw); | ||
1327 | } | ||