[PATCH] report that OAM is not supported

Roman Kagan rkagan at mail.ru
Tue Apr 26 00:12:22 EDT 2005


  Hi,

Pending the proper OAM support, I believe we at least should warn the
user that we receive OAM cells.  Otherwise users, whose ISP uses OAM
loopback to detect the presense of the equipment on the user's end, are
left in a situation when the ADSL link is up and running but the
internet connection over it can't be established for no apparent reason.

Please consider applying.

Cheers,
  Roman.

P.S.  The user whose problem was detected by this patch, has agreed to
exercise my other patch to support OAM loopback.  Let's see how it works
out.

 usbatm.c |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

Index: usbatm.c
===================================================================
RCS file: /home/cvs/usbatm/usbatm.c,v
retrieving revision 1.19
diff -u -p -r1.19 usbatm.c
--- usbatm.c	15 Apr 2005 08:49:51 -0000	1.19
+++ usbatm.c	26 Apr 2005 04:00:12 -0000
@@ -237,18 +237,16 @@ static void usbatm_extract_cells(struct 
 	struct atm_vcc *vcc;
 	struct sk_buff *sarb;
 	struct usbatm_vcc_data *vcc_data;
-	int cached_vci = 0;
+	u8 pti;
+	u32 vci, cached_vci = 0;
+	u16 vpi, cached_vpi = 0;
 	unsigned int i;
-	int pti;
-	int vci;
-	short cached_vpi = 0;
-	short vpi;
 
 	for (i = 0; i < howmany;
 	     i++, source += ATM_CELL_SIZE + instance->rx_padding) {
 		vpi = ((source[0] & 0x0f) << 4) | (source[1] >> 4);
 		vci = ((source[1] & 0x0f) << 12) | (source[2] << 4) | (source[3] >> 4);
-		pti = (source[3] & 0x2) != 0;
+		pti = ((source[3] & 0xe) >> 1);
 
 		vdbg("%s: vpi %hd, vci %d, pti %d", __func__, vpi, vci, pti);
 
@@ -264,6 +262,14 @@ static void usbatm_extract_cells(struct 
 		}
 
 		vcc = vcc_data->vcc;
+
+		/* OAM F5 end-to-end */
+		if (pti == ATM_PTI_E2EF5) {
+			atm_warn(instance, "%s: OAM not supported (vpi %d, vci %d)!\n", __func__, vpi, vci);
+			atomic_inc(&vcc->stats->rx_err);
+			continue;
+		}
+
 		sarb = vcc_data->sarb;
 
 		if (sarb->tail + ATM_CELL_PAYLOAD > sarb->end) {
@@ -276,7 +282,7 @@ static void usbatm_extract_cells(struct 
 		memcpy(sarb->tail, source + ATM_CELL_HEADER, ATM_CELL_PAYLOAD);
 		__skb_put(sarb, ATM_CELL_PAYLOAD);
 
-		if (pti) {
+		if (pti & 1) {
 			struct sk_buff *skb;
 			unsigned int length;
 			unsigned int pdu_length;



More information about the Usbatm mailing list