OpenWrt – Diff between revs 2 and 3

Subversion Repositories:
Rev:
Show entire fileIgnore whitespace
Rev 2 Rev 3
Line 145... Line 145...
145 conn->acName = acName; 145 conn->acName = acName;
146 conn->serviceName = pppd_pppoe_service; 146 conn->serviceName = pppd_pppoe_service;
147 strlcpy(ppp_devnam, devnam, sizeof(ppp_devnam)); 147 strlcpy(ppp_devnam, devnam, sizeof(ppp_devnam));
148 --- a/pppd/plugins/rp-pppoe/pppoe-discovery.c 148 --- a/pppd/plugins/rp-pppoe/pppoe-discovery.c
149 +++ b/pppd/plugins/rp-pppoe/pppoe-discovery.c 149 +++ b/pppd/plugins/rp-pppoe/pppoe-discovery.c
150 @@ -356,7 +356,7 @@ packetIsForMe(PPPoEConnection *conn, PPP 150 @@ -348,7 +348,7 @@ packetIsForMe(PPPoEConnection *conn, PPP
151 if (memcmp(packet->ethHdr.h_dest, conn->myEth, ETH_ALEN)) return 0; 151 if (memcmp(packet->ethHdr.h_dest, conn->myEth, ETH_ALEN)) return 0;
Line 152... Line 152...
152 152
153 /* If we're not using the Host-Unique tag, then accept the packet */ 153 /* If we're not using the Host-Unique tag, then accept the packet */
154 - if (!conn->useHostUniq) return 1; 154 - if (!conn->useHostUniq) return 1;
Line 155... Line 155...
155 + if (!conn->hostUniq.length) return 1; 155 + if (!conn->hostUniq.length) return 1;
156 156
157 parsePacket(packet, parseForHostUniq, &forMe); 157 parsePacket(packet, parseForHostUniq, &forMe);
158 return forMe; 158 return forMe;
Line 159... Line 159...
159 @@ -494,16 +494,12 @@ sendPADI(PPPoEConnection *conn) 159 @@ -474,16 +474,12 @@ sendPADI(PPPoEConnection *conn)
160 cursor += namelen + TAG_HDR_SIZE; 160 cursor += namelen + TAG_HDR_SIZE;
161 161
Line 177... Line 177...
177 + cursor += len + TAG_HDR_SIZE; 177 + cursor += len + TAG_HDR_SIZE;
178 + plen += len + TAG_HDR_SIZE; 178 + plen += len + TAG_HDR_SIZE;
179 } 179 }
Line 180... Line 180...
180 180
181 packet.length = htons(plen); 181 packet.length = htons(plen);
182 @@ -669,7 +665,7 @@ int main(int argc, char *argv[]) -  
183 conn->discoveryTimeout = PADI_TIMEOUT; -  
Line -... Line 182...
-   182 @@ -645,7 +641,7 @@ int main(int argc, char *argv[])
-   183
184 conn->discoveryAttempts = MAX_PADI_ATTEMPTS; 184 memset(conn, 0, sizeof(PPPoEConnection));
185 185
186 - while ((opt = getopt(argc, argv, "I:D:VUQS:C:t:a:h")) > 0) { 186 - while ((opt = getopt(argc, argv, "I:D:VUAS:C:h")) > 0) {
187 + while ((opt = getopt(argc, argv, "I:D:VUW:QS:C:t:a:h")) > 0) { 187 + while ((opt = getopt(argc, argv, "I:D:VUW:AS:C:h")) > 0) {
188 switch(opt) { 188 switch(opt) {
189 case 'S': 189 case 'S':
190 conn->serviceName = xstrdup(optarg); 190 conn->serviceName = xstrdup(optarg);
191 @@ -696,7 +692,23 @@ int main(int argc, char *argv[]) 191 @@ -654,7 +650,23 @@ int main(int argc, char *argv[])
192 } 192 conn->acName = xstrdup(optarg);
193 break; 193 break;
194 case 'U': 194 case 'U':
195 - conn->useHostUniq = 1; 195 - conn->useHostUniq = 1;
Line 222... Line 222...
222 +#include <ctype.h> 222 +#include <ctype.h>
223 +#include <string.h> 223 +#include <string.h>
Line 224... Line 224...
224 224
225 /* How do we access raw Ethernet devices? */ 225 /* How do we access raw Ethernet devices? */
226 #undef USE_LINUX_PACKET 226 #undef USE_LINUX_PACKET
227 @@ -219,7 +221,7 @@ typedef struct PPPoEConnectionStruct { 227 @@ -217,7 +219,7 @@ typedef struct PPPoEConnectionStruct {
228 char *serviceName; /* Desired service name, if any */ 228 char *serviceName; /* Desired service name, if any */
229 char *acName; /* Desired AC name, if any */ 229 char *acName; /* Desired AC name, if any */
230 int synchronous; /* Use synchronous PPP */ 230 int synchronous; /* Use synchronous PPP */
231 - int useHostUniq; /* Use Host-Uniq tag */ 231 - int useHostUniq; /* Use Host-Uniq tag */
232 + PPPoETag hostUniq; /* Use Host-Uniq tag */ 232 + PPPoETag hostUniq; /* Use Host-Uniq tag */
233 int printACNames; /* Just print AC names */ 233 int printACNames; /* Just print AC names */
234 FILE *debugFile; /* Debug file for dumping packets */ 234 FILE *debugFile; /* Debug file for dumping packets */
235 int numPADOs; /* Number of PADO packets received */ 235 int numPADOs; /* Number of PADO packets received */
236 @@ -276,6 +278,33 @@ void pppoe_printpkt(PPPoEPacket *packet, 236 @@ -273,6 +275,33 @@ void pppoe_printpkt(PPPoEPacket *packet,
237 void (*printer)(void *, char *, ...), void *arg); 237 void (*printer)(void *, char *, ...), void *arg);
Line 238... Line 238...
238 void pppoe_log_packet(const char *prefix, PPPoEPacket *packet); 238 void pppoe_log_packet(const char *prefix, PPPoEPacket *packet);
239 239