ng_pppoe.c (ed52f174ee7c099ceedd0963caab0d385dc62b02) | ng_pppoe.c (d9da9cba4452e7212ed4a3e475e7e4fc990a9849) |
---|---|
1#define SIGNOFF "session closed" 2/* 3 * ng_pppoe.c 4 * 5 * Copyright (c) 1996-1999 Whistle Communications, Inc. 6 * All rights reserved. 7 * 8 * Subject to the following obligations and disclaimer of warranty, use and --- 1111 unchanged lines hidden (view full) --- 1120 sp = hook->private; 1121 switch (sp->state) { 1122 case PPPOE_NEWCONNECTED: 1123 case PPPOE_CONNECTED: { 1124 struct pppoe_full_hdr *wh; 1125 /* 1126 * Bang in a pre-made header, and set the length up 1127 * to be correct. Then send it to the ethernet driver. | 1#define SIGNOFF "session closed" 2/* 3 * ng_pppoe.c 4 * 5 * Copyright (c) 1996-1999 Whistle Communications, Inc. 6 * All rights reserved. 7 * 8 * Subject to the following obligations and disclaimer of warranty, use and --- 1111 unchanged lines hidden (view full) --- 1120 sp = hook->private; 1121 switch (sp->state) { 1122 case PPPOE_NEWCONNECTED: 1123 case PPPOE_CONNECTED: { 1124 struct pppoe_full_hdr *wh; 1125 /* 1126 * Bang in a pre-made header, and set the length up 1127 * to be correct. Then send it to the ethernet driver. |
1128 * But first correct the length. |
|
1128 */ | 1129 */ |
1130 sp->pkt_hdr.ph.length = htons((short)(m->m_pkthdr.len)); |
|
1129 M_PREPEND(m, sizeof(*wh), M_DONTWAIT); 1130 if (m == NULL) { 1131 LEAVE(ENOBUFS); 1132 } 1133 wh = mtod(m, struct pppoe_full_hdr *); 1134 bcopy(&sp->pkt_hdr, wh, sizeof(*wh)); | 1131 M_PREPEND(m, sizeof(*wh), M_DONTWAIT); 1132 if (m == NULL) { 1133 LEAVE(ENOBUFS); 1134 } 1135 wh = mtod(m, struct pppoe_full_hdr *); 1136 bcopy(&sp->pkt_hdr, wh, sizeof(*wh)); |
1135 wh->ph.length = htons((short)(m->m_pkthdr.len)); | |
1136 NG_SEND_DATA( error, privp->ethernet_hook, m, meta); 1137 privp->packets_out++; 1138 break; 1139 } 1140 case PPPOE_PRIMED: 1141 /* 1142 * A PADI packet is being returned by the application 1143 * that has set up this hook. This indicates that it --- 338 unchanged lines hidden --- | 1137 NG_SEND_DATA( error, privp->ethernet_hook, m, meta); 1138 privp->packets_out++; 1139 break; 1140 } 1141 case PPPOE_PRIMED: 1142 /* 1143 * A PADI packet is being returned by the application 1144 * that has set up this hook. This indicates that it --- 338 unchanged lines hidden --- |