--- zzzz-none-000/linux-4.4.60/net/ipv4/af_inet.c 2017-04-08 07:53:53.000000000 +0000 +++ scorpion-7490-727/linux-4.4.60/net/ipv4/af_inet.c 2021-02-04 17:41:59.000000000 +0000 @@ -121,6 +121,9 @@ #endif #include +#ifdef CONFIG_AVM_PA +#include +#endif /* The inetsw table contains everything that inet_create needs to * build a new socket. @@ -1321,8 +1324,8 @@ if (unlikely(ip_fast_csum((u8 *)iph, 5))) goto out_unlock; - id = ntohl(*(__be32 *)&iph->id); - flush = (u16)((ntohl(*(__be32 *)iph) ^ skb_gro_len(skb)) | (id & ~IP_DF)); + id = ntohl(net_hdr_word(&iph->id)); + flush = (u16)((ntohl(net_hdr_word(iph)) ^ skb_gro_len(skb)) | (id & ~IP_DF)); id >>= 16; for (p = *head; p; p = p->next) { @@ -1808,6 +1811,18 @@ ipfrag_init(); +#ifdef CONFIG_AVM_PA + { + struct avm_pa_pid_cfg cfg; + snprintf(cfg.name, sizeof(cfg.name), "ipv4"); + cfg.framing = avm_pa_framing_ptype; + cfg.default_mtu = 0xffff; + cfg.ptype = &ip_packet_type; + if(avm_pa_dev_pid_register(AVM_PA_PTYPE_DEVINFO(&ip_packet_type), &cfg) < 0) + printk(KERN_ERR "%s: failed to register PA PID\n", cfg.name); + } +#endif + dev_add_pack(&ip_packet_type); ip_tunnel_core_init();