Merge remote-tracking branch 'origin/nasmesh_new_kernel' into develop_integration_2018_w36
This commit is contained in:
@@ -410,7 +410,7 @@ struct cx_entity *nas_CLASS_cx6(struct sk_buff *skb,
|
|||||||
#endif //NAS_DEBUG_CLASS
|
#endif //NAS_DEBUG_CLASS
|
||||||
|
|
||||||
//if ((dst = (unsigned int*)&(((struct rt6_info *)skbdst)->rt6i_gateway)) == 0){
|
//if ((dst = (unsigned int*)&(((struct rt6_info *)skbdst)->rt6i_gateway)) == 0){
|
||||||
if ((dst = ((struct iphdr*)(skb_network_header(skb)))->daddr) == 0) {
|
if ( (dst = &((struct iphdr*)(skb_network_header(skb)))->daddr) == NULL) {
|
||||||
|
|
||||||
printk("nas_CLASS_cx6: dst addr is null \n");
|
printk("nas_CLASS_cx6: dst addr is null \n");
|
||||||
p = p->next;
|
p = p->next;
|
||||||
@@ -475,7 +475,7 @@ struct cx_entity *nas_CLASS_cx4(struct sk_buff *skb,
|
|||||||
if (skb!=NULL) {
|
if (skb!=NULL) {
|
||||||
daddr = ((struct iphdr*)(skb_network_header(skb)))->daddr;
|
daddr = ((struct iphdr*)(skb_network_header(skb)))->daddr;
|
||||||
|
|
||||||
if (daddr!=NULL) {
|
if (daddr!=0) {
|
||||||
|
|
||||||
#ifdef NAS_DEBUG_CLASS
|
#ifdef NAS_DEBUG_CLASS
|
||||||
printk("[NAS][CLASS][IPv4] Searching for %d.%d.%d.%d\n",
|
printk("[NAS][CLASS][IPv4] Searching for %d.%d.%d.%d\n",
|
||||||
|
|||||||
@@ -53,17 +53,14 @@ void nas_COMMON_receive(uint16_t dlen,
|
|||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
struct ipversion *ipv;
|
struct ipversion *ipv;
|
||||||
struct nas_priv *gpriv=netdev_priv(nasdev[inst]);
|
struct nas_priv *gpriv=netdev_priv(nasdev[inst]);
|
||||||
uint32_t odaddr,osaddr;
|
|
||||||
|
|
||||||
//int i;
|
//int i;
|
||||||
|
|
||||||
unsigned char protocol;
|
unsigned char protocol;
|
||||||
|
|
||||||
unsigned char /**addr,*/ *daddr,*saddr,*ifaddr /*,sn*/;
|
|
||||||
|
|
||||||
//struct udphdr *uh;
|
//struct udphdr *uh;
|
||||||
//struct tcphdr *th;
|
//struct tcphdr *th;
|
||||||
uint16_t *cksum,check;
|
|
||||||
|
|
||||||
struct iphdr *network_header;
|
struct iphdr *network_header;
|
||||||
|
|
||||||
@@ -114,11 +111,12 @@ void nas_COMMON_receive(uint16_t dlen,
|
|||||||
// Make the third byte of both the source and destination equal to the fourth of the destination
|
// Make the third byte of both the source and destination equal to the fourth of the destination
|
||||||
|
|
||||||
|
|
||||||
|
unsigned char * ifaddr, *saddr, daddr;
|
||||||
daddr = (unsigned char *)&((struct iphdr *)skb->data)->daddr;
|
daddr = (unsigned char *)&((struct iphdr *)skb->data)->daddr;
|
||||||
odaddr = ((struct iphdr *)skb->data)->daddr;
|
odaddr = ((struct iphdr *)skb->data)->daddr;
|
||||||
// sn = addr[3];
|
// sn = addr[3];
|
||||||
saddr = (unsigned char *)&((struct iphdr *)skb->data)->saddr;
|
saddr = (unsigned char *)&((struct iphdr *)skb->data)->saddr;
|
||||||
|
uint32_t odaddr,osaddr;
|
||||||
osaddr = ((struct iphdr *)skb->data)->saddr;
|
osaddr = ((struct iphdr *)skb->data)->saddr;
|
||||||
|
|
||||||
if (daddr[0] == saddr[0]) {// same network
|
if (daddr[0] == saddr[0]) {// same network
|
||||||
@@ -219,6 +217,7 @@ void nas_COMMON_receive(uint16_t dlen,
|
|||||||
|
|
||||||
case IPPROTO_TCP:
|
case IPPROTO_TCP:
|
||||||
|
|
||||||
|
uint16_t *cksum,check;
|
||||||
cksum = (uint16_t*)&(((struct tcphdr*)(((char *)network_header + (network_header->ihl<<2))))->check);
|
cksum = (uint16_t*)&(((struct tcphdr*)(((char *)network_header + (network_header->ihl<<2))))->check);
|
||||||
//check = csum_tcpudp_magic(((struct iphdr *)network_header)->saddr, ((struct iphdr *)network_header)->daddr, tcp_hdrlen(skb), IPPROTO_TCP, ~(*cksum));
|
//check = csum_tcpudp_magic(((struct iphdr *)network_header)->saddr, ((struct iphdr *)network_header)->daddr, tcp_hdrlen(skb), IPPROTO_TCP, ~(*cksum));
|
||||||
|
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ int nas_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||||||
|
|
||||||
// End debug information
|
// End debug information
|
||||||
netif_stop_queue(dev);
|
netif_stop_queue(dev);
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) || RHEL_RELEASE_CODE>=1796
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) || (defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE>=1796)
|
||||||
netif_trans_update(dev);
|
netif_trans_update(dev);
|
||||||
#else
|
#else
|
||||||
dev->trans_start = jiffies;
|
dev->trans_start = jiffies;
|
||||||
@@ -306,7 +306,7 @@ void nas_tx_timeout(struct net_device *dev)
|
|||||||
printk("TX_TIMEOUT: begin\n");
|
printk("TX_TIMEOUT: begin\n");
|
||||||
// (struct nas_priv *)(dev->priv)->stats.tx_errors++;
|
// (struct nas_priv *)(dev->priv)->stats.tx_errors++;
|
||||||
(priv->stats).tx_errors++;
|
(priv->stats).tx_errors++;
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) || RHEL_RELEASE_CODE>=1796
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) || (defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE>=1796)
|
||||||
netif_trans_update(dev);
|
netif_trans_update(dev);
|
||||||
#else
|
#else
|
||||||
dev->trans_start = jiffies;
|
dev->trans_start = jiffies;
|
||||||
@@ -324,7 +324,7 @@ static const struct net_device_ops nasmesh_netdev_ops = {
|
|||||||
.ndo_set_mac_address = NULL,
|
.ndo_set_mac_address = NULL,
|
||||||
.ndo_set_config = nas_set_config,
|
.ndo_set_config = nas_set_config,
|
||||||
.ndo_do_ioctl = nas_CTL_ioctl,
|
.ndo_do_ioctl = nas_CTL_ioctl,
|
||||||
#if RHEL_RELEASE_CODE>=1797
|
#if (defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE>=1797)
|
||||||
.extended.ndo_change_mtu = nas_change_mtu,
|
.extended.ndo_change_mtu = nas_change_mtu,
|
||||||
#else
|
#else
|
||||||
.ndo_change_mtu = nas_change_mtu,
|
.ndo_change_mtu = nas_change_mtu,
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include <linux/version.h>
|
||||||
#include "local.h"
|
#include "local.h"
|
||||||
#include "proto_extern.h"
|
#include "proto_extern.h"
|
||||||
|
|
||||||
@@ -155,10 +155,18 @@ void nas_mesh_start_default_sclassifier(struct cx_entity *cx,struct rb_entity *r
|
|||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
|
||||||
|
void nas_mesh_timer(struct timer_list *t)
|
||||||
|
#else
|
||||||
void nas_mesh_timer(unsigned long data)
|
void nas_mesh_timer(unsigned long data)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
|
||||||
|
struct nas_priv *gpriv=from_timer(gpriv, t, timer);
|
||||||
|
#else
|
||||||
struct nas_priv *gpriv=(struct nas_priv *) data;
|
struct nas_priv *gpriv=(struct nas_priv *) data;
|
||||||
|
#endif
|
||||||
uint8_t cxi;
|
uint8_t cxi;
|
||||||
struct cx_entity *cx;
|
struct cx_entity *cx;
|
||||||
struct rb_entity *rb;
|
struct rb_entity *rb;
|
||||||
@@ -166,10 +174,14 @@ void nas_mesh_timer(unsigned long data)
|
|||||||
#ifdef NAS_DEBUG_TIMER
|
#ifdef NAS_DEBUG_TIMER
|
||||||
printk("NAS_MESH_TIMER - begin \n");
|
printk("NAS_MESH_TIMER - begin \n");
|
||||||
#endif
|
#endif
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
|
||||||
|
timer_setup(&gpriv->timer, nas_mesh_timer, 0);
|
||||||
|
mod_timer(&gpriv->timer, jiffies+NAS_TIMER_TICK);
|
||||||
|
#else
|
||||||
(gpriv->timer).function=nas_mesh_timer;
|
(gpriv->timer).function=nas_mesh_timer;
|
||||||
(gpriv->timer).expires=jiffies+NAS_TIMER_TICK;
|
(gpriv->timer).expires=jiffies+NAS_TIMER_TICK;
|
||||||
(gpriv->timer).data=data;
|
(gpriv->timer).data=data;
|
||||||
|
#endif
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -195,7 +195,6 @@ void nas_mesh_init(int inst //!< Instance ID
|
|||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
void nas_mesh_timer(unsigned long data);
|
|
||||||
|
|
||||||
int nas_mesh_DC_receive(struct cx_entity *cx,struct nas_priv *gpriv);
|
int nas_mesh_DC_receive(struct cx_entity *cx,struct nas_priv *gpriv);
|
||||||
int nas_mesh_GC_receive(struct nas_priv *gpriv);
|
int nas_mesh_GC_receive(struct nas_priv *gpriv);
|
||||||
|
|||||||
@@ -679,11 +679,11 @@ void print_TOOL_pk_all(struct sk_buff *skb)
|
|||||||
|
|
||||||
switch (ntohs(skb->protocol)) {
|
switch (ntohs(skb->protocol)) {
|
||||||
case ETH_P_IPV6:
|
case ETH_P_IPV6:
|
||||||
print_TOOL_pk_ipv6((struct ipv6hdr *)skb->network_header);
|
print_TOOL_pk_ipv6((struct ipv6hdr *)skb_network_header(skb));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ETH_P_IP:
|
case ETH_P_IP:
|
||||||
print_TOOL_pk_ipv4((struct iphdr *)skb->network_header);
|
print_TOOL_pk_ipv4((struct iphdr *)skb_network_header(skb));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user