raw.c (8a517c514d5893602cf85c1b4c47afbbc04d2198) | raw.c (6ce9e7b5fe3195d1ae6e3a0753d4ddcac5cd699e) |
---|---|
1/* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * RAW - implementation of IP "raw" sockets. 7 * 8 * Authors: Ross Biro --- 361 unchanged lines hidden (view full) --- 370 } 371 if (iph->protocol == IPPROTO_ICMP) 372 icmp_out_count(net, ((struct icmphdr *) 373 skb_transport_header(skb))->type); 374 375 err = NF_HOOK(PF_INET, NF_INET_LOCAL_OUT, skb, NULL, rt->u.dst.dev, 376 dst_output); 377 if (err > 0) | 1/* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * RAW - implementation of IP "raw" sockets. 7 * 8 * Authors: Ross Biro --- 361 unchanged lines hidden (view full) --- 370 } 371 if (iph->protocol == IPPROTO_ICMP) 372 icmp_out_count(net, ((struct icmphdr *) 373 skb_transport_header(skb))->type); 374 375 err = NF_HOOK(PF_INET, NF_INET_LOCAL_OUT, skb, NULL, rt->u.dst.dev, 376 dst_output); 377 if (err > 0) |
378 err = inet->recverr ? net_xmit_errno(err) : 0; | 378 err = net_xmit_errno(err); |
379 if (err) 380 goto error; 381out: 382 return 0; 383 384error_fault: 385 err = -EFAULT; 386 kfree_skb(skb); 387error: 388 IP_INC_STATS(net, IPSTATS_MIB_OUTDISCARDS); | 379 if (err) 380 goto error; 381out: 382 return 0; 383 384error_fault: 385 err = -EFAULT; 386 kfree_skb(skb); 387error: 388 IP_INC_STATS(net, IPSTATS_MIB_OUTDISCARDS); |
389 if (err == -ENOBUFS && !inet->recverr) 390 err = 0; |
|
389 return err; 390} 391 392static int raw_probe_proto_opt(struct flowi *fl, struct msghdr *msg) 393{ 394 struct iovec *iov; 395 u8 __user *type = NULL; 396 u8 __user *code = NULL; --- 174 unchanged lines hidden (view full) --- 571 else { 572 if (!ipc.addr) 573 ipc.addr = rt->rt_dst; 574 lock_sock(sk); 575 err = ip_append_data(sk, ip_generic_getfrag, msg->msg_iov, len, 0, 576 &ipc, &rt, msg->msg_flags); 577 if (err) 578 ip_flush_pending_frames(sk); | 391 return err; 392} 393 394static int raw_probe_proto_opt(struct flowi *fl, struct msghdr *msg) 395{ 396 struct iovec *iov; 397 u8 __user *type = NULL; 398 u8 __user *code = NULL; --- 174 unchanged lines hidden (view full) --- 573 else { 574 if (!ipc.addr) 575 ipc.addr = rt->rt_dst; 576 lock_sock(sk); 577 err = ip_append_data(sk, ip_generic_getfrag, msg->msg_iov, len, 0, 578 &ipc, &rt, msg->msg_flags); 579 if (err) 580 ip_flush_pending_frames(sk); |
579 else if (!(msg->msg_flags & MSG_MORE)) | 581 else if (!(msg->msg_flags & MSG_MORE)) { |
580 err = ip_push_pending_frames(sk); | 582 err = ip_push_pending_frames(sk); |
583 if (err == -ENOBUFS && !inet->recverr) 584 err = 0; 585 } |
|
581 release_sock(sk); 582 } 583done: 584 if (free) 585 kfree(ipc.opt); 586 ip_rt_put(rt); 587 588out: --- 431 unchanged lines hidden --- | 586 release_sock(sk); 587 } 588done: 589 if (free) 590 kfree(ipc.opt); 591 ip_rt_put(rt); 592 593out: --- 431 unchanged lines hidden --- |