[PATCH 6/6]NET:AX25:ROSE Removes a conditional return and corrects the return value.

DORMANTno replies

From: Richard Stearn <hidden>
Date: 2016-07-16 09:46:59
Also in: linux-hams
Subsystem: networking [general], the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Subject: [PATCH 6/6]NET:AX25:ROSE Removes a conditional return and corrects the return value.
Removes a conditional return and corrects the return value.

The ROSE header is always finished (as it is not dependant on daddr) so
the test for daddr is not required.

Return value fixed as positive added header length.

Signed-off-by: Richard Stearn <redacted>
---
 net/rose/rose_dev.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/net/rose/rose_dev.c b/net/rose/rose_dev.c
index 44eca10..dc38608 100644
--- a/net/rose/rose_dev.c
+++ b/net/rose/rose_dev.c
@@ -47,10 +47,7 @@ static int rose_header(struct sk_buff *skb, struct net_device *dev,
 	*buff++ = 0x7F;				/* magic marker */
 	*buff++ = AX25_P_IP;			/* this is an IP packet */
 
-	if (daddr != NULL)
-		return 37;
-
-	return -37;
+	return ROSE_MIN_LEN + 2;	/* always creates a finished header */
 }
 
 static int rose_set_mac_address(struct net_device *dev, void *addr)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help