--- linux/include/linux/wanrouter.h.sdla_skbprotocol	Tue Apr 11 14:13:22 2000
+++ linux/include/linux/wanrouter.h	Tue Apr 11 14:28:18 2000
@@ -496,7 +496,7 @@
 extern int register_wan_device(wan_device_t *wandev);
 extern int unregister_wan_device(char *name);
 unsigned short wanrouter_type_trans(struct sk_buff *skb, struct device *dev);
-int wanrouter_encapsulate(struct sk_buff *skb, struct device *dev);
+int wanrouter_encapsulate(struct sk_buff *skb, struct device *dev, unsigned short type);
 
 /* Proc interface functions. These must not be called by the drivers! */
 extern int wanrouter_proc_init(void);
--- linux/net/wanrouter/wanmain.c.sdla_skbprotocol	Tue Apr 11 14:13:22 2000
+++ linux/net/wanrouter/wanmain.c	Tue Apr 11 14:28:18 2000
@@ -367,11 +367,12 @@
  */
 
 
-int wanrouter_encapsulate (struct sk_buff *skb, struct device *dev)
+int wanrouter_encapsulate (struct sk_buff *skb, struct device *dev,
+	unsigned short type)
 {
 	int hdr_len = 0;
 
-	switch (skb->protocol) {
+	switch (type) {
 	case ETH_P_IP:		/* IP datagram encapsulation */
 		hdr_len += 1;
 		skb_push(skb, 1);
@@ -385,13 +386,13 @@
 		skb->data[0] = 0;
 		skb->data[1] = NLPID_SNAP;
 		memcpy(&skb->data[2], oui_ether, sizeof(oui_ether));
-		*((unsigned short*)&skb->data[5]) = htons(skb->protocol);
+		*((unsigned short*)&skb->data[5]) = htons(type);
 		break;
 
 	default:		/* Unknown packet type */
 		printk(KERN_INFO
 			"%s: unsupported Ethertype 0x%04X on interface %s!\n",
-			modname, skb->protocol, dev->name);
+			modname, type, dev->name);
 		hdr_len = -EINVAL;
 	}
 	return hdr_len;
--- linux/drivers/net/sdla_fr.c.sdla_skbprotocol	Tue Apr 11 14:13:25 2000
+++ linux/drivers/net/sdla_fr.c	Tue Apr 11 14:28:18 2000
@@ -1184,12 +1184,12 @@
 {
 	int hdr_len = 0;
 	
-	skb->protocol = type;
-	hdr_len = wanrouter_encapsulate(skb, dev);
+	skb->protocol = htons(type);
+	hdr_len = wanrouter_encapsulate(skb, dev, type);
 
 	if (hdr_len < 0) {
 		hdr_len = 0;
-		skb->protocol = 0;
+		skb->protocol = htons(0);
 	}
 	skb_push(skb, 1);
 	skb->data[0] = Q922_UI;
@@ -1376,7 +1376,12 @@
 	} else if (!is_tx_ready(card, chan)) {
 		setup_for_delayed_transmit(dev, data, len);
 		chan->drvstats_if_send.if_send_no_bfrs++;
- 	} else {
+
+	} else if (!skb->protocol) {
+		chan->drvstats_if_send.if_send_protocol_error ++;
+		++card->wandev.stats.tx_errors;
+	
+	} else {
 		send_data = 1;
 		//FIXME: IPX is not implemented in this version of Frame Relay ?
 		if((chan->common.usedby == WANPIPE) &&
--- linux/drivers/net/sdla_x25.c.sdla_skbprotocol	Tue Apr 11 14:13:24 2000
+++ linux/drivers/net/sdla_x25.c	Tue Apr 11 16:04:44 2000
@@ -804,7 +804,7 @@
                 printk(KERN_INFO "%s: Running in WANPIPE mode %s\n",
 			wandev->name, chan->name);
                 chan->common.usedby = WANPIPE;
-		chan->protocol = ETH_P_IP;
+		chan->protocol = htons(ETH_P_IP);
 
         }else if(strcmp(conf->usedby, "API") == 0){
 		chan->common.usedby = API;
@@ -821,7 +821,7 @@
 	
 	chan->enable_IPX = conf->enable_IPX;
 	if (chan->enable_IPX)
-		chan->protocol = ETH_P_IPX;
+		chan->protocol = htons(ETH_P_IPX);
 	if (conf->network_number)
 		chan->network_number = conf->network_number;
 	else
@@ -1072,12 +1072,12 @@
 	x25_channel_t* chan = dev->priv;
 	int hdr_len = dev->hard_header_len;
 	
-	skb->protocol = type;
+	skb->protocol = htons(type);
 	if (!chan->protocol){
-		hdr_len = wanrouter_encapsulate(skb, dev);
+		hdr_len = wanrouter_encapsulate(skb, dev, type);
 		if (hdr_len < 0){
 			hdr_len = 0;
-			skb->protocol = 0;
+			skb->protocol = htons(0);
 		}
 	}
 	return hdr_len;
@@ -1203,9 +1203,9 @@
 	}else if ( chan->protocol && (chan->protocol != skb->protocol)){
 		printk(KERN_INFO
 			"%s: unsupported Ethertype 0x%04X on interface %s!\n",
-			chan->name, skb->protocol, dev->name);
+			chan->name, htons(skb->protocol), dev->name);
 		
-		printk(KERN_INFO "PROTO %Xn", chan->protocol);
+		printk(KERN_INFO "PROTO %Xn", htons(chan->protocol));
 		++chan->ifstats.tx_errors;
 		++chan->ifstats.tx_dropped;
 		++card->wandev.stats.tx_dropped;
@@ -1231,7 +1231,7 @@
 			/* fall through */
 
 		case WAN_CONNECTED:
-			if( skb->protocol == ETH_P_IPX) {
+			if( skb->protocol == htons(ETH_P_IPX)) {
 				if(chan->enable_IPX) {
 					switch_net_numbers( skb->data, 
 						chan->network_number, 0);
@@ -2508,9 +2508,9 @@
 	char str[64];
 
 
-	if (chan->protocol == ETH_P_IP)
+	if (chan->protocol == htons(ETH_P_IP))
 		sprintf(str, "-d%s -uCC", chan->addr);
-	if (chan->protocol == ETH_P_IPX)
+	if (chan->protocol == htons(ETH_P_IPX))
 		sprintf(str, "-d%s -u800000008137", chan->addr);
 	do
 	{
@@ -2902,13 +2902,15 @@
 		if (!chan->common.svc || (chan->common.state != WAN_DISCONNECTED))
 			continue
 		;
-		if (user_data == NLPID_IP && chan->protocol != ETH_P_IP){
-			printk(KERN_INFO "IP packet but configured for IPX : %x, %x\n", chan->protocol, info->user[0]);
+		if (user_data == NLPID_IP && chan->protocol != htons(ETH_P_IP)){
+			printk(KERN_INFO "IP packet but configured for IPX : %x, %x\n",
+				       htons(chan->protocol), info->user[0]);
 			continue;
 		}
 	
-		if (user_data == NLPID_SNAP && chan->protocol != ETH_P_IPX){
-			printk(KERN_INFO "IPX packet but configured for IP: %x\n", chan->protocol);
+		if (user_data == NLPID_SNAP && chan->protocol != htons(ETH_P_IPX)){
+			printk(KERN_INFO "IPX packet but configured for IP: %x\n",
+				       htons(chan->protocol));
 			continue;
 		}
 		if (strcmp(info->src, chan->addr) == 0)
@@ -2949,7 +2951,7 @@
 	}else switch (info->user[0]){
 
 		case 0:		/* multiplexed */
-			chan->protocol = 0;
+			chan->protocol = htons(0);
 			accept = 1;
 			break;
 
