diff options
Diffstat (limited to 'net/ipv4/raw.c')
-rw-r--r-- | net/ipv4/raw.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index a6c63bbd9ddb..87e9c1618100 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c | |||
@@ -95,7 +95,7 @@ static void raw_v4_hash(struct sock *sk) | |||
95 | 95 | ||
96 | static void raw_v4_unhash(struct sock *sk) | 96 | static void raw_v4_unhash(struct sock *sk) |
97 | { | 97 | { |
98 | write_lock_bh(&raw_v4_lock); | 98 | write_lock_bh(&raw_v4_lock); |
99 | if (sk_del_node_init(sk)) | 99 | if (sk_del_node_init(sk)) |
100 | sock_prot_dec_use(sk->sk_prot); | 100 | sock_prot_dec_use(sk->sk_prot); |
101 | write_unlock_bh(&raw_v4_lock); | 101 | write_unlock_bh(&raw_v4_lock); |
@@ -238,7 +238,7 @@ void raw_err (struct sock *sk, struct sk_buff *skb, u32 info) | |||
238 | static int raw_rcv_skb(struct sock * sk, struct sk_buff * skb) | 238 | static int raw_rcv_skb(struct sock * sk, struct sk_buff * skb) |
239 | { | 239 | { |
240 | /* Charge it to the socket. */ | 240 | /* Charge it to the socket. */ |
241 | 241 | ||
242 | if (sock_queue_rcv_skb(sk, skb) < 0) { | 242 | if (sock_queue_rcv_skb(sk, skb) < 0) { |
243 | /* FIXME: increment a raw drops counter here */ | 243 | /* FIXME: increment a raw drops counter here */ |
244 | kfree_skb(skb); | 244 | kfree_skb(skb); |
@@ -263,7 +263,7 @@ int raw_rcv(struct sock *sk, struct sk_buff *skb) | |||
263 | } | 263 | } |
264 | 264 | ||
265 | static int raw_send_hdrinc(struct sock *sk, void *from, size_t length, | 265 | static int raw_send_hdrinc(struct sock *sk, void *from, size_t length, |
266 | struct rtable *rt, | 266 | struct rtable *rt, |
267 | unsigned int flags) | 267 | unsigned int flags) |
268 | { | 268 | { |
269 | struct inet_sock *inet = inet_sk(sk); | 269 | struct inet_sock *inet = inet_sk(sk); |
@@ -285,7 +285,7 @@ static int raw_send_hdrinc(struct sock *sk, void *from, size_t length, | |||
285 | skb = sock_alloc_send_skb(sk, length+hh_len+15, | 285 | skb = sock_alloc_send_skb(sk, length+hh_len+15, |
286 | flags&MSG_DONTWAIT, &err); | 286 | flags&MSG_DONTWAIT, &err); |
287 | if (skb == NULL) | 287 | if (skb == NULL) |
288 | goto error; | 288 | goto error; |
289 | skb_reserve(skb, hh_len); | 289 | skb_reserve(skb, hh_len); |
290 | 290 | ||
291 | skb->priority = sk->sk_priority; | 291 | skb->priority = sk->sk_priority; |
@@ -326,7 +326,7 @@ error_fault: | |||
326 | kfree_skb(skb); | 326 | kfree_skb(skb); |
327 | error: | 327 | error: |
328 | IP_INC_STATS(IPSTATS_MIB_OUTDISCARDS); | 328 | IP_INC_STATS(IPSTATS_MIB_OUTDISCARDS); |
329 | return err; | 329 | return err; |
330 | } | 330 | } |
331 | 331 | ||
332 | static int raw_probe_proto_opt(struct flowi *fl, struct msghdr *msg) | 332 | static int raw_probe_proto_opt(struct flowi *fl, struct msghdr *msg) |
@@ -399,9 +399,9 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
399 | err = -EOPNOTSUPP; | 399 | err = -EOPNOTSUPP; |
400 | if (msg->msg_flags & MSG_OOB) /* Mirror BSD error message */ | 400 | if (msg->msg_flags & MSG_OOB) /* Mirror BSD error message */ |
401 | goto out; /* compatibility */ | 401 | goto out; /* compatibility */ |
402 | 402 | ||
403 | /* | 403 | /* |
404 | * Get and verify the address. | 404 | * Get and verify the address. |
405 | */ | 405 | */ |
406 | 406 | ||
407 | if (msg->msg_namelen) { | 407 | if (msg->msg_namelen) { |
@@ -426,7 +426,7 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
426 | */ | 426 | */ |
427 | } else { | 427 | } else { |
428 | err = -EDESTADDRREQ; | 428 | err = -EDESTADDRREQ; |
429 | if (sk->sk_state != TCP_ESTABLISHED) | 429 | if (sk->sk_state != TCP_ESTABLISHED) |
430 | goto out; | 430 | goto out; |
431 | daddr = inet->daddr; | 431 | daddr = inet->daddr; |
432 | } | 432 | } |
@@ -480,7 +480,7 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
480 | .saddr = saddr, | 480 | .saddr = saddr, |
481 | .tos = tos } }, | 481 | .tos = tos } }, |
482 | .proto = inet->hdrincl ? IPPROTO_RAW : | 482 | .proto = inet->hdrincl ? IPPROTO_RAW : |
483 | sk->sk_protocol, | 483 | sk->sk_protocol, |
484 | }; | 484 | }; |
485 | if (!inet->hdrincl) { | 485 | if (!inet->hdrincl) { |
486 | err = raw_probe_proto_opt(&fl, msg); | 486 | err = raw_probe_proto_opt(&fl, msg); |
@@ -489,7 +489,7 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
489 | } | 489 | } |
490 | 490 | ||
491 | security_sk_classify_flow(sk, &fl); | 491 | security_sk_classify_flow(sk, &fl); |
492 | err = ip_route_output_flow(&rt, &fl, sk, !(msg->msg_flags&MSG_DONTWAIT)); | 492 | err = ip_route_output_flow(&rt, &fl, sk, 1); |
493 | } | 493 | } |
494 | if (err) | 494 | if (err) |
495 | goto done; | 495 | goto done; |
@@ -503,9 +503,9 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
503 | back_from_confirm: | 503 | back_from_confirm: |
504 | 504 | ||
505 | if (inet->hdrincl) | 505 | if (inet->hdrincl) |
506 | err = raw_send_hdrinc(sk, msg->msg_iov, len, | 506 | err = raw_send_hdrinc(sk, msg->msg_iov, len, |
507 | rt, msg->msg_flags); | 507 | rt, msg->msg_flags); |
508 | 508 | ||
509 | else { | 509 | else { |
510 | if (!ipc.addr) | 510 | if (!ipc.addr) |
511 | ipc.addr = rt->rt_dst; | 511 | ipc.addr = rt->rt_dst; |
@@ -538,7 +538,7 @@ do_confirm: | |||
538 | 538 | ||
539 | static void raw_close(struct sock *sk, long timeout) | 539 | static void raw_close(struct sock *sk, long timeout) |
540 | { | 540 | { |
541 | /* | 541 | /* |
542 | * Raw sockets may have direct kernel refereneces. Kill them. | 542 | * Raw sockets may have direct kernel refereneces. Kill them. |
543 | */ | 543 | */ |
544 | ip_ra_control(sk, 0, NULL); | 544 | ip_ra_control(sk, 0, NULL); |
@@ -861,7 +861,7 @@ static __inline__ char *get_raw_sock(struct sock *sp, char *tmpbuf, int i) | |||
861 | 861 | ||
862 | sprintf(tmpbuf, "%4d: %08X:%04X %08X:%04X" | 862 | sprintf(tmpbuf, "%4d: %08X:%04X %08X:%04X" |
863 | " %02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %p", | 863 | " %02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %p", |
864 | i, src, srcp, dest, destp, sp->sk_state, | 864 | i, src, srcp, dest, destp, sp->sk_state, |
865 | atomic_read(&sp->sk_wmem_alloc), | 865 | atomic_read(&sp->sk_wmem_alloc), |
866 | atomic_read(&sp->sk_rmem_alloc), | 866 | atomic_read(&sp->sk_rmem_alloc), |
867 | 0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp), | 867 | 0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp), |
@@ -916,7 +916,7 @@ out_kfree: | |||
916 | goto out; | 916 | goto out; |
917 | } | 917 | } |
918 | 918 | ||
919 | static struct file_operations raw_seq_fops = { | 919 | static const struct file_operations raw_seq_fops = { |
920 | .owner = THIS_MODULE, | 920 | .owner = THIS_MODULE, |
921 | .open = raw_seq_open, | 921 | .open = raw_seq_open, |
922 | .read = seq_read, | 922 | .read = seq_read, |