: ir247_lpt_fix.diff
PATCH 1/1 : ir247_lpt_fix.diff
ir247_lpt_fix.diff :
------------------
o [CRITICA] Provide a valid skb when calling irlmp_connect_response()
o [FEATURE] Display something meaningfull in /proc/net/irda/ircomm
net/irda/ircomm/ircomm_core.c renamed from net/irda/ircomm-d8/ircomm_core.c +19 -3
@@ -490,18 +490,34 @@ int ircomm_proc_read(char *buf, char **s {struct ircomm_cb *self;unsigned long flags; -int i=0 ;save_flags (flags);cli (); len =0 ; - len +=sprintf (buf+len,"Instance %d:\n" , i++); - self = (struct ircomm_cb *)hashbin_get_first (ircomm);while (self !=NULL ) { ASSERT(self->magic == IRCOMM_MAGIC, return len;); + +if (self->line <0x10 ) + len +=sprintf (buf+len,"ircomm%d" , self->line); +else + len +=sprintf (buf+len,"irlpt%d" , self->line -0x10 ); + len +=sprintf (buf+len," state: %s, " , + ircomm_state[ self->state]); + len +=sprintf (buf+len, +"slsap_sel: %#02x, dlsap_sel: %#02x, mode:" , + self->slsap_sel, self->dlsap_sel); +if (self->service_type &IRCOMM_3_WIRE_RAW ) + len +=sprintf (buf+len," 3-wire-raw" ); +if (self->service_type &IRCOMM_3_WIRE ) + len +=sprintf (buf+len," 3-wire" ); +if (self->service_type &IRCOMM_9_WIRE ) + len +=sprintf (buf+len," 9-wire" ); +if (self->service_type &IRCOMM_CENTRONICS ) + len +=sprintf (buf+len," Centronics" ); + len +=sprintf (buf+len,"\n" ); self = (struct ircomm_cb *)hashbin_get_next (ircomm); }
net/irda/ircomm/ircomm_lmp.c renamed from net/irda/ircomm-d8/ircomm_lmp.c +19 -1
@@ -103,12 +103,30 @@ int ircomm_lmp_connect_request(struct ir* * */ -int ircomm_lmp_connect_response (struct ircomm_cb *self,struct sk_buff *skb) +int ircomm_lmp_connect_response (struct ircomm_cb *self,struct sk_buff *userdata) { +struct sk_buff *skb;int ret;IRDA_DEBUG (0 , __FUNCTION__"()\n" ); +/* Any userdata supplied? */ +if (userdata ==NULL ) { + skb =dev_alloc_skb (64 ); +if (!skb) +return -ENOMEM ; + +/* Reserve space for MUX and LAP header */ +skb_reserve (skb,LMP_MAX_HEADER ); + }else { + skb = userdata; +/* +* Check that the client has reserved enough space for +* headers +*/ + ASSERT(skb_headroom(skb) >= LMP_MAX_HEADER, return -1;); + } + ret =irlmp_connect_response (self->lsap, skb);return 0 ;