raw.c (8a517c514d5893602cf85c1b4c47afbbc04d2198) | raw.c (6ce9e7b5fe3195d1ae6e3a0753d4ddcac5cd699e) |
---|---|
1/* 2 * RAW sockets for IPv6 3 * Linux INET6 implementation 4 * 5 * Authors: 6 * Pedro Roque <roque@di.fc.ul.pt> 7 * 8 * Adapted from linux/net/ipv4/raw.c --- 628 unchanged lines hidden (view full) --- 637 err = memcpy_fromiovecend((void *)iph, from, 0, length); 638 if (err) 639 goto error_fault; 640 641 IP6_UPD_PO_STATS(sock_net(sk), rt->rt6i_idev, IPSTATS_MIB_OUT, skb->len); 642 err = NF_HOOK(PF_INET6, NF_INET_LOCAL_OUT, skb, NULL, rt->u.dst.dev, 643 dst_output); 644 if (err > 0) | 1/* 2 * RAW sockets for IPv6 3 * Linux INET6 implementation 4 * 5 * Authors: 6 * Pedro Roque <roque@di.fc.ul.pt> 7 * 8 * Adapted from linux/net/ipv4/raw.c --- 628 unchanged lines hidden (view full) --- 637 err = memcpy_fromiovecend((void *)iph, from, 0, length); 638 if (err) 639 goto error_fault; 640 641 IP6_UPD_PO_STATS(sock_net(sk), rt->rt6i_idev, IPSTATS_MIB_OUT, skb->len); 642 err = NF_HOOK(PF_INET6, NF_INET_LOCAL_OUT, skb, NULL, rt->u.dst.dev, 643 dst_output); 644 if (err > 0) |
645 err = np->recverr ? net_xmit_errno(err) : 0; | 645 err = net_xmit_errno(err); |
646 if (err) 647 goto error; 648out: 649 return 0; 650 651error_fault: 652 err = -EFAULT; 653 kfree_skb(skb); 654error: 655 IP6_INC_STATS(sock_net(sk), rt->rt6i_idev, IPSTATS_MIB_OUTDISCARDS); | 646 if (err) 647 goto error; 648out: 649 return 0; 650 651error_fault: 652 err = -EFAULT; 653 kfree_skb(skb); 654error: 655 IP6_INC_STATS(sock_net(sk), rt->rt6i_idev, IPSTATS_MIB_OUTDISCARDS); |
656 if (err == -ENOBUFS && !np->recverr) 657 err = 0; |
|
656 return err; 657} 658 659static int rawv6_probe_proto_opt(struct flowi *fl, struct msghdr *msg) 660{ 661 struct iovec *iov; 662 u8 __user *type = NULL; 663 u8 __user *code = NULL; --- 208 unchanged lines hidden (view full) --- 872 if (ipv6_addr_is_multicast(&fl.fl6_dst)) 873 hlimit = np->mcast_hops; 874 else 875 hlimit = np->hop_limit; 876 if (hlimit < 0) 877 hlimit = ip6_dst_hoplimit(dst); 878 } 879 | 658 return err; 659} 660 661static int rawv6_probe_proto_opt(struct flowi *fl, struct msghdr *msg) 662{ 663 struct iovec *iov; 664 u8 __user *type = NULL; 665 u8 __user *code = NULL; --- 208 unchanged lines hidden (view full) --- 874 if (ipv6_addr_is_multicast(&fl.fl6_dst)) 875 hlimit = np->mcast_hops; 876 else 877 hlimit = np->hop_limit; 878 if (hlimit < 0) 879 hlimit = ip6_dst_hoplimit(dst); 880 } 881 |
880 if (tclass < 0) { | 882 if (tclass < 0) |
881 tclass = np->tclass; | 883 tclass = np->tclass; |
882 if (tclass < 0) 883 tclass = 0; 884 } | |
885 886 if (msg->msg_flags&MSG_CONFIRM) 887 goto do_confirm; 888 889back_from_confirm: 890 if (inet->hdrincl) { 891 err = rawv6_send_hdrinc(sk, msg->msg_iov, len, &fl, (struct rt6_info*)dst, msg->msg_flags); 892 } else { --- 469 unchanged lines hidden --- | 884 885 if (msg->msg_flags&MSG_CONFIRM) 886 goto do_confirm; 887 888back_from_confirm: 889 if (inet->hdrincl) { 890 err = rawv6_send_hdrinc(sk, msg->msg_iov, len, &fl, (struct rt6_info*)dst, msg->msg_flags); 891 } else { --- 469 unchanged lines hidden --- |