code: plan9front

Download patch

ref: a65ab6daec833827ff991cbc1eee2a70fa3e4efb
parent: 1be331f2084e094f6322744083012b4e394f39fd
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun May 21 14:11:25 EDT 2023

ip/ppp, ip/pppoe: remove -e flag again (sorry)

This only works when we'r not already having a interface
bound to that ethernet. Otherwise ipconfig can get
confused and adds the addresses to the wrong interface.

--- a/sys/man/8/ppp
+++ b/sys/man/8/ppp
@@ -20,9 +20,6 @@
 ] [
 .B -p
 .I dev
-|
-.B -e
-.I dev
 ] [
 .B -x
 .I netmntpt
@@ -127,12 +124,6 @@
 .TP
 .B C
 disallow IP header compression
-.TP
-.B e
-assigns
-.I dev
-to the packet interface device (for identification only),
-but otherwise communicates over standard I/O.
 .TP
 .B f
 make PPP add HDLC framing.  This is necessary when using
--- a/sys/src/cmd/ip/ppp/ppp.c
+++ b/sys/src/cmd/ip/ppp/ppp.c
@@ -2845,7 +2845,7 @@
 usage(void)
 {
 	fprint(2, "usage: ppp [-CPSacdfu] [-b baud] [-k keyspec] [-m mtu] "
-		"[-M chatfile] [-p dev | -e etherdev] [-x netmntpt] [-t modemcmd] [-U duid] "
+		"[-M chatfile] [-p dev] [-x netmntpt] [-t modemcmd] [-U duid] "
 		"[local-addr [remote-addr]]\n");
 	exits("usage");
 }
@@ -2856,7 +2856,7 @@
 	static PPP ppp[1];
 	int mtu, framing, user, mediain, mediaout, cfd;
 	Ipaddr ipaddr[2], remip[2];
-	char *dev, *ether, *duid, *modemcmd;
+	char *dev, *duid, *modemcmd;
 	char net[128];
 	int pfd[2];
 	char buf[128];
@@ -2873,7 +2873,6 @@
 	invalidate(remip[1]);
 
 	dev = nil;
-	ether = nil;
 	mtu = Defmtu;
 	framing = 0;
 	duid = nil;
@@ -2899,9 +2898,6 @@
 	case 'd':
 		debug++;
 		break;
-	case 'e':
-		ether = EARGF(usage());
-		break;
 	case 'f':
 		framing = 1;
 		break;
@@ -3021,8 +3017,6 @@
 			fprint(2, "%s: couldn't open /fd/0\n", argv0);
 			exits("/fd/1");
 		}
-		/* use the ethernet from pppoe to identify the interface */
-		dev = ether;
 	}
 	if(modemcmd != nil && mediaout >= 0)
 		fprint(mediaout, "%s\r", modemcmd);
--- a/sys/src/cmd/ip/pppoe.c
+++ b/sys/src/cmd/ip/pppoe.c
@@ -12,7 +12,7 @@
 void hexdump(uchar*, int);
 int malformed(uchar*, int, int);
 int pppoe(char*);
-void execppp(char*, int);
+void execppp(int);
 
 int primary;
 int forked;
@@ -140,7 +140,7 @@
 	}
 
 	atnotify(catchalarm, 1);
-	execppp(dev, pppoe(dev));
+	execppp(pppoe(dev));
 }
 
 typedef struct Etherhdr Etherhdr;
@@ -616,7 +616,7 @@
 }
 
 void
-execppp(char *dev, int fd)
+execppp(int fd)
 {
 	char smtu[10];
 	char *argv[20];
@@ -629,10 +629,6 @@
 	argv[argc++] = "-F";
 	if(debug)
 		argv[argc++] = "-d";
-	if(dev){
-		argv[argc++] = "-e";
-		argv[argc++] = dev;
-	}
 	if(primary)
 		argv[argc++] = "-P";
 	if(baud){