<commit_before>/**
 * @file
 * @brief The Internet Protocol (IP) module.
 *
 * @date 16.05.13
 * @author <NAME>
 */

#include <framework/net/proto/api.h>
#include <net/skbuff.h>
#include <embox/net/pack.h>
#include <net/l3/ipv6.h>
#include <net/netdevice.h>
#include <arpa/inet.h>

EMBOX_NET_PACK(ETH_P_IPV6, ip6_rcv);

#include <kernel/printk.h>
static int ip6_rcv(struct sk_buff *skb, struct net_device *dev) {
	ip6hdr_t *ip6h = ip6_hdr(skb);
	const struct net_proto *nproto;
	unsigned short len;

	if (ip6h->version != 6) {
		dev->stats.rx_err++;
		skb_free(skb);
		return 0; /* error: invalid hdr */
	}

	len = ntohs(ip6h->payload_len);
	if (len + IP6_HEADER_SIZE > skb->len) {
		dev->stats.rx_length_errors++;
		skb_free(skb);
		return 0; /* error: invalid length */
	}

	/* Setup transport layer header */
	skb->h.raw = skb->nh.raw + IP6_HEADER_SIZE;

	nproto = net_proto_lookup(ip6h->nexthdr);
	if (nproto != NULL) {
		return nproto->handle(skb);
	}

	printk("ipv6 packet accepted, %#x\n", ip6h->nexthdr);

	skb_free(skb);
	return 0; /* error: nobody wants this packet */
}<commit_msg>ipv6 debug out commented out<commit_after>/**
 * @file
 * @brief The Internet Protocol (IP) module.
 *
 * @date 16.05.13
 * @author <NAME>
 */

#include <framework/net/proto/api.h>
#include <net/skbuff.h>
#include <embox/net/pack.h>
#include <net/l3/ipv6.h>
#include <net/netdevice.h>
#include <arpa/inet.h>

EMBOX_NET_PACK(ETH_P_IPV6, ip6_rcv);

#include <kernel/printk.h>
static int ip6_rcv(struct sk_buff *skb, struct net_device *dev) {
	ip6hdr_t *ip6h = ip6_hdr(skb);
	const struct net_proto *nproto;
	unsigned short len;

	if (ip6h->version != 6) {
		dev->stats.rx_err++;
		skb_free(skb);
		return 0; /* error: invalid hdr */
	}

	len = ntohs(ip6h->payload_len);
	if (len + IP6_HEADER_SIZE > skb->len) {
		dev->stats.rx_length_errors++;
		skb_free(skb);
		return 0; /* error: invalid length */
	}

	/* Setup transport layer header */
	skb->h.raw = skb->nh.raw + IP6_HEADER_SIZE;

	nproto = net_proto_lookup(ip6h->nexthdr);
	if (nproto != NULL) {
		return nproto->handle(skb);
	}

//	printk("ipv6 packet accepted, %#x\n", ip6h->nexthdr);

	skb_free(skb);
	return 0; /* error: nobody wants this packet */
}
{'fraction_non_alphanumeric': 0.16901408450704225, 'fraction_numerical': 0.023171285779191277, 'mean_word_length': 3.993197278911565, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4894110', 'n_tokens_mistral': 939, 'n_tokens_neox': 903, 'n_words': 196}