patch-2.1.126 linux/drivers/net/syncppp.c

Next file: linux/drivers/net/syncppp.h
Previous file: linux/drivers/net/sktr.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.125/linux/drivers/net/syncppp.c linux/drivers/net/syncppp.c
@@ -770,6 +770,7 @@
 	sp->obytes += skb->len;
 	/* Control is high priority so it doesnt get queued behind data */
 	skb->priority=1;
+	skb->dev = dev;
 	dev_queue_xmit(skb);
 }
 
@@ -811,6 +812,7 @@
 			ch->par2, ch->rel, ch->time0, ch->time1);
 	sp->obytes += skb->len;
 	skb->priority=1;
+	skb->dev = dev;
 	dev_queue_xmit(skb);
 }
 
@@ -861,9 +863,20 @@
 	{
 		case SPPPIOCCISCO:
 			sp->pp_flags|=PP_CISCO;
+			dev->type = ARPHRD_HDLC;
 			break;
 		case SPPPIOCPPP:
 			sp->pp_flags&=~PP_CISCO;
+			dev->type = ARPHRD_PPP;
+			break;
+		case SPPPIOCDEBUG:
+			sp->pp_flags&=~PP_DEBUG;
+			if(ifr->ifr_flags)
+			{
+				if(!capable(CAP_NET_ADMIN))
+					return -EPERM;
+				sp->pp_flags|=PP_DEBUG;
+			}
 			break;
 		default:
 			return -EINVAL;
@@ -908,7 +921,7 @@
 	dev->hard_header = sppp_hard_header;
 	dev->rebuild_header = sppp_rebuild_header;
 	dev->tx_queue_len = 10;
-	dev->type = ARPHRD_PPP;
+	dev->type = ARPHRD_HDLC;
 	dev->addr_len = 0;
 	dev->hard_header_len = sizeof(struct ppp_header);
 	dev->mtu = PPP_MTU;
@@ -924,7 +937,7 @@
 	dev->change_mtu = sppp_change_mtu;
 	dev->hard_header_cache = NULL;
 	dev->header_cache_update = NULL;
-	dev->flags = IFF_MULTICAST;
+	dev->flags = IFF_MULTICAST|IFF_POINTOPOINT|IFF_NOARP;
 	dev_init_buffers(dev);
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov