Lines Matching refs:ipv6
41 #include <linux/ipv6.h>
137 * Check whether destination IPv6 is in allowed IPs list
139 static int dest_ip_allowed6(struct xdp_server *xdp, struct ipv6hdr *ipv6);
179 static inline void swap_ipv6(struct ipv6hdr *ipv6);
182 static inline void *parse_ipv6(struct ipv6hdr *ipv6);
556 static int dest_ip_allowed6(struct xdp_server *xdp, struct ipv6hdr *ipv6) {
565 &ipv6->daddr,
656 static inline void swap_ipv6(struct ipv6hdr *ipv6) {
658 memcpy(&tmp_ip, &ipv6->saddr, sizeof(tmp_ip));
659 memcpy(&ipv6->saddr, &ipv6->daddr, sizeof(tmp_ip));
660 memcpy(&ipv6->daddr, &tmp_ip, sizeof(tmp_ip));
677 static inline void *parse_ipv6(struct ipv6hdr *ipv6) {
678 if (ipv6->nexthdr != IPPROTO_UDP)
681 return (void *)(ipv6 + 1);
747 struct ipv6hdr *ipv6 = NULL;
753 * at least an ethernet header, an ipv4 header (ipv6 header is larger), and
763 ipv6 = (struct ipv6hdr *)(eth + 1);
765 if (*len < (sizeof(*eth) + sizeof(*ipv6) + sizeof(*udp)))
767 if (!(udp = parse_ipv6(ipv6)))
770 dnslen -= (uint32_t) (sizeof(*eth) + sizeof(*ipv6) + sizeof(*udp));
771 data_before_dnshdr_len += sizeof(*ipv6);
773 if (!dest_ip_allowed6(xdp, ipv6))
805 if(ipv6) {
812 memcpy(&sock6->sin6_addr, &ipv6->saddr, sizeof(ipv6->saddr));
853 } else if (ipv6) {
854 swap_ipv6(ipv6);
855 ipv6->payload_len = udp->len;
856 udp->check = calc_csum_udp6(udp, ipv6);